Method and device for detecting lithology identification misjudgment rate of rock debris image

By preprocessing the rock cutting image data and training on EfficientNetV2 model, combined with the Marshall theorem's extradistribution data detection, the problem of high misjudgment rate of unknown samples of rock cutting image is solved, and higher recognition accuracy and adaptability are achieved.

CN119693743APending Publication Date: 2025-03-25CHINA PETROCHEMICAL CORP +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411670021.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the prior art, the misjudgment rate of unknown samples of rock cutting images is high, and new or abnormal rock samples cannot be effectively identified.

Method used

By preprocessing and dividing the original lithotripsy image data, training, verification set and test set, it is based on the EfficientNetV2 model, high-dimensional features in the lithologic classification model are extracted and the covariance matrix is ​​constructed. The feature vectors of the input image are compared with the covariance matrix by using Martha's theorem to determine whether the image is out of distribution data, thereby reducing the misjudgment rate.

Benefits of technology

It effectively reduces the misjudgment rate of lithologic classification models, improves the ability to identify unseen rock samples, and enhances the adaptability of the model in complex geological environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693743A_ABST
    Figure CN119693743A_ABST
Patent Text Reader

Abstract

The invention discloses a rock debris image lithology identification misjudgment rate detection method and device, and the method comprises the steps: carrying out the preprocessing of original rock debris image data, and dividing the data into a training set, a verification set, and a test set; constructing an OfficientNetV2 model on the basis of the common data set, and training the OfficientNetV2 model on the basis of the training set to obtain a lithology classification model; extracting high-dimensional features of rock debris images in the lithology classification model, and constructing a covariance matrix based on the high-dimensional features of the rock debris images; inputting a to-be-input image sample into the lithology classification model to obtain a feature vector, comparing the feature vector with the covariance matrix based on the Mahalanobis theorem, and determining whether the to-be-input image is out-of-distribution data; and the misjudgment rate of the lithology classification model is determined based on the identification result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model, the misjudgment rate of the lithology classification model is reduced through detection of the out-of-distribution data, and the identification accuracy of the rock debris image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of rock cuttings image lithology recognition, and more specifically, to a method and device for detecting the misjudgment rate of rock cuttings image lithology recognition. Background Art

[0002] Studying stratum lithology is an important part of resource exploration and geological characteristics analysis for oil, natural gas, etc. It can accurately reflect the distribution of oil and gas production capacity and is an important basis for oil and gas exploration. Lithology identification is the preliminary work for analyzing stratum lithology. It is to identify the type of sample resources collected. Then, according to the rock types and content of different strata, the stratum lithology profile is drawn. Comparing the oil and gas stratum profile can provide an important reference for exploration work in new environments. Lithology identification lays the foundation for the transition from stratum lithology research to resource exploration.

[0003] As geological sample resources, rock cuttings have the advantages of being easy to obtain and lightweight, but they are more difficult to identify. In the past, manual identification was often used. Manual identification is greatly affected by the professional quality and sense of responsibility of personnel and has a high degree of subjectivity. With the development of computer technology, graphic image technology has also been applied to rock cuttings identification, but it is generally used as an auxiliary means, and the final step of reaching a conclusion is still left to manual work. Machine learning methods can replace manual identification of rock cuttings, but due to the diversity and complexity of the environment in which rock cuttings are produced, the accuracy of machine learning identification is poor and cannot meet the requirements of field applications; moreover, as a black box that only exposes input ports and output results to the outside, machine learning is not convenient for users to check and correct errors.

[0004] Image classification and recognition technology in deep learning plays an important role in the field of oil and gas exploration. Lithology recognition is of great practical significance for interpreting the geological structure of the target area and thus realizing oil and gas reservoir prediction. Using image classification and recognition technology to identify the lithology of rock cuttings images is an effective method. However, despite the excellent performance of deep learning in lithology recognition, there are still some defects. For example, the model may make misjudgments when processing unseen samples because it is mainly trained on data of known categories and has limited prediction capabilities for new or abnormal rock samples.

[0005] Therefore, a better solution is urgently needed. Summary of the invention

[0006] The present invention provides a method and device for detecting the misjudgment rate of rock type identification of rock cuttings images, which is used to solve the technical problem of high misjudgment rate of unknown samples of rock cuttings images in the prior art. The method comprises:

[0007] Preprocessing the original rock cuttings image data, and dividing the preprocessed original rock cuttings image data into a training set, a validation set and a test set;

[0008] Building an EfficientNetV2 model based on a public data set, and training the EfficientNetV2 model based on the training set to obtain a lithology classification model;

[0009] Extracting high-dimensional features of the rock cuttings image in the lithology classification model, and constructing a covariance matrix based on the high-dimensional features of the rock cuttings image;

[0010] Inputting the image sample to be input into the lithology classification model to obtain a feature vector, and comparing the feature vector with the covariance matrix based on Markov’s theorem to determine whether the image to be input is out-of-distribution data;

[0011] The misjudgment rate of the lithology classification model is determined based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model.

[0012] In some specific embodiments, the original rock cuttings image data is preprocessed, and the preprocessed original rock cuttings image data is divided into a training set, a validation set and a test set, specifically:

[0013] Performing data cropping on the original rock cuttings image data, wherein the data cropping methods include random cropping and grid cropping;

[0014] Performing color analysis on the original rock cuttings image data after data cropping, and determining whether the red proportion and the orange proportion in the original rock cuttings image data after data cropping are both greater than their corresponding proportion thresholds;

[0015] If not, the original rock cuttings image data after color analysis is randomly enhanced to obtain the training set, verification set and test set.

[0016] In some specific embodiments, an EfficientNetV2 model is constructed based on a public dataset, specifically:

[0017] Get the initial EfficientNetV2 model and its weights pre-trained on the public dataset ImageNet from the deep learning framework PyTorch;

[0018] Modifying the number of output nodes of the output layer of the pre-trained initial EfficientNetV2 model to be consistent with the number of rock cuttings categories;

[0019] The connection layer of the pre-trained initial EfficientNetV2 model is set to a fully connected layer, and the activation function of the pre-trained initial EfficientNetV2 model is set to a softmax activation function to obtain the EfficientNetV2 model.

[0020] In some specific embodiments, the EfficientNetV2 model is trained based on the training set to obtain a lithology classification model, specifically:

[0021] Preprocessing the rock cuttings image data in the training set, and inputting the preprocessed training set into the EfficientNetV2 model;

[0022] Setting hyperparameters when training the EfficientNetV2 model with the preprocessed training set;

[0023] Perform dilated convolution operations through the MBConv module to increase the number of channels, and decompose the standard convolution into depthwise convolution and pointwise convolution through depthwise separable convolution;

[0024] The channel information is compressed through global average pooling, and feature scaling is performed through the fully connected layer;

[0025] The channel characteristics are re-weighted by the Sigmoid activation function to obtain the lithology classification model.

[0026] In some specific embodiments, high-dimensional features of the rock cuttings image in the lithology classification model are extracted, and a covariance matrix is ​​constructed based on the high-dimensional features of the rock cuttings image, specifically:

[0027] Extracting the representation of each rock cutting image data in the deep feature space through the rock cutting classification model to obtain the high-dimensional features of the rock cutting image;

[0028] Integrate the high-dimensional features of the rock cuttings image into a feature matrix, where each row in the feature matrix represents a feature vector of a sample;

[0029] Obtaining the mean vector of the feature matrix and obtaining the feature vector of each sample;

[0030] Determine the square error of each feature dimension based on the mean vector and the feature vector of each sample;

[0031] The covariance of each feature dimension is determined based on the square error of each feature dimension, and the covariance matrix is ​​constructed based on the covariance.

[0032] In some specific embodiments, the image sample to be input is input into the lithology classification model to obtain a feature vector, and the feature vector is compared with the covariance matrix based on Markov's theorem to determine whether the image to be input is out-of-distribution data, specifically:

[0033] Acquire a feature vector of an image sample to be input through the lithology classification model;

[0034] The Mahalanobis distance between the feature vector of the image sample to be input and the mean vector of each known lithology category;

[0035] Selecting a minimum Mahalanobis distance from the Mahalanobis distances to the mean vector of each known lithology category, and comparing the Mahalanobis distance with a preset threshold;

[0036] When the minimum Mahalanobis distance is greater than or equal to the preset threshold, the image sample to be input is out-of-distribution data.

[0037] In some specific embodiments, the error rate of the lithology classification model is determined based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model, specifically:

[0038] Based on the standard classification index, the lithology classification model is tested by the test set to obtain a first index, wherein the first index includes the accuracy, F1 value, precision and recall rate of the lithology classification model;

[0039] Determining a second indicator when the lithology classification model detects the out-of-distribution data, the second indicator comprising a recall rate and a specificity;

[0040] The error rate of the lithology classification model is determined based on the first indicator and the second indicator.

[0041] Correspondingly, the present invention also proposes a device for detecting the misjudgment rate of rock property identification of rock cuttings images, the device comprising:

[0042] A preprocessing module is used to preprocess the original rock cuttings image data and divide the preprocessed original rock cuttings image data into a training set, a verification set and a test set;

[0043] A training module, used for building an EfficientNetV2 model based on a public data set, and training the EfficientNetV2 model based on the training set to obtain a lithology classification model;

[0044] A covariance matrix construction module, used for extracting high-dimensional features of the rock cuttings image in the lithology classification model, and constructing a covariance matrix based on the high-dimensional features of the rock cuttings image;

[0045] An out-of-distribution data determination module is used to input the image sample to be input into the lithology classification model to obtain a feature vector, and compare the feature vector with the covariance matrix based on Markov's theorem to determine whether the image to be input is out-of-distribution data;

[0046] An evaluation module is used to determine the misjudgment rate of the lithology classification model based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model.

[0047] One of the embodiments of the present invention further provides a computing device, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method for detecting the misjudgment rate of lithology identification of rock cuttings images as described in any one of the above items.

[0048] One embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for detecting the misjudgment rate of lithology identification of rock cuttings images as described in any one of the above.

[0049] By applying the above technical scheme, a method for detecting the misjudgment rate of lithology recognition of rock cuttings images is proposed, and the method comprises: preprocessing the original rock cuttings image data, and dividing the preprocessed original rock cuttings image data into a training set, a validation set and a test set; constructing an EfficientNetV2 model based on a public data set, and training the EfficientNetV2 model based on the training set to obtain a lithology classification model; extracting high-dimensional features of the rock cuttings images in the lithology classification model, and constructing a covariance matrix based on the high-dimensional features of the rock cuttings images; inputting an image sample to be input into the lithology classification model to obtain a feature vector, and comparing the feature vector with the covariance matrix based on Markov’s theorem to determine whether the image to be input is out-of-distribution data; determining the misjudgment rate of the lithology classification model based on the recognition result of the out-of-distribution data by the lithology classification model and the test result of the lithology classification model by the test set, and reducing the misjudgment rate of the lithology classification model by detecting out-of-distribution data. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 It is a flow chart of a method for detecting the misjudgment rate of lithology identification of rock cuttings images provided in an embodiment of the present application;

[0052] Figure 2 is a sample image of the original rock cuttings image data provided by the embodiment of the present application;

[0053] Figure 3 is a schematic diagram of a data clipping process provided in an embodiment of the present application;

[0054] Figure 4 is a schematic diagram of the pretreatment process provided in the embodiment of the present application;

[0055] Figure 5 It is a structural diagram of the EfficientNetV2 model framework provided in the embodiment of the present application;

[0056] Figure 6 It is a structural diagram of the MBCovn module and the Fused-MBConv module provided in the embodiments of the present application;

[0057] Figure 7 is a structural diagram of the SE module provided in an embodiment of the present application;

[0058] Figure 8 It is a working principle diagram of the MBCovn module, the DWConv module and the SE module provided in the embodiment of the present application;

[0059] Fig. 9 Schematic diagram of the process of extracting high-dimensional features of rock cuttings images provided in an embodiment of the present application;

[0060] Fig.10 It is a schematic diagram of the effect of the misjudgment rate of the lithology classification model provided in the embodiment of the present application;

[0061] Fig.11 It is a structural schematic diagram of a device for detecting the misjudgment rate of rock property identification of rock cuttings images provided in an embodiment of the present application;

[0062] Fig.12 It is a structural block diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0064] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0065] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0066] like Figure 1 As shown, the present application proposes a method for detecting the misjudgment rate of lithology recognition of rock cuttings images, and the method comprises the following steps:

[0067] Step S101 , preprocessing the original rock cuttings image data, and dividing the preprocessed original rock cuttings image data into a training set, a validation set and a test set.

[0068] In a possible implementation, the original rock cuttings image data is preprocessed, and the preprocessed original rock cuttings image data is divided into a training set, a validation set, and a test set, specifically:

[0069] Performing data cropping on the original rock cuttings image data, wherein the data cropping methods include random cropping and grid cropping;

[0070] Performing color analysis on the original rock cuttings image data after data cropping, and determining whether the red proportion and the orange proportion in the original rock cuttings image data after data cropping are both greater than their corresponding proportion thresholds;

[0071] If not, the original rock cuttings image data after color analysis is randomly enhanced to obtain the training set, verification set and test set.

[0072] In this embodiment, the original rock chip image data is obtained, including dark gray silty mudstone, light gray fine sandstone, black coal and other types of rocks. There are 7 types of rock samples in total, only five of which are selected to train the model, and the other two are used as subsequent out-of-distribution data for model evaluation and out-of-distribution data detection. Figure 2As shown in Figure 2, two slightly different augmentation methods, random cropping and grid cropping, are used. The data cropping method is shown in Figure 2. Figure 3 As shown. Ensure that image files are stored in different folders according to label information, and each folder represents a rock cutting category. Preprocess the data and divide the data set. Since the photos in the data set have a high resolution and a small number of samples, you can choose to increase the number of samples by cropping the images. The comparison before and after data enhancement is shown in Table 1. Use image processing tools to remove noise from the image and enhance the recognition ability of the model. Resize all images to a uniform size to ensure that the image dimensions are consistent when input into the model. Convert the image to a uniform color mode. Select five basic enhancement schemes: horizontal flip, vertical flip, random saturation adjustment, random brightness adjustment, and random contrast adjustment, and randomly combine these basic schemes when training the model. The data preprocessing process is as follows Figure 4 As shown, the data set is divided into a training set (usually 70-80%), a validation set (10-15%) and a test set (10-20%) according to a certain ratio.

[0073] Table 1

[0074]

[0075] Step S102, constructing an EfficientNetV2 model based on a public data set, and training the EfficientNetV2 model based on the training set to obtain a lithology classification model.

[0076] In one possible implementation, the EfficientNetV2 model is built based on a public dataset, specifically:

[0077] Get the initial EfficientNetV2 model and its weights pre-trained on the public dataset ImageNet from the deep learning framework PyTorch;

[0078] Modifying the number of output nodes of the output layer of the pre-trained initial EfficientNetV2 model to be consistent with the number of rock cuttings categories;

[0079] The connection layer of the pre-trained initial EfficientNetV2 model is set to a fully connected layer, and the activation function of the pre-trained initial EfficientNetV2 model is set to a softmax activation function to obtain the EfficientNetV2 model.

[0080] In a possible implementation, the EfficientNetV2 model is trained based on the training set to obtain a lithology classification model, specifically:

[0081] Preprocessing the rock cuttings image data in the training set, and inputting the preprocessed training set into the EfficientNetV2 model;

[0082] Setting hyperparameters when training the EfficientNetV2 model with the preprocessed training set;

[0083] Perform dilated convolution operations through the MBConv module to increase the number of channels, and decompose the standard convolution into depthwise convolution and pointwise convolution through depthwise separable convolution;

[0084] The channel information is compressed through global average pooling, and feature scaling is performed through the fully connected layer;

[0085] The channel characteristics are re-weighted by the Sigmoid activation function to obtain the lithology classification model.

[0086] In this embodiment, first, the EfficientNetV2 model and its weights pre-trained with the public dataset ImageNet are obtained from the deep learning framework PyTorch, and the pre-trained model is loaded. The selected model version is EfficientNetV2-M. The structure of the EfficientNetV2 model is as follows: Figure 5 After loading the pre-trained weights, adjust the model according to the specific task of rock cuttings images, modify the last layer of the model, replace it with an output layer suitable for the current rock cuttings classification task, the number of output nodes should match the number of rock cuttings categories, use a fully connected layer plus a softmax activation function to ensure that each category can be correctly classified.

[0087] In this embodiment, the preprocessed rock cuttings image dataset is loaded, and each image is first normalized, the pixel values ​​are scaled to between 0 and 1, and the image size is adjusted to the fixed input size required by the model (for example, 224x224 pixels). The transforms module of PyTorch is used to automatically complete these operations. Make sure that the preprocessed images meet the input requirements of EfficientNetV2 when loading. Next, input these preprocessed data into the model, set the necessary hyperparameters such as learning rate, batch size, and training rounds, and use the Adam optimizer to speed up the training process. When starting training, pay attention to monitoring the training and verification accuracy and loss values, and adjust the hyperparameters appropriately according to the training situation. The workflow of EfficientNetV2 includes multiple core modules. The MBConv module and SE module structure are as follows Figure 6 , Figure 7As shown in the figure: The MBConv module first performs an extended convolution operation to increase the number of channels, and then decomposes the standard convolution into depth convolution and point-by-point convolution through the depth-wise separable convolution (DWConv module) to reduce the amount of calculation and parameters. Then, the SE (Squeeze-and-Excitation) module is operated to compress the channel information through global average pooling, and then perform feature scaling through the fully connected layer. Finally, the channel features are re-weighted through the Sigmoid activation function. The working principle of the core module is as follows: Figure 8 shown.

[0088] in,

[0089] swish(x)=xσ(x) (1)

[0091] EfficientNetV2 uses the swish activation function in formula 1, where x is the input quantity, which represents the result of the pixel feature after weighted summation and bias adjustment of neurons, and σ(x) is calculated by formula 2.

[0092]

[0093] σ(x) in Formula 2 is the sigmoid activation function, and its value is between 0 and 1.

[0094]

[0095] Formula 3 is the Squeeze operation in the SE (Squeeze-and-Excitation) module, which compresses the spatial dimension of each channel into a scalar through global average pooling, where S i is the scaling factor of the ith channel, X i (h,w) is the value of the i-th channel of the input feature map at position (h,w), where h and w are the height and width of the feature map, respectively.

[0096] e i =σ(W2ReLU(W1s) (4)

[0098] Formula 4 is the Excitation operation in the SE (Squeeze-and-Excitation) module, which reweights and nonlinearly transforms the scaling factor through the fully connected layer, where e i is the activation value of the i-th channel, s is the scaling factor vector of all channels, W1 and W2 are the weight matrices of the fully connected layer, σ is the sigmoid activation function, ReLU() is the activation function, and ReLU(W1s) means that if the value in the brackets is greater than 0, output this value, otherwise output 0.

[0099] Step S103: extracting high-dimensional features of the rock cuttings image in the lithology classification model, and constructing a covariance matrix based on the high-dimensional features of the rock cuttings image.

[0100] In a possible implementation, high-dimensional features of the rock cuttings image in the lithology classification model are extracted, and a covariance matrix is ​​constructed based on the high-dimensional features of the rock cuttings image, specifically:

[0101] Extracting the representation of each rock cutting image data in the deep feature space through the rock cutting classification model to obtain the high-dimensional features of the rock cutting image;

[0102] Integrate the high-dimensional features of the rock cuttings image into a feature matrix, where each row in the feature matrix represents a feature vector of a sample;

[0103] Obtaining the mean vector of the feature matrix and obtaining the feature vector of each sample;

[0104] Determine the square error of each feature dimension based on the mean vector and the feature vector of each sample;

[0105] The covariance of each feature dimension is determined based on the square error of each feature dimension, and the covariance matrix is ​​constructed based on the covariance.

[0106] In this embodiment, after the EfficientNetV2 model is trained, the representation of each rock cutting image in the deep feature space needs to be extracted from the model. The extraction process is as follows: Fig. 9 . These features usually come from an intermediate layer of the model rather than the final classification layer, because the intermediate layers can capture high-level visual information of the rock cuttings image, such as texture, shape, and edge features. First, extract features from the penultimate layer and select a convolutional layer close to the output layer because these layers can represent more abstract features. Use the forward hook in PyTorch, a deep learning framework, to extract the output of this layer. The features of these outputs are usually high-dimensional feature vectors that represent the position of the image in the deep feature space. Save these feature vectors and save the matrix file (such as NumPy format) for further analysis or use in other tasks. By extracting these high-dimensional features, a feature space representing the data distribution of known lithology categories is constructed. This feature space reflects the high-level visual patterns of the rock cuttings image, which will be crucial for the subsequent out-of-distribution detection of the Mahalanobis distance.

[0107] In this embodiment, after extracting the high-dimensional features of all rock cuttings images, these feature representations are first integrated into a feature matrix, where each row represents the feature vector of a sample. Next, the mean vector of the feature matrix is ​​calculated, which is the average of each feature dimension and represents the center of the entire category in the feature space. Next, for the feature vector of each sample, the difference between it and the mean vector is calculated, and the specific method is to subtract the mean vector from the feature vector of the sample element by element. These differences are then squared to form the square error of each feature dimension, which is used for subsequent covariance calculations. By averaging the square errors of all samples, the covariance between each feature dimension is calculated, and finally a covariance matrix is ​​constructed. The covariance matrix reflects the correlation between the feature dimensions, and the numerical calculation library NumPy can be used next to obtain the inverse matrix of the covariance matrix. Two new rock categories are added to the test sample, as shown in Table 2. For a new input sample, its feature vector is first extracted through the trained EfficientNetV2 model, and then the difference between the feature vector and the category mean vector is calculated. The feature difference vector is subjected to matrix operation with the inverse of the covariance matrix, and the Mahalanobis distance formula is used to finally calculate the Mahalanobis distance between the sample feature vector and the category mean vector.

[0108]

[0109] Table 2 In which,

[0110]

[0111] Formula 5 is the mean of the feature vectors of all samples in category c, μ c is the mean of the eigenvectors, n c is the number of samples, x i is the feature vector of the i-th sample in category c.

[0112]

[0113] Formula 6 is the calculation of the covariance matrix, ∑c is the covariance matrix, μ c is the mean of the eigenvectors, n c is the number of samples, x i is the feature vector of the i-th sample in category c, (x i -μ c ) is the difference between the feature vector and the mean vector of the i-th sample, (x i -μ c )T represents the transpose of the difference.

[0114]

[0115] Formula 7 is used to calculate the i-th test sample y i The Mahalanobis distance, (y i -μ c ) is the difference between the feature vector and the mean vector of the i-th test sample, (y i -μ c )T represents the transpose of the difference, and ∑c-1 is the inverse matrix of the covariance matrix.

[0116] Step S104: input the image sample to be input into the lithology classification model to obtain a feature vector, and compare the feature vector with the covariance matrix based on Markov's theorem to determine whether the image to be input is out-of-distribution data.

[0117] In a possible implementation, the image sample to be input is input into the lithology classification model to obtain a feature vector, and the feature vector is compared with the covariance matrix based on Markov's theorem to determine whether the image to be input is out-of-distribution data, specifically:

[0118] Acquire a feature vector of an image sample to be input through the lithology classification model;

[0119] The Mahalanobis distance between the feature vector of the image sample to be input and the mean vector of each known lithology category;

[0120] Selecting a minimum Mahalanobis distance from the Mahalanobis distances to the mean vector of each known lithology category, and comparing the Mahalanobis distance with a preset threshold;

[0121] When the minimum Mahalanobis distance is greater than or equal to the preset threshold, the image sample to be input is out-of-distribution data.

[0122] In this embodiment, after calculating the Mahalanobis distances of all training samples, the next step is to set a threshold for out-of-distribution detection. First, collect the Mahalanobis distances of all known category samples, arrange these distances in ascending order, and determine a suitable percentile as the threshold. The selection of this percentile can be based on the distance distribution of the training data, and select a higher percentile between 90% and 95%, to ensure that the Mahalanobis distances of most known category samples are lower than the threshold, thereby reducing the possibility of misjudging as out-of-distribution data. Next, when a new sample is input, first extract its feature vector and calculate its Mahalanobis distance with the mean vector of each known category. Compare the minimum Mahalanobis distance of the new sample with the previously set threshold. If the minimum Mahalanobis distance is lower than this threshold, it means that the sample is close enough to the distribution of a known category, so it can be classified into this category; otherwise, if the minimum distance is higher than the threshold, it means that the sample has a large distribution gap with all known categories, so it is marked as out-of-distribution data, that is, it may belong to an unknown category. This process can be achieved through simple conditional judgment to ensure that new samples are correctly identified when they are out of distribution, thereby improving the robustness of the system in practical applications.

[0123] Step S105 , determining the misjudgment rate of the lithology classification model based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model.

[0124] In a possible implementation, the misjudgment rate of the lithology classification model is determined based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model, specifically:

[0125] Based on the standard classification index, the lithology classification model is tested by the test set to obtain a first index, wherein the first index includes the accuracy, F1 value, precision and recall rate of the lithology classification model;

[0126] Determining a second indicator when the lithology classification model detects the out-of-distribution data, the second indicator comprising a recall rate and a specificity;

[0127] The error rate of the lithology classification model is determined based on the first indicator and the second indicator.

[0128] In this embodiment, first, the performance of the trained EfficientNetV2 model in the lithology identification task is evaluated using standard classification indicators. By running the model on the test set, common indicators such as the accuracy, F1 value, precision and recall of the model are calculated. The accuracy measures the overall classification accuracy of the model for all test samples, and the F1 value combines the precision and recall, which is particularly suitable for evaluating model performance in the case of class imbalance. Use the accuracy_score and f1_score functions to calculate these indicators, and record the results for comparison. At the same time, when evaluating the detection effect of out-of-distribution samples, the recall rate and specificity of out-of-distribution data detection are calculated, that is, the proportion of out-of-distribution samples correctly identified as unknown categories. In addition, indicators such as AUC (area under the curve) and ROC (receiver operating characteristic curve) are used to further evaluate the performance of Mahalanobis distance in out-of-distribution data detection. Finally, these misjudgment rates are combined with the previous classification indicators to comprehensively analyze the overall performance of the model in dealing with lithology identification tasks, as well as the tendency to misjudge when encountering unseen rocks. The detection results are plotted as a scatter plot, where ID represents the known category during training and OOD represents the unknown category. Fig.10 shown.

[0129]

[0130] In Formula 8, Accuracy is the prediction accuracy, which refers to the ratio of the number of samples correctly predicted by the model to the total number of samples. TP (True Positive) is the number of positive classes correctly predicted, TN (True Negative) is the number of negative classes correctly predicted, FP (False Positive) is the number of positive classes incorrectly predicted, and FN (False Negative) is the number of negative classes incorrectly predicted.

[0131]

[0132] Formula 9 is used to calculate the precision of the evaluation index. Precision refers to the proportion of samples that are actually positive among all samples predicted to be positive. TP (True Positive) is the number of samples correctly predicted to be positive, and FP (False Positive) is the number of samples incorrectly predicted to be positive.

[0133]

[0134] Formula 10 calculates the recall rate, which refers to the proportion of samples that are correctly predicted as positive among all samples that are actually positive. TP (True Positive) is the number of positive samples correctly predicted, and FN (False Negative) is the number of negative samples incorrectly predicted.

[0135]

[0136] Formula 11 calculates specificity, which refers to the proportion of samples that are correctly predicted as negative among all samples that are actually negative. TN (True Negative) is the number of correctly predicted negative samples, and FP (False Positive) is the number of incorrectly predicted positive samples.

[0137] As can be seen from the above, the lithology recognition based on deep learning combined with out-of-distribution data detection of the present invention has significant advantages over the lithology recognition that relies solely on deep learning methods. First, the deep learning model performs well in identifying rock fragments images of known categories, but it may make misjudgments when facing unseen, out-of-distribution data, and misclassify unknown rocks into known categories. After introducing out-of-distribution data detection, the model can not only accurately identify known lithologies, but also identify samples that are significantly different from known categories, avoiding misclassification of these samples. This mechanism effectively reduces the misjudgment rate of the model, especially in practical applications, when facing unknown geological conditions or newly discovered rock types, this detection mechanism provides additional robustness. Secondly, out-of-distribution data detection can capture the degree of abnormality of samples in feature space through methods such as Mahalanobis distance, thereby providing an additional detection layer, making the model more reliable when processing unseen data. Overall, this combination method not only improves the accuracy of lithology recognition, but also enhances the model's adaptability to complex geological environments, ensuring that it still maintains a high level of judgment when encountering new types of rocks.

[0138] The present application also proposes a device for detecting the misjudgment rate of rock type identification of rock cuttings images, such as Fig.11 As shown, the device comprises:

[0139] The preprocessing module 10 is used to preprocess the original rock cuttings image data and divide the preprocessed original rock cuttings image data into a training set, a verification set and a test set;

[0140] A training module 20 is used to build an EfficientNetV2 model based on a public data set, and train the EfficientNetV2 model based on the training set to obtain a lithology classification model;

[0141] A covariance matrix construction module 30 is used to extract high-dimensional features of the rock cuttings image in the lithology classification model and construct a covariance matrix based on the high-dimensional features of the rock cuttings image;

[0142] The out-of-distribution data determination module 40 is used to input the image sample to be input into the lithology classification model to obtain a feature vector, and compare the feature vector with the covariance matrix based on Markov’s theorem to determine whether the image to be input is out-of-distribution data;

[0143] Evaluation module 50, used to determine the error rate of the lithology classification model based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model

[0144] Fig.12 The block diagram of a computing device 400 according to one embodiment of the present specification is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.

[0145] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0146] In one embodiment of the present specification, the above components of the computing device 400 and Fig.12 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.12 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0147] The computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 400 may also be a mobile or stationary server.

[0148] The processor 420 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned method for detecting the error rate of rock type identification of rock cuttings images. The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned method for detecting the error rate of rock type identification of rock cuttings images belong to the same concept. For details not described in detail in the technical scheme of the computing device, please refer to the description of the technical scheme of the above-mentioned method for detecting the error rate of rock type identification of rock cuttings images.

[0149] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned method for detecting the misjudgment rate of lithology identification of rock cuttings images.

[0150] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the detection method of the error rate of rock type identification of rock cuttings images described above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the detection method of the error rate of rock type identification of rock cuttings images described above.

[0151] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned method for detecting the misjudgment rate of lithology identification of rock cuttings images.

[0152] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the detection method of the error rate of rock type identification of rock cuttings images are of the same concept, and the details not described in detail in the technical scheme of the computer program can be found in the description of the technical scheme of the detection method of the error rate of rock type identification of rock cuttings images.

[0153] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0154] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0155] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0156] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0157] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A method for detecting the misjudgment rate of rock property identification of rock cuttings images, characterized in that: The method comprises: Preprocessing the original rock cuttings image data, and dividing the preprocessed original rock cuttings image data into a training set, a validation set and a test set; Building an EfficientNetV2 model based on a public data set, and training the EfficientNetV2 model based on the training set to obtain a lithology classification model; Extracting high-dimensional features of the rock cuttings image in the lithology classification model, and constructing a covariance matrix based on the high-dimensional features of the rock cuttings image; Inputting the image sample to be input into the lithology classification model to obtain a feature vector, and comparing the feature vector with the covariance matrix based on Markov’s theorem to determine whether the image to be input is out-of-distribution data; The misjudgment rate of the lithology classification model is determined based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model.

2. The method according to claim 1, characterized in that The original rock cuttings image data is preprocessed and divided into a training set, a validation set and a test set. Specifically: Performing data cropping on the original rock cuttings image data, wherein the data cropping methods include random cropping and grid cropping; Performing color analysis on the original rock cuttings image data after data cropping, and determining whether the red proportion and the orange proportion in the original rock cuttings image data after data cropping are both greater than their corresponding proportion thresholds; If not, the original rock cuttings image data after color analysis is randomly enhanced to obtain the training set, verification set and test set.

3. The method according to claim 1, characterized in that Build the EfficientNetV2 model based on the public dataset, specifically: Get the initial EfficientNetV2 model and its weights pre-trained on the public dataset ImageNet from the deep learning framework PyTorch; Modifying the number of output nodes of the output layer of the pre-trained initial EfficientNetV2 model to be consistent with the number of rock cuttings categories; The connection layer of the pre-trained initial EfficientNetV2 model is set to a fully connected layer, and the activation function of the pre-trained initial EfficientNetV2 model is set to a softmax activation function to obtain the EfficientNetV2 model.

4. The method according to claim 3, characterized in that The EfficientNetV2 model is trained based on the training set to obtain a lithology classification model, specifically: Preprocessing the rock cuttings image data in the training set, and inputting the preprocessed training set into the EfficientNetV2 model; Setting hyperparameters when training the EfficientNetV2 model with the preprocessed training set; Perform dilated convolution operations through the MBConv module to increase the number of channels, and decompose the standard convolution into depthwise convolution and pointwise convolution through depthwise separable convolution; The channel information is compressed through global average pooling, and feature scaling is performed through the fully connected layer; The channel characteristics are re-weighted by the Sigmoid activation function to obtain the lithology classification model.

5. The method according to claim 4, characterized in that The high-dimensional features of the rock cuttings image in the lithology classification model are extracted, and a covariance matrix is ​​constructed based on the high-dimensional features of the rock cuttings image, specifically: Extracting the representation of each rock cutting image data in the deep feature space through the rock cutting classification model to obtain the high-dimensional features of the rock cutting image; Integrate the high-dimensional features of the rock cuttings image into a feature matrix, where each row in the feature matrix represents a feature vector of a sample; Obtaining the mean vector of the feature matrix and obtaining the feature vector of each sample; Determine the square error of each feature dimension based on the mean vector and the feature vector of each sample; The covariance of each feature dimension is determined based on the square error of each feature dimension, and the covariance matrix is ​​constructed based on the covariance.

6. The method according to claim 5, characterized in that The image sample to be input is input into the lithology classification model to obtain a feature vector, and the feature vector is compared with the covariance matrix based on Markov’s theorem to determine whether the image to be input is out-of-distribution data, specifically: Acquire a feature vector of an image sample to be input through the lithology classification model; The Mahalanobis distance between the feature vector of the image sample to be input and the mean vector of each known lithology category; Selecting a minimum Mahalanobis distance from the Mahalanobis distances to the mean vector of each known lithology category, and comparing the Mahalanobis distance with a preset threshold; When the minimum Mahalanobis distance is greater than or equal to the preset threshold, the image sample to be input is out-of-distribution data.

7. The method according to claim 6, characterized in that The misjudgment rate of the lithology classification model is determined based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model, specifically: Based on the standard classification index, the lithology classification model is tested by the test set to obtain a first index, wherein the first index includes the accuracy, F1 value, precision and recall rate of the lithology classification model; Determining a second indicator when the lithology classification model detects the out-of-distribution data, the second indicator comprising a recall rate and a specificity; The error rate of the lithology classification model is determined based on the first indicator and the second indicator.

8. A device for detecting the misjudgment rate of rock property identification of rock cuttings images, characterized in that: The device comprises: A preprocessing module is used to preprocess the original rock cuttings image data and divide the preprocessed original rock cuttings image data into a training set, a verification set and a test set; A training module, used for building an EfficientNetV2 model based on a public data set, and training the EfficientNetV2 model based on the training set to obtain a lithology classification model; A covariance matrix construction module, used for extracting high-dimensional features of the rock cuttings image in the lithology classification model, and constructing a covariance matrix based on the high-dimensional features of the rock cuttings image; An out-of-distribution data determination module is used to input the image sample to be input into the lithology classification model to obtain a feature vector, and compare the feature vector with the covariance matrix based on Markov's theorem to determine whether the image to be input is out-of-distribution data; An evaluation module is used to determine the misjudgment rate of the lithology classification model based on the recognition result of the lithology classification model on the out-of-distribution data and the test result of the test set on the lithology classification model.

9. A computing device, characterized in that include: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for detecting the misjudgment rate of lithology identification of rock cuttings images as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for detecting the misjudgment rate of lithology identification of rock cuttings images as claimed in any one of claims 1 to 7.

Citation Information

Cited By

  • Intelligent identification method and system for large-dip-angle inclined shaft TBM (tunnel boring machine) slag sliding state

    CN120599456A