Complex lithology identification method based on deep learning and noise transfer matrix
By combining deep learning and noise transfer matrix, and using Co-teaching to train the ResNet model, the problems of time-consuming, labor-intensive, and noise-affected traditional lithology identification are solved, achieving efficient and accurate lithology identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2024-06-06
- Publication Date
- 2026-06-19
AI Technical Summary
Traditional lithology identification methods are time-consuming, labor-intensive, costly, and easily affected by label noise caused by human labeling errors, leading to inaccurate identification.
A complex lithology identification method based on deep learning and noise transfer matrix is adopted. Two ResNet neural network models are trained by co-teaching, and the loss function is modified by combining the noise transfer matrix to filter label noise and optimize model parameters.
It significantly improves the accuracy of lithology identification, enabling accurate identification of unknown lithologies on noisy datasets, improving identification accuracy by more than 12%, and optimizing noise processing in the lithology identification process.
Smart Images

Figure CN118736274B_ABST
Abstract
Description
Technical fields:
[0001] This invention relates to a method for identifying complex lithology in the field of geological technology, specifically a method for automatic identification of complex lithology based on co-teaching and noise transfer matrix. Background technology:
[0002] Lithological description involves the properties, characteristics, and composition of rocks, including appearance, texture, composition, structure, and occurrence, and is crucial for rock classification, identification, and research. Lithological identification plays a central role in geology, not only contributing to the understanding of geological history and processes but also forming the basis for resource exploration and geological risk prediction. Furthermore, lithological identification technology has wide applications in fields such as construction engineering, water resource management, mineral exploration, and environmental protection.
[0003] Traditional lithological identification methods include microscopic analysis, which uses optical or electron microscopes to observe thin sections of rocks; X-ray diffraction analysis, which determines the types and amounts of minerals by measuring the X-ray diffraction patterns in rock samples; and chemical analysis, which determines the chemical composition of rock samples. These methods are typically time-consuming, labor-intensive, costly, and require a high level of expertise from researchers.
[0004] With the development of computer technology, especially artificial intelligence, new methods have emerged in the field of lithology identification. By training image recognition models, lithological characteristics can be learned from a large amount of core image data, achieving automatic, efficient, and high-precision lithology identification. However, the training of these models usually relies on manually labeled datasets, and the manual labeling process may introduce errors due to limitations in cost and professional experience. This mislabeling problem is called "label noise," leading to inaccurate lithology identification. Summary of the Invention:
[0005] The purpose of this invention is to provide a method for identifying complex lithology based on deep learning and noise transfer matrices. This method addresses the problems of time-consuming, labor-intensive, costly, or inaccurate lithology identification in existing technologies.
[0006] The technical solution adopted by this invention to solve its technical problem is as follows: This complex lithology identification method based on deep learning and noise transfer matrix includes the following steps:
[0007] Step 1: Obtain core image samples, perform preliminary annotation, and form a core image dataset with label noise;
[0008] Step 2: Construct a ResNet neural network model. Pre-train the ResNet neural network model using the core image dataset to identify the anchor point samples with the highest prediction probability in each lithology category. Record the prediction vectors of these anchor point samples and use the prediction vectors of the anchor point samples to calculate the noise transfer matrix and noise rate of the core image dataset.
[0009] Step 3: Construct two more ResNet neural network models. Based on the idea of co-teaching, train these two ResNet neural network models simultaneously. By sorting the loss of samples in each training batch, select samples with small loss to exchange between the two models, and then use these samples to update the model parameters.
[0010] Step 4: During the model training process in Step 3, the loss function is corrected using the noise transition matrix. The model parameters are then updated with the corrected loss to accurately adapt to the influence of label noise. After training is completed, the lithology identification model is obtained.
[0011] Step 5: Use the lithology identification model to predict the lithology of unlabeled core samples and display the prediction results through visualization.
[0012] The first step of the above scheme is as follows: take pictures of the core samples from the well to obtain core image samples, and use experimental methods and manual experience to make preliminary annotations on these core image samples to form a core image dataset with labeled noise.
[0013] Step one of the above plan is as follows:
[0014] By taking high-resolution photos of the core samples from drilling, the captured images are cropped into rectangular core image samples of uniform size.
[0015] Accurate lithological labels for some core samples were obtained by using experimental methods and manual experience-based discrimination.
[0016] For core samples that have not undergone experimental analysis, a method based on the human experience of geological experts is used to label them, and lithological labels are obtained for the remaining core samples.
[0017] Using spreadsheet software, core image samples were matched with corresponding lithology labels to create a core image dataset with label noise.
[0018] Step two of the above plan is as follows:
[0019] A ResNet neural network model was built using a machine learning library. The hyperparameters, optimizer, and loss function of the network model were precisely configured to adapt to the characteristics of the core image dataset with label noise.
[0020] During the training of the neural network using a core image dataset with labeled noise, the sample with the prediction probability closest to 1 in each category is identified as the anchor sample, and the prediction vector of the anchor sample is recorded. The prediction vector contains the model's prediction probability that each anchor sample belongs to each category.
[0021] The predicted vectors of the identified anchor samples are assembled to construct a noise transition matrix, which reflects the transition probability of the predicted labels between different categories.
[0022] The noise rate of the core image dataset is calculated by summing and averaging the off-diagonal elements of the noise transfer matrix, thus quantifying the impact of label noise.
[0023] The method for calculating the noise transfer matrix and noise rate in step two of the above scheme is as follows:
[0024] The relationship between a lithology identification model trained on a dataset with label noise and a lithology identification model trained on a noise-free dataset is expressed as follows:
[0025]
[0026] in It is a lithology identification model for a dataset with label noise, p(y=e j |x;w) is a lithology identification model on a noise-free dataset. This represents the transformation relationship between the noise model and the noise-free model, e i Indicates noise label, e j Indicates the true label, is the parameter of the lithology identification model on the dataset with label noise, w is the parameter of the lithology identification model on the noise-free dataset, and x is the input core image sample;
[0027] Define the noise transfer matrix T:
[0028] T∈I n×n
[0029]
[0030] Among them, for p(y=e) j Samples where |x;w)=1 are called anchor points. After pre-training the model on a core image dataset with label noise, the sample whose probability of being predicted as belonging to the current class is closest to 1 is found in each class and used as the anchor point for that class. The model's prediction vector for the anchor point sample is then recorded.
[0031]
[0032] Where, x j(anchor) The anchor point representing category j Represents a noisy dataset. This indicates finding the sample whose probability of being predicted as this class by the model is closest to 1;
[0033] The noise transition matrix is calculated from the predicted probabilities of the anchor points. The i-th row and j-th column of the noise transition matrix represents the probability that the anchor sample of the j-th class is of the i-th class, which is the i-th element of the j-th class prediction vector.
[0034]
[0035] After obtaining the noise transfer matrix, the noise rate is calculated by summing the off-diagonal elements of the noise transfer matrix and taking the average.
[0036]
[0037] Among them, noise rate This represents the noise rate, and n represents the total number of lithology categories.
[0038] The method for training two ResNet neural network models based on the Co-teaching concept in step three of the above scheme is as follows:
[0039] 3.1. Randomly initialize the parameters of the two ResNet neural network models so that the initial positions of the two models in the parameter space are different;
[0040] 3.2 In each training round, the training sample losses calculated by the two ResNet neural network models are first sorted, and the samples with smaller losses are selected as the focus of the current round of training to reduce the negative impact of noisy data on model training. The sample loss sorting methods include bubble sort, selection sort, or merge sort.
[0041] 3.3. Based on the Co-teaching concept, two ResNet neural network models are trained independently, and the selected samples with smaller losses are swapped at the end of each training batch. The selection of the smaller subset of samples involves a selection ratio, which is represented by the forgetting rate parameter. The forgetting rate refers to the proportion of samples to be forgotten in each training epoch, and this forgetting ratio is related to the noise rate of the training dataset.
[0042] forget rate =1-noise rate
[0043] Among them, forget rate Noise represents the rate of forgetting. rate Indicates the noise rate of the dataset;
[0044] 3.4. Use the swapped samples to update the parameters of the two ResNet neural network models, calculate the new loss values, and apply the backpropagation algorithm to optimize the model weights;
[0045] 3.5 Repeat steps 3.2-3.4, performing multiple training rounds to optimize model performance. Through continuous sample exchange, utilize the different learning perspectives of the two models to eliminate the model's focus on label noise in the data.
[0046] Step four in the above scheme is specifically as follows:
[0047] The noise transfer matrix is multiplied by the model output prediction vector for each sample to adjust the prediction vector so that it reflects the probability bias caused by label noise and is closer to the true data distribution.
[0048]
[0049] In the formula, T ij The noise transfer matrix, This represents the model's prediction vector for the sample;
[0050] By combining the adjusted predicted vector and the actual sample labels, the corrected loss value is calculated using the selected loss function:
[0051]
[0052] In the formula, e i Let l represent the label of the current sample, and l represent the loss function. re This represents the corrected loss function;
[0053] The calculated corrected loss is used to update the parameters and weights of the ResNet neural network model via backpropagation.
[0054] The visualization processing in the above scheme includes generating an image display next to the prediction label, using color coding to distinguish different lithological categories, or marking the predicted lithological distribution on a geological map.
[0055] Beneficial effects:
[0056] 1. This invention combines co-teaching technology with a noise transfer matrix, which can efficiently and accurately identify unknown lithologies in noisy datasets. It significantly optimizes noise processing in the lithology identification process and can be applied to train a lithology identification model on a core image dataset with label noise and identify the lithology of unknown samples. This is of great significance for solving complex lithology identification and improving the accuracy of lithology identification.
[0057] 2. This invention, Co-teaching, effectively filters out noisy data by exchanging samples with lower loss between two neural network models. Furthermore, by constructing a noise transition matrix and applying it in loss calculation, label noise can be accurately modeled and processed. Combining these two strategies, a model capable of accurately identifying lithology can be trained on core image datasets containing label noise, and applied to the identification of unlabeled samples.
[0058] 3. This invention can use core image datasets with labeled noise to train an accurate lithology identification model and achieve efficient identification of unlabeled sample lithology. The lithology identification accuracy of this method is 0.688; the lithology identification accuracy using co-teaching is 0.612; and the lithology identification accuracy using a noise transfer matrix is 0.622. This method improves upon co-teaching by 12% and noise transfer matrix by 11%, and can efficiently and accurately identify unknown lithologies in noisy datasets.
[0059] 4. This invention uses a trained lithology identification model to predict the lithology of unknown samples. The prediction results are visualized so that users can intuitively evaluate the model's identification performance and accuracy.
[0060] 5. This invention uses a ResNet neural network to pre-train a core image dataset, identifying the sample with the highest predicted probability in each lithology category as the anchor point. A noise transition matrix and noise rate are calculated to provide a basis for noise adjustment during subsequent training. During the model's pre-training phase, the noise transition matrix is calculated based on the prediction results of the anchor point samples. This matrix maps the conversion probability from the true category to the model's predicted category, reflecting the misclassification probability between different categories.
[0061] 6. In the model training process, this invention uses a noise transition matrix to correct the loss function, ensuring that the influence of noise is effectively controlled during training. The corrected loss is then used to update the model parameters, optimizing the model's performance and accuracy.
[0062] 7. This invention uses specialized equipment to take high-resolution photographs of core samples obtained from drilling to ensure that sufficient details are captured for effective lithology identification; the photographed images are cropped into rectangular core image samples of uniform size, and this standardization process ensures the consistency and accuracy of subsequent analysis.
[0063] 8. This invention employs a strategy based on the co-teaching concept to simultaneously train two ResNet neural network models, thereby improving the processing capability of core image datasets with labeled noise.
[0064] 9. In each training round, this invention first evaluates the training sample losses calculated by each of the two models. An effective sorting method (such as bubble sort, selection sort, or merge sort) is used to sort the loss values. Samples with smaller loss values are selected from the sorted results; these samples are considered most likely to be correctly classified and therefore have relatively less noise impact. The two models not only train independently but also exchange these samples with smaller losses at the end of each training batch. This exchange allows each model to learn effective data processing strategies from the other, achieving the goal of mutual teaching. The exchanged samples are used in the next training batch, helping the two models to mutually correct each other during training and improve their resistance to noise. The parameters of both models are updated using the exchanged samples. This step is crucial in the entire co-teaching training process, ensuring that the two models can effectively utilize the information learned from each other to optimize their respective training results.
[0065] 10. In this invention, the adjusted predicted vector and the actual sample labels are combined to calculate the loss. This is typically done using cross-entropy loss or other appropriate loss functions to assess the difference between the model's predictions and the true labels. Based on the calculated loss, the model's parameters are updated using the backpropagation algorithm. In this step, the loss gradient is calculated based on the corrected predicted values, thus ensuring that the impact of label noise is considered during the update process. In this way, the model learns to correct errors caused by label noise, improving the accuracy of predictions for the true data labels. Attached image description:
[0066] Figure 1 This is a technical circuit diagram of the present invention;
[0067] Figure 2 This is a sample image of the rock core obtained by photographing the core sample taken from the well drilling in this invention;
[0068] Figure 3 This is a dataset of rock core images with label noise in this invention;
[0069] Figure 4 This refers to the noise transfer matrix and noise rate map obtained by pre-training a ResNet neural network in this invention.
[0070] Figure 5 This is a schematic diagram of model training based on the Co-teaching concept in this invention;
[0071] Figure 6 This is a schematic diagram of the loss function correction based on the noise transition matrix in this invention;
[0072] Figure 7 This is a graph illustrating the changes in accuracy and loss during the training process in this invention.
[0073] Figure 8 This is a visualization of the confusion matrix between the evaluation results and prediction results of the trained model in this invention on an unlabeled sample set.
[0074] Figure 9 This is a comparison chart of the accuracy of the present invention and different methods. Detailed implementation method:
[0075] The present invention will be further described below with reference to the accompanying drawings:
[0076] Combination Figures 1-8 As shown, this complex lithology identification method based on deep learning and noise transfer matrices includes the following steps:
[0077] S1. Acquisition and preprocessing of core image dataset: Core samples are photographed to obtain core image samples. The core image samples are roughly labeled using experimental methods and the subjective judgment of geological experts, forming a core image dataset with label noise.
[0078] Core samples are rock samples obtained directly from underground reservoirs during drilling. These samples are used for subsequent lithological analysis and image acquisition. High-resolution imaging equipment, such as digital cameras, smartphones, or other professional image acquisition devices, is used to photograph the retrieved core samples in detail. The captured images are then cropped into rectangular core image samples of uniform size to facilitate subsequent image processing and analysis. Core image samples are obtained by photographing the core samples, and coarse annotation of the core image samples is performed using experimental methods and manual experience-based discrimination methods, resulting in a core image dataset with label noise.
[0079] Lithological labels include, but are not limited to, shale, sandstone, siltstone, clay, and mudstone, covering most common sedimentary rock types. These labels provide the necessary classification basis for model training.
[0080] like Figure 2 As shown, core samples obtained from the reservoir were photographed, and then cropped using an image processing library to obtain core image samples of uniform size. Image processing libraries include, but are not limited to, OpenCV.
[0081] Image cropping involves the following steps: ① Import the OpenCV library: Import the OpenCV library into Python; ② Determine the cropping region: Determine the location and size of the region to be cropped in each image, defining a list containing the cropping parameters for each image; ③ Batch crop images: Iterate through each image, use OpenCV functions to perform the cropping operation, and save the cropped images to a specified directory.
[0082] Precise lithological labels were obtained for some core samples using experimental methods, while rough lithological labels were obtained for the remaining core samples using manual judgment. Experimental methods included, but were not limited to, microscopic analysis, X-ray diffraction analysis, or chemical analysis. Manual judgment refers to manually determining the lithology of the remaining core samples based on the lithology of some samples determined by experimental methods.
[0083] Core image samples are systematically organized into different folders according to their labels, thus forming a structured core image dataset that includes label noise. For example... Figure 3 As shown, image samples for each lithology label are stored in a separate folder. These folders are named according to the corresponding lithology label number, ensuring that the name of each folder intuitively reflects the lithology category stored within it. For example, all image samples labeled "shale" are placed in a folder named "001," while "sandstone" samples are stored in a folder named "002," and so on. This naming convention simplifies file access and data retrieval during subsequent processing and analysis.
[0084] Experimental methods and manual empirical discrimination were used to roughly label core image samples to form a core image dataset with label noise. This process includes the following steps:
[0085] Detailed scientific analysis, such as microscopic observation and X-ray diffraction analysis, is performed on some core samples to obtain accurate lithological labels. These methods typically provide highly reliable data for establishing standardized lithological identification benchmarks. The remaining core samples are labeled with lithological characteristics based on the experience of geological experts. This method relies on the expert's ability to identify rock features and may introduce human error, resulting in labeling noise.
[0086] Spreadsheet software was used to match core image samples with corresponding lithology labels. This process involved mapping image files to label data to create a complete core image dataset.
[0087] In this invention, label noise refers to the situation in which some samples in the dataset are incorrectly labeled as other lithological categories due to human annotation errors. This noise originates from differences in the subjective judgment of the annotators or identification errors.
[0088] S2, Model Pre-training and Noise Evaluation: Noise transfer matrix and noise rate obtained by pre-training a ResNet neural network on a core image dataset with labeled noise.
[0089] First, a ResNet neural network model is built using the PyTorch machine learning library. Then, the ResNet model is trained using the core image dataset with labeled noise constructed in step S1, with appropriate model parameters and hyperparameters selected during training. During training, samples with prediction probabilities closest to 1 are identified for each category and designated as anchor points. The prediction vectors of these anchor point samples are recorded. Each prediction vector contains the model's predicted probability for each anchor point sample belonging to each category. The noise transition matrix is calculated using these anchor point prediction vectors. The overall noise rate is calculated by analyzing the off-diagonal elements of the noise transition matrix.
[0090] Specifically, such as Figure 4 The figure shows the noise transition matrix and noise rate calculated by the model. The relationship between the lithology identification model trained on a dataset with labeled noise and the lithology identification model trained on a noise-free dataset can be expressed as follows:
[0091]
[0092] in It is a lithology identification model for a dataset with label noise, p(y=e j |x;w) is a lithology identification model on a noise-free dataset. This represents the transformation relationship between the noise model and the noise-free model, e i Indicates noise label, e j Indicates the true label, w represents the parameters of the two models, and x represents the input core image sample.
[0093] The noise transition matrix T can be defined as follows:
[0094] T∈I n×n
[0095]
[0096] Among them, for p(y=e) j Samples where |x;w)=1 are called "anchor points". After pre-training the model on a noisy dataset, the sample in each class whose predicted probability of the class is closest to 1 is found as the anchor point for that class, and the model's prediction vector for the anchor point sample is recorded at this time:
[0097]
[0098] Where, x j(anchor) The anchor point representing category j Represents a noisy dataset. This indicates finding the sample whose probability of being classified as this class is closest to 1, as predicted by the model.
[0099] Then, the noise transition matrix can be calculated from the predicted probabilities of the anchor points. The i-th row and j-th column of the noise transition matrix represents the probability that the anchor sample of the j-th class is of the i-th class, which is the i-th element of the j-th class prediction vector:
[0100]
[0101] After obtaining the noise transfer matrix, the noise rate can be calculated by summing and averaging the off-diagonal elements of the noise transfer matrix.
[0102]
[0103] Among them, noise rate This represents the noise rate, and n represents the total number of lithology categories.
[0104] Hyperparameter settings: Learning Rate controls the rate at which model weights are updated, affecting the speed of model training and convergence quality; Batch Size is the number of samples input to the model during each training iteration, affecting the accuracy of gradient estimation and memory usage; Epochs are the number of times the entire dataset is traversed, directly related to the adequacy of model training.
[0105] Optimizer selection: SGD (Stochastic Gradient Descent): A standard optimization method that updates the model weights using randomly selected samples in each iteration, often used for large-scale and sparse datasets; Adam (Adaptive Moment Estimation): A more modern optimization algorithm that combines momentum and adaptive learning rate techniques, typically achieving convergence faster.
[0106] Loss function applications: Mean Squared Error (MSE), mainly used for regression problems, calculates the sum of squares of the differences between predicted and actual values; Cross-Entropy Loss (CLOSE), used for classification problems, evaluates the difference between the probability distribution of the model output and the probability distribution of the true labels.
[0107] The functions of prediction probability and prediction vector: Prediction probability represents the model's confidence level that the input sample belongs to each possible category, and is in the form of a probability distribution; prediction vector is specifically represented as the probability value of each category obtained from the model's output layer, used for subsequent classification judgment and loss calculation.
[0108] Anchor sample definition: Anchor samples are those samples that the model considers to belong to a specific class with the highest probability (i.e., the predicted probability is closest to 1) during classification prediction. These samples typically represent the model's best performance in class identification under the current training state.
[0109] This invention employs the following steps to establish a pre-trained core identification model based on a ResNet neural network, specifically including network construction, training, and noise processing:
[0110] Use popular machine learning libraries (such as TensorFlow or PyTorch) to build a ResNet neural network model as a pre-trained model;
[0111] Configure the neural network's hyperparameters, such as learning rate, batch size, and training epochs, to adapt to the characteristics of the core image dataset;
[0112] Choosing the right optimizer (such as SGD or Adam) and loss function (such as cross-entropy loss) has a significant impact on the network training performance and convergence speed.
[0113] The ResNet network was trained using a dataset of rock core images with labeled noise. During training, the system monitored the prediction results for each class and identified samples whose predicted probability for that class was closest to 1. These samples were defined as anchor samples.
[0114] Record the predicted vectors of these anchor samples, which reflect the model's most confident judgments about each class in the current training state;
[0115] A noise transition matrix is constructed using the prediction vectors of the anchor samples. This matrix describes the probability transformation from the true class to the predicted class and reflects the model's tendency to confuse different classes.
[0116] The off-diagonal elements of the noise transition matrix are calculated, and these elements are summed and averaged to obtain the overall noise rate. This noise rate measures the degree of label noise in the dataset and is crucial for subsequent model tuning and optimization.
[0117] S3 is a dual-model synchronous training strategy based on the idea of Co-teaching. It uses the Co-teaching strategy to train two ResNet models at the same time, and filters the influence of label noise through loss ranking and sample swapping.
[0118] Co-teaching training process: Two ResNet neural network models are trained simultaneously. Samples with lower losses are selected by ranking the losses of samples in each training batch. These lower-loss samples are then swapped between the two models, and their parameters are updated using these samples.
[0119] Based on the idea of co-teaching, two ResNet models are trained simultaneously. In each training round, the loss of samples in the batch is sorted, and samples with smaller losses are selected and swapped between the two models. These samples are then used to update the model parameters.
[0120] Specifically, such as Figure 5 As shown, two ResNet models are created using the PyTorch machine learning library. Both models undergo random parameter initialization before training to ensure diversity in starting points. In each training epoch, the training sample losses calculated by each model are first sorted. This step identifies the samples that each model performs best in the current training state, i.e., the samples with the smallest loss. Samples with relatively small losses are selected, considered the most likely to be correct. Based on the co-teaching idea, these samples with small losses are swapped between the two models. In this way, each model can benefit from the best practices learned by the other model, especially in handling potential label noise. The swapped samples are used for further training, updating the parameters of both models. This includes calculating new loss values and applying backpropagation to optimize model weights. This process is repeated across multiple training epochs, continuously optimizing model performance and eliminating the model's focus on label noise in the data through continuous sample swapping.
[0121] This invention selects a smaller subset of samples, which involves a selection ratio. This ratio is represented by the forgetting rate parameter. The forgetting rate refers to the proportion of samples to be forgotten in each training epoch; this forgetting rate is related to the noise level of the training dataset.
[0122] forget rate =1-noise rate
[0123] Among them, forget rate Noise represents the rate of forgetting. rate The noise rate of the dataset is represented and calculated in S2.
[0124] S4. The loss function is corrected based on the noise transition matrix. The noise transition matrix is used to correct the model's loss function during training to improve its ability to handle label noise.
[0125] The loss function is adjusted using a noise transition matrix. The noise transition matrix, calculated in S2, is obtained during the pre-training phase by analyzing anchor samples. During training, the calculated noise transition matrix is multiplied by the model's output prediction vector for each training sample. This step adjusts the prediction vector to reflect the probability bias caused by label noise, more accurately reflecting the probability of the actual class, taking into account the label noise present in the data. The adjusted prediction vector is then used to calculate the loss function. In this way, the loss function can more accurately assess the difference between the model's prediction and the actual label because it takes into account the impact of label noise. The model parameters are then updated using the adjusted loss. This typically involves performing backpropagation, calculating the gradient based on the adjusted loss, and updating the model's weights accordingly. This process helps the model gradually adapt to and correct errors caused by label noise during training.
[0126] Specifically, such as Figure 6 As shown, the model output is corrected using a noise transfer matrix, which is obtained by multiplying the noise transfer matrix by the model's prediction vector for each sample.
[0127]
[0128] Among them, T ij The noise transfer matrix, This represents the model's predicted vector for the sample. Then, the model loss is calculated using a pre-defined loss function, combined with the model's labels.
[0129]
[0130] Among them, e i Let l represent the label of the current sample, and l represent the loss function. re This represents the corrected loss function.
[0131] S5 uses the trained model to predict the lithology of unlabeled samples and evaluates the prediction results.
[0132] The unlabeled sample dataset is input into a lithology identification model trained on a core image dataset with label noise. The lithology identification model outputs lithology prediction results, and then the prediction results are evaluated.
[0133] like Figure 8 As shown, the trained lithology identification model is tested using an unlabeled sample dataset. The model is evaluated based on multiple evaluation metrics, and the confusion matrix of the model is calculated to accurately evaluate the model's performance.
[0134] The evaluation metrics include accuracy, precision, recall, and F1 score.
[0135]
[0136] In this model, TP represents true positive, TN represents true negative, FP represents false positive, and FN represents false negative. After calculating the evaluation indicators, the confusion matrix is then calculated.
[0137] The present invention provides a method for predicting the lithology of unlabeled samples and visualizing the results using a trained lithology identification model, as follows:
[0138] Unlabeled core image samples are input into the trained lithology identification model. These samples were obtained from drilling cores or other rock sampling processes and have not undergone prior labeling.
[0139] The lithology identification model processes input image samples and outputs a lithology prediction for each sample. This prediction is based on the knowledge the model gains from learning from labeled samples in the training set, enabling it to identify and classify various different rock types.
[0140] Visualizing the model's predictions allows users to intuitively evaluate and understand the model's performance. Visualization methods might include generating image displays next to prediction labels, using color coding to distinguish different lithology categories, or marking the predicted lithology distribution on geological maps.
[0141] pass Figure 9 As can be seen, the lithology identification accuracy of this method is 0.688; the lithology identification accuracy using Co-teaching is 0.612; the lithology identification accuracy using the noise transfer matrix is 0.622; and the lithology identification accuracy of the ordinary method is 0.531. This method improves upon Co-teaching by 12% and upon the noise transfer matrix by 11%. This invention combines Co-teaching technology with the noise transfer matrix, which can efficiently and accurately identify unknown lithologies in noisy datasets. It significantly optimizes the noise processing in the lithology identification process. It can be applied to training a lithology identification model on core image datasets with label noise and identifying the lithology of unknown samples. This is of great significance for solving complex lithology identification and improving the accuracy of lithology identification.
Claims
1. A complex lithology identification method based on deep learning and noise transfer matrix, characterized by Includes the following steps: Step 1: Obtain core image samples, perform preliminary annotation, and form a core image dataset with label noise; Step 2: Construct a ResNet neural network model. Pre-train the ResNet neural network model using the core image dataset to identify the anchor point samples with the highest prediction probability in each lithology category. Record the prediction vectors of these anchor point samples and use the prediction vectors of the anchor point samples to calculate the noise transfer matrix and noise rate of the core image dataset. Step 3: Construct two more ResNet neural network models. Based on the idea of co-teaching, train these two ResNet neural network models simultaneously. By sorting the loss of samples in each training batch, select samples with small loss to exchange between the two models, and then use these samples to update the model parameters. Step 4: During the model training process in Step 3, the loss function is corrected using the noise transition matrix. The model parameters are then updated with the corrected loss to accurately adapt to the influence of label noise. After training is completed, the lithology identification model is obtained. Step 5: Use the lithology identification model to predict the lithology of unlabeled core samples and display the prediction results through visualization.
2. The complex lithology identification method based on deep learning and noise transfer matrix according to claim 1, characterized in that: Step one specifically involves: taking pictures of the core samples from the well to obtain core image samples, and using experimental methods and manual experience-based discrimination methods to preliminarily label these core image samples, forming a core image dataset with labeled noise.
3. The method of claim 2, wherein the method is based on deep learning and noise shift matrix for complex lithology identification. Step one specifically involves: By taking high-resolution photos of the core samples from drilling, the captured images are cropped into rectangular core image samples of uniform size. Accurate lithological labels for some core samples were obtained by using experimental methods and manual experience-based discrimination. For core samples that have not undergone experimental analysis, a method based on the human experience of geological experts is used to label them, and lithological labels are obtained for the remaining core samples. Using spreadsheet software, core image samples were matched with corresponding lithology labels to create a core image dataset with label noise.
4. The method of claim 3, wherein the method is a deep learning and noise transfer matrix based complex lithology identification method. Step two specifically involves: A ResNet neural network model was built using a machine learning library. The hyperparameters, optimizer, and loss function of the network model were precisely configured to adapt to the characteristics of the core image dataset with label noise. During the training of the neural network using a core image dataset with labeled noise, the sample with the prediction probability closest to 1 in each category is identified as the anchor sample, and the prediction vector of the anchor sample is recorded. The prediction vector contains the model's prediction probability that each anchor sample belongs to each category. The predicted vectors of the identified anchor samples are assembled to construct a noise transition matrix, which reflects the transition probability of the predicted labels between different categories. The noise rate of the core image dataset is calculated by summing and averaging the off-diagonal elements of the noise transfer matrix, thus quantifying the impact of label noise.
5. The method of claim 4, wherein the method is a deep learning and noise transfer matrix based complex lithology identification method. The method for calculating the noise transfer matrix and noise rate in step two is as follows: The relationship between a lithology identification model trained on a dataset with label noise and a lithology identification model trained on a noise-free dataset is expressed as follows: in It is a lithology identification model for a dataset with label noise, p(y=e j |x;w) is a lithology identification model on a noise-free dataset. This represents the transformation relationship between the noise model and the noise-free model, e i Indicates noise label, e j Indicates the true label, is the parameter of the lithology identification model on the dataset with label noise, w is the parameter of the lithology identification model on the noise-free dataset, and x is the input core image sample; Define the noise transfer matrix T: T∈ n×n Among them, for p(y=e) j Samples where |x;w)=1 are called anchor points. After pre-training the model on a core image dataset with label noise, the sample whose probability of being predicted as belonging to the current class is closest to 1 is found in each class and used as the anchor point for that class. The model's prediction vector for the anchor point sample is then recorded. Where, x j(anchor) The anchor point representing category j, Represents a noisy dataset. This indicates finding the sample whose probability of being predicted as this class by the model is closest to 1; The noise transition matrix is calculated from the predicted probabilities of the anchor points. The i-th row and j-th column of the noise transition matrix represents the probability that the anchor sample of the j-th class is of the i-th class, which is the i-th element of the j-th class prediction vector. After obtaining the noise transfer matrix, the noise rate is calculated by summing the off-diagonal elements of the noise transfer matrix and taking the average. Among them, noise rate This represents the noise rate, and n represents the total number of lithology categories.
6. The method of claim 5, wherein the method is a deep learning and noise transfer matrix based complex lithology identification method. The method for training two ResNet neural network models based on the Co-teaching concept in step three is as follows: 3.
1. Initialize the parameters of the two ResNet neural network models randomly so that the initial positions of the two models in the parameter space are different; 3.2 In each training round, the training sample losses calculated by the two ResNet neural network models are first sorted, and the samples with smaller losses are selected as the focus of the current round of training to reduce the negative impact of noisy data on model training. The sample loss sorting methods include bubble sort, selection sort, or merge sort. 3.
3. Based on the Co-teaching concept, two ResNet neural network models are trained independently, and the selected samples with smaller losses are swapped at the end of each training batch. The selection of the smaller subset of samples involves a selection ratio, which is represented by the forgetting rate parameter. The forgetting rate refers to the proportion of samples to be forgotten in each training epoch, and this forgetting ratio is related to the noise rate of the training dataset. forget rate =1-noise rate Among them, forget rate Noise represents the rate of forgetting. rate Indicates the noise rate of the dataset; 3.
4. Use the swapped samples to update the parameters of the two ResNet neural network models, calculate the new loss values, and apply the backpropagation algorithm to optimize the model weights; 3.5 Repeat steps 3.2-3.4, performing multiple training rounds to optimize model performance. Through continuous sample exchange, utilize the different learning perspectives of the two models to eliminate the model's focus on label noise in the data.
7. The method of claim 6, wherein the method is a deep learning and noise transfer matrix based complex lithology identification method. Step four specifically involves: The noise transfer matrix is multiplied by the model output prediction vector for each sample to adjust the prediction vector so that it reflects the probability bias caused by label noise and is closer to the true data distribution. In the formula, T ij is a noise transfer matrix, represents a prediction vector of the model to the sample; By combining the adjusted predicted vector and the actual sample labels, the corrected loss value is calculated using the selected loss function: In the formula, e i Let l represent the label of the current sample, and l represent the loss function. re This represents the corrected loss function; The calculated corrected loss is used to update the parameters and weights of the ResNet neural network model via backpropagation.
8. The complex lithology identification method based on deep learning and noise transfer matrix according to claim 7, characterized in that: The visualization process includes generating an image display next to the prediction label, using color coding to distinguish different lithology categories, or marking the predicted lithology distribution on a geological map.