Rock image classification method, equipment, medium and product

By using the method of combining twin networks and spatial transformation modules in rock image classification, global and local features are integrated, which solves the problem of traditional methods ignoring key areas and spatial distribution features, and significantly improves the accuracy and prediction accuracy of rock image classification.

CN118628811AInactive Publication Date: 2024-09-10INST OF MINERAL RESOURCES CHINESE ACAD OF GEOLOGICAL SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410742745.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing rock image classification methods are difficult to effectively capture the deep semantic information of complex rock images. Traditional deep learning models ignore key regional features and are difficult to fully utilize the spatial distribution and spectral characteristics of rock images, resulting in limited classification accuracy.

Method used

The twin network is combined with the spatial transformation module (SGD module) to integrate global and local features through extended convolution and spatial transformation module (STN) to extract key information of rock images, reduce information loss and improve classification accuracy.

Benefits of technology

It significantly improves the accuracy and prediction accuracy of rock image classification, can identify rock types more accurately, reduces the impact of non-correlated information on classification, and improves spatial invariance processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628811A
    Figure CN118628811A
Patent Text Reader

Abstract

The invention discloses a rock image classification method, equipment, a medium and a product, and relates to the field of image classification. According to the method, the specially designed twinborn global dense network Siamese Global DenseNet (i.e., the SGD module) is introduced, so that the information loss can be reduced, and the SGD module can integrate global and local features, so that the prediction precision of the rock is improved. In addition, in order to solve the problem that secondary features affect feature classification of the rock image, a space transformation module (STN) is introduced to transform the rock image, local key information of the rock image is extracted, and the influence of non-relevant information on rock image classification is reduced. Through the constructed rock image classification model, the rock image classification result can be accurately obtained based on the obtained rock image, and then the prediction precision of the rock is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image classification, and in particular to a rock image classification method, equipment, medium and product. Background Art

[0002] Rocks are the product of geological activities and the dynamic evolution of the earth. In the field of geology, rocks are the carriers of mineral deposits. Rock and mineral identification is of great significance in geological surveys, engineering exploration, and mineral exploration. Therefore, accurate rock classification is a key task in the field of geology. Rocks can be named and classified according to their properties, such as mineral composition, content, and structure. These properties are reflected in the shape, color, and texture characteristics of mineral images, and classified and identified. However, the structure of rocks is heterogeneous and strongly directional, and automatic identification through artificial intelligence methods is very challenging.

[0003] Existing rock microscopic image classification methods can be divided into two categories: manual feature-based methods and deep learning methods. Manual feature-based methods refer to the use of rock image features, including color, texture, protrusion, particle size and shape, etc. to classify rocks. At present, manual methods mainly extract rock attribute features through traditional mathematical and statistical models and computational analysis. The extracted features are added to various classifiers, such as Naive Bayes (NB) and decision trees (DT), and finally the classification results are obtained. (Mkwelo, 2004) The least squares polynomial method is used to fit the irregular edges of the ore, and then the edge contour information of the ore is obtained. Zhang (2004) applied the Naive Bayes k-neighbor algorithm to process rock image classification. ( et al., 2013) used the nearest neighbor method and the k-nearest neighbor method to classify rock images. Sharif et al. (2015) designed a classifier that uses 13 rock image texture parameters to output Bayesian probability for rock image classification. There are also new methods for image classification based on particle geometric features rather than local features, but all of the above methods have certain limitations. Lepisto et al. (2005) used bandpass filtering technology to process images in color space and used color analysis of multi-scale texture images to classify rocks. Seng and Chen (2009) applied the machine learning method of RS theory and support vector machine (SVM) model to classify rock images. Existing feature-based manual methods show different performances. Feature-based manual methods are seriously affected by human prior knowledge and have low transferability. This method of relying on manual feature description to classify rock images relies more on prior knowledge and is difficult to capture the deep semantic information of complex rock images.

[0004] In recent years, support vector machines (SVM) have been widely used in image recognition and are recognized as one of the widely used image pattern recognition methods. There are many applications based on support vector machine classification. N. Li et al. (2017) proposed a transfer learning method and sandstone microscopic image classification, and demonstrated the effectiveness of the method through four classifiers, namely Naive Bayesian classifier (NB), decision tree (DT), logistic regression (LR) and SVM. Momma et al. (2006) used color to characterize the degree of rock weathering, and used support vector machine and neural network to classify the degree of rock weathering with network algorithm. Li and Wang (2019) applied PSO-SVM technology to classify rocks.

[0005] In recent years, deep learning methods have been successfully applied to rock image classification, with local connections, shared weights, and pooling. Deep learning methods are highly robust and fault-tolerant, easy to train, and have optimized network structures. Pascual et al. (2019) used a three-layer CNN method to classify rock images. Y. Zhang et al. (2018) used the Inception-v3CNN architecture to train and test a rock type recognition model for granite, and used transfer learning to classify phyllite and breccia images. Recently, a new method, using a concatenated convolutional neural network (Con-CNN), has been used for rock thin section classification. In addition, there is a fine-grained image classification framework technology that integrates image cropping combined with the SBV algorithm, which aims to improve the classification accuracy of fine-grained rock samples. CNN is currently a very successful deep learning model. It has a wide range of applications and is good at directly inputting images. It is an effective tool in the field of image analysis and processing. Karimpouli and Tahmasebi (2019) used a network of deep convolutional autoencoders to segment digital rock images. Baraboshkin et al. (2020) designed a new method based on CNN model to reduce the time required for accurate rock identification. Su et al. (2020) designed a CNN model that can effectively extract features from rock images and automatically classify them. Zhu et al. (2018) proposed a deep separable convolutional network to classify rocks in rock profile microscopic images. Ran et al. (2019) proposed a field rock type recognition method based on deep convolutional neural network, which can identify six common rock types. Guojian and Peisong (2021) used residual network to construct a classifier for rock image classification and demonstrated the efficiency and accuracy of residual network. The twin network can cleverly combine the two characteristics of polarization images, and eliminate domain-related information through adversarial training on feature encoding, effectively reducing the negative impact of regional features on rock classification. Based on this, end-to-end deep learning methods represented by convolutional neural network (CNN) have achieved many successes in the field of rock image classification. However, the end-to-end CNN-based method has difficulty focusing on the key areas of rock microscopic images and cannot fully utilize the overall information of rock images.

[0006] Based on the above description, the existing feature-based manual methods show different performances. However, this method relies on manual feature description to design rock images with a priori features and is difficult to capture the deep semantic information of complex rock images, which has certain limitations. Deep learning methods have substantial effects in improving the efficiency of rock image recognition. However, they still have some shortcomings: (1) They directly extract features from the entire image without paying attention to the key areas related to rock fiber images. Figure 2 As shown in (a), both images are coarse-grained. The yellow and red frames highlight the key areas in the rock images. These key areas are not easy to be identified by general deep learning models, but these features are crucial for rock classification. Traditional deep learning models tend to ignore the differences in key areas in these images. (2) Traditional end-to-end CNN-based models have difficulty focusing on key areas of rock microscopic images and cannot fully utilize the overall information of rock images. They focus more on local information and cannot fully utilize the spatial distribution characteristics and spectral characteristics of rocks. Figure 2 As shown in (b), the two calcium images in the blue frame are surrounded by other minerals and have similar spatial distribution characteristics, but the spectral characteristics of the two carbonaceous images are completely different. Figure 2 As shown in (c), the same rock type but diverse spatial features pose a challenge to our classification task. (3) The rock microscopic image datasets currently used usually consist of hundreds to thousands of images, which cannot meet the training requirements of end-to-end data-driven CNN methods.

[0007] The mechanism of CNN enables CNN to achieve transformation invariance when processing images, but it cannot achieve scale invariance and rotation invariance. Even the image models built by the popular transformer (swin transformer, vision transformer) cannot achieve these two points. This is because they will refer to the relative size and position direction of objects in the image when processing. Objects of different sizes and directions are different things to the network. This problem is collectively referred to as the spatial invariance problem. Even objects in different directions are really different things in themselves, such as text. The pooling layer solves this problem to a certain extent, because when doing max pooling (maximum pooling) or average pooling (average pooling), as long as this feature exists, it can be extracted, and the pooling layer does not care where it is. However, the kernel size (convolution and size) of pooling is usually relatively small, and it is difficult to achieve spatial invariance for large objects unless the network is very deep. Summary of the invention

[0008] In order to solve the above problems existing in the prior art, the present invention provides a rock image classification method, equipment, medium and product.

[0009] To achieve the above object, the present invention provides the following solutions:

[0010] A rock image classification method, comprising:

[0011] Obtain rock images;

[0012] Constructing a rock image classification model; the constructed rock image classification model is a network model with a twin network as the main network, an SGD module for feature extraction, and an implanted spatial transformation module; the convolution of the twin network is an extended convolution; the SGD module includes a global module and a local module;

[0013] The rock image is input into the rock image classification model to obtain a rock image classification result.

[0014] Optionally, the rock image is input into the rock image classification model to obtain a rock image classification result, specifically including:

[0015] In the first sub-network of the twin network, the rock image is transformed by the spatial conversion module and then input into the local module, and the output features of the local module are regularized by a BN layer to obtain local features;

[0016] In the first sub-network of the twin network, after the rock image is input into the global module, the global feature is obtained by regularization processing of the BN layer;

[0017] Using a fully connected layer to concatenate and combine the local features obtained by the first sub-network and the global features obtained by the second sub-network to obtain a local classification score and a global classification score;

[0018] An average value of the local classification score and the global classification score is determined, and the rock image classification result is obtained based on the average value.

[0019] Optionally, in the rock image classification model, the fully connected layer is replaced by a global average pooling layer.

[0020] Optionally, the space conversion module includes: a positioning network, a grid generator and a sampler;

[0021] The positioning network is used to determine parameters of image space transformation;

[0022] The grid generator is used to create a new coordinate grid based on the parameters determined by the positioning network; the new coordinate grid is used to transform the input image to the output space;

[0023] The sampler is used to perform a sampling operation on the rock image using the new coordinate grid to generate a transformed image.

[0024] Optionally, the positioning network is a convolutional neural network or a fully connected network.

[0025] Optionally, the positioning network includes three convolutional layers, three pooling layers, a GAP layer, a BN layer and a fully connected layer.

[0026] Optionally, the formula for determining the dilated convolution kernel of the extended convolution is:

[0027] K = D × (k-1) + 1;

[0028] Where k is the size of the input convolution kernel, D is the dilution factor, and K is the size of the dilated convolution kernel.

[0029] A computer device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the rock image classification methods described above.

[0030] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements any of the rock image classification methods described above.

[0031] A computer program product comprises a computer program, which implements any of the rock image classification methods described above when executed by a processor.

[0032] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0033] The present invention can reduce information loss by introducing a specially designed Siamese Global DenseNet (i.e., SGD module), and the SGD module can integrate global and local features to improve the prediction accuracy of rocks. In addition, in order to solve the problem that secondary features affect the feature classification of rock images, the present invention also introduces a spatial transformation module (STN) to transform rock images, extract local key information of rock images, and reduce the impact of irrelevant information on rock image classification. Through the constructed rock image classification model, based on the acquired rock images, the rock image classification results can be accurately obtained, thereby improving the prediction accuracy of rocks. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] 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. Obviously, 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 work.

[0035] Figure 1 A flow chart of a rock image classification method provided by an embodiment of the present invention;

[0036] Figure 2 This is the result of the existing rock microscopic image classification challenge; Figure 2 (a) is the result diagram of the key area that is difficult to capture. Figure 2 (b) Complex global spatial distribution characteristics result diagram, Figure 2 (c) shows the result with similar spatial distribution characteristics but very different spectral characteristics;

[0037] Figure 3 A schematic diagram of the structure of a space conversion module (STN) provided in an embodiment of the present invention;

[0038] Figure 4 This is a conceptual diagram of traditional convolution and dilated convolution; Figure 4 (a) is a schematic diagram of traditional convolution. Figure 4 (b) is a schematic diagram of the dilated convolution with a dilation rate of 2. Figure 4 (c) Schematic diagram of the dilation rate of 3 dilated convolution;

[0039] Figure 5 An example diagram of correct classification of different types of rocks by DenseNet-121 and 2SRockNet provided in an embodiment of the present invention; wherein, Figure 5 (a) is an example of the correct classification of coarse-grained rock. Figure 5 (b) is an example of the correct classification of agglomerate rocks. Figure 5 (c) is an example diagram of the classification of calcareous rocks. Figure 5 (d) is an example of the correct classification of carbonaceous rocks;

[0040] Figure 6 This is an example diagram of a 2SRockNet correct classification but a DenseNet-121 incorrect classification provided by an embodiment of the present invention; wherein, Figure 6 (a) is an example of coarse-grained rock that is correctly classified by 2SRockNet but misclassified by DenseNet-121. Figure 6 (b) is an example of agglomerate rock that is correctly classified by 2SRockNet but misclassified by DenseNet-121. Figure 6(c) is an example of calcareous rock that is correctly classified by 2SRockNet but misclassified by DenseNet-121. Figure 6 (d) is an example of carbonaceous rock correctly classified by 2SRockNet but incorrectly classified by DenseNet-121;

[0041] Figure 7 An example diagram of an embodiment of the present invention that is misclassified by DenseNet-121 but correctly classified by GDNet; wherein, Figure 7 (a) is an example of silt being misclassified by DenseNet-121 but correctly classified by GDNet. Figure 7 (b) is an example of calcium being misclassified by DenseNet-121 but correctly classified by GDNet. Figure 7 (c) is an example of carbon being misclassified by DenseNet-121 but correctly classified by GDNet. Figure 7 (d) is an example of iron being misclassified by DenseNet-121 but correctly classified by GDNet;

[0042] Figure 8 An example diagram of an embodiment of the present invention that is misclassified by GDNet but correctly classified by 2SRockNet; wherein, Figure 8 (a) is an example of a coarse grain being misclassified by GDNet. Figure 8 (b) is an example of coarse grains correctly classified by 2SRockNet. Figure 8 (c) is an example of a microcrystal that is misclassified by GDNet. Figure 8 (d) is an example of a microcrystal correctly classified by 2SRockNet. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] The purpose of the present invention is to provide a rock image classification method, equipment, medium and product, aiming to solve the problem of secondary features affecting the feature classification of rock images and improve the prediction accuracy of rocks.

[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0046] Example 1

[0047] This embodiment provides a rock image classification method, such as Figure 1 As shown, the method includes:

[0048] Step 100: Acquire rock images.

[0049] Step 101: Construct a rock image classification model. The constructed rock image classification model is a network model with a twin network as the main network and an implanted spatial transformation module using an SGD module for feature extraction. The SGD module includes a global module and a local module. Among them, the traditional twin network consists of two sub-networks with the same architecture and weights, which convert the entire image and key areas into feature maps. In the present invention, the convolution of the twin network used is an extended convolution. In order to aggregate multi-scale contextual information, the convolution kernel of the extended convolution of the twin network is replaced with an expanded convolution kernel. The use of an extended convolution kernel in the rock image classification model is a good alternative to the pooling layer. By introducing the expansion rate parameter, for the convolution kernel of the same size, zero convolution will produce a larger perception field. In addition, zero convolution has fewer parameters than a normal convolution kernel of the same size. Therefore, the introduction of extended convolution is used to solve the information loss caused by image resolution reduction and downsampling.

[0050] Figure 4 A regular convolution kernel and a convolution kernel on an image with a dilated size of 9×9 are shown, where Figure 4 (a) is a conventional 3×3 convolution kernel. Figure 4 (b) is a zero-convolution with dilation rate 2. It is formed by inserting a hole (with weight 0) between each hole. Figure 4 Similarly, Figure 4 (c) is the core with expansion rate 3. Figure 4 As shown, Figure 4 The receptive field of the convolution kernel in (a) is 3×3. Figure 4 The receptive field of the convolution kernel in (b) is 7×7. Figure 4 The receptive field of the convolution kernel in (c) is 15×15. As the number of inserted holes increases, the range of the receptive field also increases. This has the advantage of Figure 4 (a) Figure 4 (b) and Figure 4 The parameter count of (c) remains unchanged. Therefore, by using such an extended convolution kernel to process the image, the convolution kernel can obtain more information without increasing the computational workload. Formula (1) gives the principle of extended convolution, where k is the size of the input convolution kernel, D is the dilution factor, and K represents the equivalent convolution kernel size obtained after applying the expanded convolution.

[0051] K=D×(k-1)+1 (1)

[0052] In order to extract the global context features of rock images, a 3×3 convolution kernel with a dilation rate of 2 is added to construct a global module.

[0053] Based on the above description, the rock image classification model constructed in this embodiment is a twin network (referred to as 2SRockNet) that uses spatial positioning technology for rock image classification. 2SRockNet extracts key local and global features from rock microscopic images, and reduces information loss by introducing a specially designed twin global dense network Siamese Global DenseNet (i.e., SGD module). The SGD module can integrate global and local features to improve the prediction accuracy of rocks. In addition, in order to solve the problem of secondary features affecting the feature classification of rock images, a spatial transformation module (referred to as STN) is introduced to transform the rock cross-section microscopic image. STN is designed to solve the problem of spatial invariance. Its main idea is to train a pre-network that can linearly transform objects to the normal size and direction of the model. This pre-network can be pre-placed in any image network, plug-and-play. It can also be trained with the entire network at the same time. Local key information is extracted through STN to reduce the impact of irrelevant information on rock image classification.

[0054] Step 102: Input the rock image into a rock image classification model to obtain a rock image classification result.

[0055] In the actual application process, based on the model structure constructed above, the original image (i.e., the acquired rock image) is first transformed to extract more information features from the original image. When the image is transformed, there is a risk of information loss. In order to prevent the loss of information after the image transformation, the transformed image and the original image are respectively passed to two SGD modules (i.e., the global module and the local module) for feature extraction. For example, in the SGD module, a 3×3 convolution kernel with a dilation rate of 2 is used to expand the receptive field of the neural network.

[0056] In addition, in order to avoid overfitting, the fully connected layer (FC) in the convolutional neural network (CNN) can be replaced by global average pooling (GAP), which has fewer training parameters. The original image and the converted image are standardized and fused in the batch normalization (BN) layer to achieve the classification and detection of rock images.

[0057] In recent years, image recognition based on global and local features, or a combination of the two, has become a trend in image recognition. Based on this, the present invention can use DenseNet as a twin network, use the SGD module to extract features, and use the weight sharing method to integrate global and local characteristics, so as to combine these two features in one network for end-to-end training to achieve maximum accuracy. Based on this description, the implementation process of step 102 can be:

[0058] (1) In the first subnetwork of the twin network, the rock image is transformed by the spatial transformation module and then input into the local module. The output features of the local module are regularized by the BN layer to obtain local features. The local features of the image are mainly the details of specific image areas or edge points. The recognition of these local areas is often the guarantee of good classification results.

[0059] Among them, before encoding the obtained features, when the input rock image is appropriately transformed (i.e., feature extraction) by the spatial transformation module (STN), the transformation is mainly applied to the feature extraction of the entire image, which may include transformation operations such as scaling, cropping, and rotation. The advantage of this mechanism is that the rock image can be transformed dynamically, while the image received by the pooling layer is fixed and localized. Therefore, the spatial transformation module is used to extract the most relevant areas and convert these key areas into a standardized and desired form, thereby improving the classification ability of the network.

[0060] To achieve the above functions, Figure 3 As shown, the spatial transformation module (STN) used in this embodiment is mainly composed of the third part: a positioning network, a grid generator and a sampler.

[0061] Among them, the localization network performs the parameter prediction function and outputs the spatial transformation parameters θ that should be applied to the feature map through multiple hidden layers. The localization network is a small convolutional neural network or a fully connected network, and the output size of the network is fixed, corresponding to the number of parameters required for a specific transformation.

[0062] The grid generator performs the function of coordinate mapping, finding the mapping T(θ) between the output and input features through the spatial transformation parameters θ and the defined transformation method: Use the spatial transformation parameters θ to create a sampling grid, which is a set of points where the input mapping should be sampled to generate the transformed output. The grid generator uses the spatial transformation parameters θ output by the positioning network, which is a 6-dimensional (2*3) matrix. Perform the corresponding spatial transformation on the feature map. Let the coordinates of each pixel position of the input feature map U be (a i , b i ), the coordinates of each pixel position of the feature map after spatial transformation are Then the mapping relationship between the input and output feature maps (selecting the transformation method as affine transformation) is shown in formula (2):

[0063]

[0064] Where, T θi () is the transformed sampling grid.

[0065] The parameters of affine transformation in two-dimensional space are 6 (θ 11,θ 12 ,…θ 23 ), these six parameters can control the translation, rotation and scaling of the entire image. The parameter θ 11 and θ 22 Mainly controls the scaling, parameter θ 12 and θ 21 Mainly controls the rotation, parameter θ 13 and θ 23 Mainly controls rotation.

[0066] The sampler samples pixel values ​​from the input image according to the coordinate grid provided by the grid generator to produce the transformed output image. The sampling process needs to handle the case of non-integer pixel coordinates, which is usually achieved by bilinear interpolation or other interpolation methods to estimate the value of the new pixel from the surrounding pixel values.

[0067] The main function of the sampler is to use the transformed sampling grid generated by the grid generator to sample the corresponding pixel values ​​from the input feature map U to generate the transformed output feature map V. This process is achieved through the image sampling technology, which ensures the differentiability of the spatial transformation, thereby allowing the gradient to flow back to the network through the transformation and achieve end-to-end training. Formula (3) is a bilinear interpolation, and its partial derivatives are calculated according to formula (4).

[0068]

[0069] In the formula, is the converted output feature map of channel C, H is the height of the feature map, n, m represent the subscripts of the output values ​​in the output matrix, W is the width of the feature map, is the value corresponding to the input position channel c(n,m).

[0070] It can be seen that the max function selects and outputs The pixel position with a distance of 1, The closer the points are, the higher the weights are assigned, achieving The scores of the four surrounding points are used to calculate the final score. Since the max function is differentiable, the partial derivative calculation formula is as follows:

[0071]

[0072] Based on the above description, the working principle of the sampler is:

[0073] The sampler is based on the transformed sampling grid T θ(G) extracts pixel values ​​from the input feature map U to produce the output feature map V. Each position in the sampling grid indicates a specific sampling point on the input feature map U. During the sampling process, sampling points with non-integer coordinates may be encountered, so an interpolation method is needed to determine the pixel values ​​of these points. Common interpolation methods include nearest neighbor interpolation, bilinear interpolation, etc.

[0074] Further, based on the above description, the workflow of STN is:

[0075] Input Image: Receives the original image as input.

[0076] Localization network: calculates the parameters required for spatial transformation.

[0077] GridGenerator: Creates a new coordinate grid based on these parameters, indicating how to transform the input image into the output space.

[0078] Sampler: Use this grid to sample from the original image and generate the transformed image.

[0079] Furthermore, since the affine transformation is differentiable, the gradient can pass through this module (i.e., STN) during back propagation. The parameters of the transformation are provided by the localization network regression method, and the learning parameter transformation is achieved through back propagation.

[0080] STN uses a scale transformation parameter of 0-1 to crop and transform with a sliding window of a certain scale. The sliding distances in the horizontal and vertical directions are t x and t y , extracting attention areas from rock microscopic images can effectively distinguish rock categories. The architecture of STN, especially the positioning network, includes three convolutional layers, three pooling layers, a GAP layer, a BN layer and a fully connected (FC) layer. The GAP layer is a structure that can replace the fully connected layer in CNN. Due to the large number of parameters, the fully connected layer is prone to overfitting. The GAP layer mainly performs average pooling on the feature map of the last convolutional layer to speed up calculations and reduce training parameters. As the network layer continues to increase in depth, the eigenvalues ​​of each layer tend to the upper and lower bounds of the output interval of the activation function, resulting in gradient vanishing. The BN layer can pull the eigenvalue distribution of the layer toward the standard normal distribution, and the activation function can be more responsive to the input, accelerating convergence by avoiding gradient vanishing. This structure normalizes the output value of each batch of data in the previous layer to ensure that the mean value of its output data is close to 0 and the standard deviation is close to 1, which also reduces the network's insensitivity to the initialization weights. These changes can enable the BN layer to use a larger learning rate in the network. The BN layer is denoted as It can be written as formula (5), x i is the feature map of the i-th layer in the neural network, E(x i) and Var(x i ) are the feature maps x i The expectation and variance of ε is a small positive constant, such as 10 -5 , to prevent division by zero errors.

[0081]

[0082] The first convolutional layer has a depth of 16, a kernel size of 7×7, a rectified linear unit (ReLU) activation function, and a 2×2 pooling layer. The second convolutional layer has a depth of 32, a kernel size of 5×5, a ReLU activation function, and a 2×2 pooling layer. The third layer has a number of 64 layers, a kernel size of 3×3, followed by a ReLU activation layer and a 2×2 pooling layer. The transformation parameters of the affine transformation are obtained by several convolutional layers, GAP layers, BN layers, and FC layers. The initialization parameters of the FC layer weights are manually set, and the activation function tanh is used to ensure that the transformation parameters are initialized to 0. The rotation parameters are set to 0, and the appropriate scaling parameters λ layer are specified. The λ layer is used to add two adjustable scale parameters. These six parameters constitute the affine transformation matrix.

[0083] (2) In the first sub-network of the twin network, the rock image is input into the global module and then regularized by the BN layer to obtain the global features. The global features of an image refer to the overall features of the image, including its shape, color, texture, etc.

[0084] As the depth of the network develops, the method of extracting global features becomes more and more powerful. Through deep learning, higher-dimensional features are extracted, which contain more contextual information, thus achieving more powerful image classification.

[0085] (3) A fully connected layer is used to concatenate the local features obtained by the first sub-network and the global features obtained by the second sub-network to obtain local classification scores and global classification scores.

[0086] Based on the description of steps (1) to (3) above, in the structure of 2SRockNet, the original image Ig is converted through STN to obtain the key area, and then the local module (GD l ) to obtain local features, all the way through the global module (GD g ) to obtain the global features, and then concatenate the image features. The global classification score and local classification score obtained in the FC layer are represented as F g and F l , expressed as formula (6) and formula (7) respectively.

[0087] (4) Determine the average of the local classification score and the global classification score, and obtain the rock image classification result based on the average. Based on the above description, the two sub-networks of 2SRockNet use the SGD module to share parameters to minimize parameter calculation, and finally comprehensively evaluate the classification score, that is, take F g and F l The average value F s (See formula (8)).

[0088] F g =GD g (I g ) (6)

[0089] F l =GD l (I l ) (7)

[0090]

[0091] In summary, the rock image classification method provided by the present invention adopts the SGD module. By sharing parameters between two network branches, the SGD module can integrate global and local features to improve the prediction accuracy of rocks. In addition, the rock image is transformed using a spatial transformation module (STN), and local key information is extracted through the STN module to reduce the influence of irrelevant information on the rock image classification. By fusing local features with global features, rock microscopic images can be classified and predicted more accurately.

[0092] Furthermore, based on the experimental comparison results, the advantages of the rock image classification method provided by the present invention are described. The experimental process is:

[0093] (1) Model preprocessing.

[0094] VGG-16 is selected to compare with 2SRockNet for five types of rock classification. To verify the efficacy of each key module, DenseNet-121, GDNet, DenseNet (DCNet) and Siamese DenseNet with STN (S2DNet), i.e. STN-guided dual-branch DenseNet-121 with shared parameters, are used in the model for comparison.

[0095] (2)Parameter setting.

[0096] Use TensorFlow to deploy the model, use Adam as the optimizer, and the learning rate is 10 -5, using the cross entropy loss function. All deep learning models are trained with a batch size of 8. Images are transformed by STN, S2DNet, and 2SRockNet with a batch size of 4. In S2DNet and 2SRockNet, a dropout of 0.5 is added after the BN layer, and the scale parameter of STN is adjusted to 0.8. In addition, the pre-trained weights on ImageNet are used as the initial weights for all deep learning networks.

[0097] Overall Accuracy (OA) is used as the accuracy classification standard for rock image classification. Five categories, namely granularity, debris, mechanical properties, mixed properties and basic category attributes, are used as classification. Four classic models, namely DarkNet-53, EfficientNet, ShuffleNet and Deep Subdomain adaptive Network (DSAN), are selected. These models include traditional image classification models and the latest models. The comparison results are shown in Table 1. The overall classification accuracy of granularity, debris, mechanical properties, mixed properties and basic category properties can reach 87.14%, 91.92%, 97.75%, 92.14% and 91.85% respectively, all above 85%. Compared with the most advanced models, 2SRockNet shows satisfactory performance. While its accuracy in the "basic category" is lower than that of ShuffleNet, its overall accuracy still exceeds that of ShuffleNet. 2SRockNet contains two components, STN and SGD modules. The combination of STN and SGD modules can achieve the best rock image classification accuracy.

[0098] Table 1 Classification results of different rock properties under different models

[0099] Model granularity Crumb Mechanical Mixed Basic Types average DarkNet-53 80.92% 87.67% 89.88% 86.17% 88.73% 86.67% EfficientNet 87.71% 90.21% 93.87% 91.53% 92.98% 91.26% ShuffleNet 85.03% 91.72% 92.86% 89.21% 96.49% 91.06% DSAN 82.79% 89.65% 96.25% 87.32% 90.37% 89.28% 2SRockNet 87.14% 91.92% 97.75% 92.14% 91.85% 92.%

[0100] Figure 5 Shows some example images correctly classified by DenseNet-121 and 2SRockNet. Figure 5 The spatial distribution and spectral characteristics are relatively simple. Figure 5 In (a) and (b), coarse-grained rock and agglomerate rock have uniform spatial distribution characteristics. Figure 5 In (c) and (d), the spatial distribution features of calcareous rock and carbonaceous rock images are not obvious, but the spectral features are relatively simple. Therefore, the above two models can easily classify rock microscopic images correctly. Figure 6 Shows some example images that are correctly classified by 2SRockNet but misclassified by Densenet-121. Figure 6In (a) and (b), there are complex spatial distribution features in the coarse-grained rock images and agglomerate rocks. Figure 6 In (c) and (d), the calcareous and carbonaceous rock images have complex spectral characteristics. Figure 6 The four rock section microscopic images in the figure were misclassified. It means that 2SRockNet can extract more sufficient spatial spectrum microscopic image features of rock sections.

[0101] (3) Global context analysis.

[0102] Traditional image classification algorithms usually use pooling convolutional layers to increase the receptive area. However, this reduces the dimensionality of the feature map and reduces the classification accuracy of the feature map. The larger the receptive area, the larger the acceptance range, and more global context features can be captured. In microscopic images, rock slices are often uneven in various image attribute features, and GDNet is able to extract more global attribute features.

[0103] In the experiment on mixedness, DenseNet-121 and GDNet were compared. DenseNet-121 misclassified four rock images, but GDNet classified them correctly, such as Figure 7 shown. Figure 7 (a) is silty, but DenseNet-121 incorrectly classifies it as containing silt. The difference between silty rock images and silty rock images is the amount of silt. Figure 7 In (a), there is silt in the upper right corner of the image. However, the other white mixture hides the mud properties in the upper right corner, which makes it difficult for DenseNet-121 to identify the physical properties of this part of the mud. When GDNet is used, the receptive field increases, and the surrounding original image range also increases. The mud property features in the upper right corner can be extracted by GDNet. Similarly, Figure 7 (b) is of calcium nature, but DenseNet-121 classifies it as iron nature. Figure 7 In (b), the red iron area occupies the most central position, but the surrounding calcareous area is generally larger. For these non-uniformly distributed features, the GDNet architecture can extract more global attribute information and classify them correctly. Because the receptive field of the DenseNet-121 convolution is not large enough, the global attribute features cannot be extracted and they are incorrectly classified as calcareous and carbonaceous. The results show that GDNet can extract more background information details from the microscopic images of rocks, while the SGD module can extract more global and local contextual information.

[0104] (4) Key area capture analysis.

[0105] In order to verify the effectiveness of STN, experiments were conducted on the granularity to analyze its performance and compare it with GDNet and 2SRockNet. The results of four images that were misclassified by GDNet and correctly classified by 2SRockNet are shown in the figure. Figure 8 In addition, Figure 8 The red box is the key area transformed by STN. Figure 8 As shown in (a) and (b), the coarse crystals are incorrectly classified as medium crystal properties by GDNet. The coarse crystal size is larger than the medium crystal size, and STN performs cropping, cropping the image of some areas with smaller grain sizes, so that the transformed image is more concentrated in the larger grain size area. In the subsequent process, DenseNet-121 feature extraction is used, and the overall context feature larger grain area is extracted, and in the final feature averaging layer. Figure 8 (c) and (d) are microcrystalline features, which are misclassified as mud crystal features by GDNet. The grain sizes of microcrystals and mud crystals are very small and the difference is small. After the microcrystals are processed and magnified by STN, the particle size characteristics are amplified to a certain extent and correctly classified. If GDNet is used to classify these two images, it is easy to misclassify them. It can be seen that 2SRockNet uses STN to crop and amplify rock images, and can crop out areas that have little to do with rock images. It reduces the impact of the features in these areas on the system, extracts the corresponding features, and classifies the rock images. At the same time, some subtle rock features have been enhanced to a certain extent, making it easier to distinguish some more difficult features.

[0106] Based on the above experimental results, the framework of the model provided by the rock image classification method provided by the present invention adopts a twin network architecture, which is characterized by two network branches sharing parameters, and extracting local features of key areas by introducing spatial transformation technology (i.e., using STN). By fusing local features with global features, rock microscopic images can be classified and predicted more accurately. The experimental analysis results show that the method has high accuracy, and the classification accuracy on the rock image data set is 2-3% higher than that of other rock image classification accuracy.

[0107] Example 2

[0108] A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the rock image classification method in Example 1.

[0109] Example 3

[0110] A computer-readable storage medium stores a computer program, which implements the rock image classification method in Example 1 when executed by a processor.

[0111] Example 4

[0112] A computer program product includes a computer program, which implements the rock image classification method in embodiment 1 when executed by a processor.

[0113] Example 5

[0114] A computer device, which may be a database. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the rock image classification method in Example 1 can be implemented.

[0115] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.

[0117] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0118] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. The same and similar parts between the embodiments can be referred to each other. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A rock image classification method, It is characterized in that The method comprises: Obtain rock images; Constructing a rock image classification model; the constructed rock image classification model is a network model with a twin network as the main network, an SGD module for feature extraction, and an implanted spatial transformation module; the convolution of the twin network is an extended convolution; the SGD module includes a global module and a local module; The rock image is input into the rock image classification model to obtain a rock image classification result.

2. The rock image classification method according to claim 1, It is characterized in that The rock image is input into the rock image classification model to obtain the rock image classification result, which specifically includes: In the first sub-network of the twin network, the rock image is transformed by the spatial conversion module and then input into the local module, and the output features of the local module are regularized by a BN layer to obtain local features; In the first sub-network of the twin network, after the rock image is input into the global module, the global feature is obtained by regularization processing of the BN layer; Using a fully connected layer to concatenate and combine the local features obtained by the first sub-network and the global features obtained by the second sub-network to obtain a local classification score and a global classification score; An average value of the local classification score and the global classification score is determined, and the rock image classification result is obtained based on the average value.

3. The rock image classification method according to claim 2, It is characterized in that In the rock image classification model, the fully connected layer is replaced by a global average pooling layer.

4. The rock image classification method according to claim 1, It is characterized in that The space conversion module includes: a positioning network, a grid generator and a sampler; The positioning network is used to determine parameters of image space transformation; The grid generator is used to create a new coordinate grid based on the parameters determined by the positioning network; the new coordinate grid is used to transform the input image to the output space; The sampler is used to perform a sampling operation on the rock image using the new coordinate grid to generate a transformed image.

5. The rock image classification method according to claim 4, It is characterized in that The positioning network is a convolutional neural network or a fully connected network.

6. The rock image classification method according to claim 4, It is characterized in that The positioning network includes three convolutional layers, three pooling layers, a GAP layer, a BN layer and a fully connected layer.

7. The rock image classification method according to claim 1, It is characterized in that The formula for determining the dilated convolution kernel of the extended convolution is: K = D × (k-1) + 1; Where k is the size of the input convolution kernel, D is the dilution factor, and K is the size of the dilated convolution kernel.

8. A computer device, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the rock image classification method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the rock image classification method described in any one of claims 1 to 7 is implemented.

10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the rock image classification method described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Rock classification method, terminal equipment and storage medium

    CN114170457A

  • Rock type identification method and system based on convolutional neural network

    CN117253087A