A machine learning based shale abnormal pore identification method

By combining the DeepLabv3+ model and the Otsu threshold segmentation method with k-means clustering, abnormal pores and fractures in shale are identified, solving the problem of low accuracy in pore and fracture identification in existing technologies and achieving accurate calculation of porosity and permeability.

CN115457348BActive Publication Date: 2026-01-02SOUTHWEST PETROLEUM UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211144008.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-20
Publication Date
2026-01-02
Estimated Expiration
2042-09-20

AI Technical Summary

Technical Problem

In existing technologies, the methods for identifying abnormal pores and fissures in shale images have low accuracy, especially during image preparation due to human error or instrument malfunction, which leads to large errors in the calculation results of porosity and permeability.

Method used

The DeepLabv3+ model is used to train and recognize rock images. By combining the Otsu thresholding method and k-means clustering, abnormal pore contours are found through the pixel classification result array and the pore contour set, reducing manual intervention and making it suitable for pore segmentation of rock images in different scenarios.

Benefits of technology

It improves the accuracy of pore contour classification, reduces data processing workload, accurately identifies abnormal pores caused by instrument damage during image sample preparation, and improves the accuracy of porosity and permeability calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115457348B_ABST
    Figure CN115457348B_ABST
Patent Text Reader

Abstract

The application discloses a shale abnormal pore and fracture identification method based on machine learning, and comprises the following steps: S1, pre-processing rock pictures and label pictures to obtain a training set and a test set; S2, training a DeepLabv3+ model by using the training set and the test set to obtain a trained DeepLabv3+ model; S3, identifying a picture to be identified by using the trained DeepLabv3+ model to obtain a pixel point classification result array; S4, segmenting the picture to be identified to obtain a pore and fracture contour set on the picture; and S5, finding an abnormal pore and fracture contour according to the pore and fracture contour set and the pixel point classification result array. The application solves the problem that the existing image pore automatic segmentation accuracy is not high.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a shale abnormal pore recognition method based on machine learning. BACKGROUND

[0002] With the increasing maturity of artificial intelligence technology, in recent years, intelligent recognition methods represented by deep learning have been widely applied in the geological and rock industry. The automatic recognition of pore types in shale images plays an important role in studying the variation law of shale pores and fluid seepage. According to the contour features extracted from the image, the existing pore types are divided into organic matter pores, organic matter cracks, inorganic matter pores and inorganic matter cracks. However, in actual application, due to human operation errors or instrument failures, abnormal pores may be generated during the image sampling process. If the abnormal pores are not identified and processed separately, it will cause a large error in the calculation results of porosity and permeability.

[0003] At present, there are mainly two methods for detecting abnormal pores in images. One is to use the threshold segmentation method to divide different thresholds for images of different brightness to extract pores, and to classify them by color, shape and texture information. The limitation of this method is that it needs to set the classification standard manually, and it is only suitable for specific samples. The other is to use the semantic segmentation method, which trains the sample and label data in a specified network framework, selects the best model for automatic recognition of pores, and has good generalization ability. However, the label data lacks abnormal pore labels, and manual marking requires certain professional knowledge and is very time-consuming. At the same time, semantic segmentation classifies pixels, which may lead to multiple classification results for the same contour, resulting in low accuracy of this recognition algorithm. SUMMARY

[0004] In view of the above shortcomings in the prior art, the shale abnormal pore recognition method based on machine learning provided by the present application solves the problem of low accuracy of existing image pore automatic segmentation.

[0005] In order to achieve the above-mentioned purpose, the technical scheme adopted by the present application is as follows: a shale abnormal pore recognition method based on machine learning, comprising the following steps:

[0006] S1, pre-processing the rock picture and the label picture to obtain a training set and a test set;

[0007] S2, training a DeepLabv3+ model using the training set and the test set to obtain a trained DeepLabv3+ model;

[0008] S3, identifying the to-be-identified picture using the trained DeepLabv3+ model to obtain a pixel point classification result array;

[0009] S4, segmenting the picture to be identified to obtain a set of all hole contour on the picture;

[0010] S5, finding an abnormal hole contour according to the set of hole contours and the pixel point classification result array.

[0011] Further, the step S1 comprises the following sub-steps:

[0012] S11, cutting the rock picture and the label picture to obtain the rock picture and the label picture with a size of 512*512;

[0013] S12, marking the label picture with a size of 512*512 to obtain a marked picture;

[0014] S13, dividing the rock picture and the marked picture with a size of 512*512 into a training set and a test set.

[0015] Further, the step S12 is specifically:

[0016] Marking the red pixel point pixel value distributed in R(120-255), G(0-100), and B(0-100) in the label picture with a size of 512*512 as 1;

[0017] Marking the yellow pixel point pixel value distributed in R(200-255), G(200-255), and B(0-150) in the label picture with a size of 512*512 as 2;

[0018] Marking the blue pixel point pixel value distributed in R(0-100), G(200-255), and B(200-255) in the label picture with a size of 512*512 as 3;

[0019] Marking the green pixel point pixel value distributed in R(0-100), G(120-255), and B(0-100) in the label picture with a size of 512*512 as 4;

[0020] Marking other pixel point pixel values in the label picture with a size of 512*512 as 0.

[0021] Further, the loss function for training the DeepLabv3+ model in the step S2 is:

[0022]

[0023] Wherein, L is the loss function, y t is the DeepLabv3+ model prediction result array of the corresponding picture, y hatFor the label picture sample array corresponding to the picture, c is a category label value, β is an adjustment factor, "==" is a calculation result equal to the value of c in the array, sum() is a statistic of the number of pixel points of category c in the array.

[0024] The beneficial effects of the above further scheme are:

[0025] For the sample with inaccurate classification, the loss does not change, but for the sample with accurate classification, the loss decreases, which increases the weight of the sample with inaccurate classification in the loss function as a whole, thereby solving the problem of inaccurate classification of small sample categories caused by sample imbalance.

[0026] Further, the weight formula for training the DeepLabv3+ model in the step S2 is:

[0027]

[0028] wherein θ i+1 is the weight of the i+1 training, θ i is the weight of the i training, lr is the learning rate, is the real label value of the i training, h i is the actual output value of the DeepLabv3+ model of the i training, x i is the sample data input to the DeepLabv3+ model of the i training.

[0029] Further, the following formula is used as the objective function for evaluating the training completion of the DeepLabv3+ model in the step S2:

[0030]

[0031] wherein k is the number of categories, TP t is the number of true positives of the tth category correctly identified, FP t is the number of false positives of the tth category incorrectly identified, FN t is the total number of false negatives of the tth category.

[0032] Further, the step S4 includes the following sub-steps:

[0033] S41, using the Otsu threshold segmentation method to segment the picture to be identified to obtain a first organic and inorganic matter segmentation threshold;

[0034] S42, assigning 0 to the pixel value of the pixel point in the picture to be identified greater than the first organic and inorganic matter segmentation threshold to obtain an assigned picture;

[0035] S43, using the Otsu threshold segmentation method to segment the assigned picture to obtain a second organic and inorganic matter segmentation threshold;

[0036] S44, binarize the to-be-recognized picture by using the second organic matter and inorganic matter segmentation threshold, to obtain a pore contour set.

[0037] The above further scheme has the following beneficial effects:

[0038] The segmentation method can realize automatic segmentation of pores, does not need manual intervention to set a threshold for segmentation, reduces the workload of manual work, is suitable for pore segmentation of rock pictures in different scenes, and has strong portability.

[0039] Further, the step S5 comprises the following sub-steps:

[0040] S51, according to the pixel point classification result array, traversing all pixel points in the pore contour set, counting the number of pixel points corresponding to each classification result in the same pore contour, and taking the classification result with the largest number of pixel points as the category of the same pore contour;

[0041] S52, calculating the length, width, area, perimeter and pixel distribution variance of each category of pore contour;

[0042] S53, constructing the length, width, area, perimeter, pixel distribution variance and category into a feature data set;

[0043] S54, screening the main features from the feature data set;

[0044] S55, using k-means clustering method to cluster the main features to obtain an abnormal pore contour.

[0045] Further, the step S52 comprises the following sub-steps:

[0046] S521, establishing an external rectangular frame for each category of pore contour, and taking the length and width of the external rectangular frame as the length and width of the pore contour of the category;

[0047] S522, taking the number of pixel points in the external rectangular frame as the area of the pore contour of the category;

[0048] S523, counting the number of edge pixel points of the pore contour as the perimeter of the pore contour of the category;

[0049] S524, calculating the pixel distribution variance of the pore contour according to the average pixel value in the pore contour;

[0050] The formula for calculating the pixel distribution variance of the pore contour in step S524 is:

[0051]

[0052] Where S is the pixel distribution variance of the aperture contour, X1 is the first pixel value on the aperture contour, X2 is the second pixel value on the aperture contour, X3 is the third pixel value on the aperture contour, and X... N Let M be the Nth pixel value on the hole contour, M be the average pixel value, and N be the number of pixel values ​​within the hole contour.

[0053] Furthermore, step S54 includes the following sub-steps:

[0054] S541. The zero-mean method is used to process the feature dataset to obtain standard normal distribution data;

[0055] S542. Calculate the covariance matrix based on the standard normal distribution data;

[0056] The formula for calculating the elements of the covariance matrix in step S542 is as follows:

[0057]

[0058] in, The first element in the covariance matrix Line 1 The column elements, where num represents the number of slit outlines, The standard normal distribution data of the b-th pore profile Dimensional data, For the standard normal distribution data, the first Dimensional data, The standard normal distribution data of the b-th pore profile Dimensional data, For the standard normal distribution data, the first Dimensional data, where 'a' is the dimension of the data, and avg() is used to calculate the mean;

[0059] S543. Based on the covariance matrix, obtain the eigenvalues ​​and eigenvectors;

[0060] S544. Obtain the principal components based on the eigenvalues ​​and eigenvectors;

[0061] S545, Treat principal components as primary features.

[0062] In summary, the beneficial effects of this invention are as follows:

[0063] 1、The present application first adopts a DeepLabv3+ model to identify the to-be-identified picture, obtains a pixel point classification result array, then segments the to-be-identified picture, obtains all aperture contour sets on the picture, and then finds the classification result with the most pixel points in the same aperture contour by counting the number of pixel points corresponding to each classification result in the same aperture contour, so as to find the classification result with the most pixel points as the category of the same aperture contour, improve the accuracy of aperture contour classification, and avoid the case that multiple classification results appear in the same contour.

[0064] 2、After obtaining the accurate category of each aperture contour, the abnormal aperture contour is found through main feature clustering, so that the data operation amount can be reduced.

[0065] 3、The present application utilizes the characteristics that the distribution of pixel values in the abnormal aperture contour is large and the area of the abnormal aperture contour is large, and comprehensively utilizes the type information of the aperture contour, so as to accurately find the abnormal aperture contour caused by the fact that the aperture range is enlarged due to instrument damage and the fact that the crack is elongated due to extrusion in the image sample preparation process. BRIEF DESCRIPTION OF DRAWINGS

[0066] Figure 1 A flowchart of a shale abnormal aperture identification method based on machine learning DETAILED DESCRIPTION

[0067] The specific embodiments of the present application are described below to facilitate the understanding of the present application by those skilled in the art, but it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, it is obvious that various changes are within the spirit and scope of the present application defined and limited by the appended claims, and all the inventions utilizing the concept of the present application are within the scope of protection.

[0068] As shown in Figure 1 , a shale abnormal aperture identification method based on machine learning comprises the following steps:

[0069] S1, pre-process the rock picture and the label picture to obtain a training set and a test set;

[0070] S2, train a DeepLabv3+ model using the training set and the test set to obtain a trained DeepLabv3+ model;

[0071] S3, identify the to-be-identified picture using the trained DeepLabv3+ model to obtain a pixel point classification result array;

[0072] S4, segment the to-be-identified picture to obtain all aperture contour sets on the picture;

[0073] S5, find an abnormal aperture contour according to the aperture contour set and the pixel point classification result array.

[0074] In the embodiment, the step S1 comprises the following sub-steps:

[0075] S11, cutting the rock picture and the label picture to obtain the rock picture and the label picture with a size of 512*512;

[0076] S12, marking the label picture with a size of 512*512 to obtain a marked picture;

[0077] S13, dividing the rock picture and the marked picture with a size of 512*512 into a training set and a test set.

[0078] In the embodiment, the step S12 is specifically:

[0079] marking the red pixel point pixel value distributed in R(120-255), G(0-100), and B(0-100) in the label picture with a size of 512*512 as 1;

[0080] marking the yellow pixel point pixel value distributed in R(200-255), G(200-255), and B(0-150) in the label picture with a size of 512*512 as 2;

[0081] marking the blue pixel point pixel value distributed in R(0-100), G(200-255), and B(200-255) in the label picture with a size of 512*512 as 3;

[0082] marking the green pixel point pixel value distributed in R(0-100), G(120-255), and B(0-100) in the label picture with a size of 512*512 as 4;

[0083] marking other pixel point pixel values in the label picture with a size of 512*512 as 0.

[0084] In the embodiment, the loss function for training the DeepLabv3+ model in the step S2 is:

[0085]

[0086] wherein, L is the loss function, y t is an array of the DeepLabv3+ model prediction result of the corresponding picture, y hat is an array of the label picture sample of the corresponding picture, c is a class label value, β is an adjustment factor, “==” is a result equal to the value of c in the array, and sum() is the number of pixel points of the class c in the array.

[0087] In the embodiment, the weight formula for training the DeepLabv3+ model in the step S2 is:

[0088]

[0089] wherein, θ i+1 is the weight of the i+1 training, θ i is the weight of the i training, lr is the learning rate, is the true label value of the i training, h i is the DeepLabv3+ model actual output value of the i training, x i is the sample data input to the DeepLabv3+ model of the i training.

[0090] In the embodiment, the following formula is used as the objective function for evaluating the completion of the DeepLabv3+ model training in step S2:

[0091]

[0092] wherein, k is the number of categories, TP t is the number of true positives of the t category correctly identified, FP t is the number of false positives of the t category incorrectly identified, FN t is the total number of false negatives of the t category, and when the objective function is maximum, the DeepLabv3+ model training is completed.

[0093] In the embodiment, step S4 includes the following sub-steps:

[0094] S41, using Otsu threshold segmentation method to segment the picture to be identified to obtain the first organic matter and inorganic matter segmentation threshold;

[0095] The calculation formula of the organic matter and inorganic matter segmentation threshold is:

[0096] T1 = a x (1-a) x (avg1-avg2) 2

[0097] pix = (1, 2, 3, …, 254)

[0098] wherein, T1 is the first organic matter and inorganic matter segmentation threshold, a is the ratio of the number of pixels below the average pixel value of the set pix to the total number of pixels of the picture to be identified, avg1 is the average value of the pixel values of all pixel points below the average pixel value of the set pix in the picture to be identified, and avg2 is the average value of the pixel values of all pixel points above the average pixel value of the set pix in the picture to be identified.

[0099] S42, assigning 0 to the pixel value of the pixel point in the picture to be identified greater than the first organic matter and inorganic matter segmentation threshold to obtain the assigned picture;

[0100] S43, the Otsu threshold segmentation method is used to segment the assigned picture to obtain a second organic matter and inorganic matter segmentation threshold;

[0101] S44, the second organic matter and inorganic matter segmentation threshold is used for binaryzation processing on the picture to be recognized to obtain a hole contour set.

[0102] In the embodiment, the step S5 includes the following sub-steps:

[0103] S51, according to the pixel point classification result array, all pixel points in the hole contour set are traversed, the number of pixel points corresponding to each classification result in the same hole contour is counted, and the classification result with the largest number of pixel points is taken as the category of the same hole contour;

[0104] S52, the length, width, area, perimeter and pixel distribution variance of the hole contour of each category are calculated;

[0105] S53, the length, width, area, perimeter, pixel distribution variance and category are constructed into a feature data set;

[0106] S54, the main features are selected from the feature data set;

[0107] S55, the k-means clustering method is used for clustering processing on the main features to obtain an abnormal hole contour.

[0108] In the embodiment, the outlier is usually in the 1% area of the total data, so the hole contour far away from the center point and accounting for 1% in the number of each category is marked as an abnormal hole contour.

[0109] In the embodiment, the step S52 includes the following sub-steps:

[0110] S521, an outer rectangle frame of the hole contour of each category is established, and the length and width of the outer rectangle frame are taken as the length and width of the hole contour of the category;

[0111] S522, the number of pixel points in the outer rectangle frame is taken as the area of the hole contour of the category;

[0112] S523, the number of edge pixel points of the hole contour is counted as the perimeter of the hole contour of the category;

[0113] S524, according to the average pixel value in the hole contour, the pixel distribution variance of the hole contour is calculated;

[0114] The formula for calculating the pixel distribution variance of the hole contour in the step S524 is:

[0115]

[0116] Where S is the pixel distribution variance of the aperture contour, X1 is the first pixel value on the aperture contour, X2 is the second pixel value on the aperture contour, X3 is the third pixel value on the aperture contour, and X... N Let M be the Nth pixel value on the hole contour, M be the average pixel value, and N be the number of pixel values ​​within the hole contour.

[0117] In this embodiment, step S54 includes the following sub-steps:

[0118] S541. The zero-mean method is used to process the feature dataset to obtain standard normal distribution data;

[0119] S542. Calculate the covariance matrix based on the standard normal distribution data;

[0120] The formula for calculating the elements of the covariance matrix in step S542 is as follows:

[0121]

[0122] in, The first element in the covariance matrix Line 1 The column elements, where num represents the number of slit outlines, The standard normal distribution data of the b-th pore profile Dimensional data, For the standard normal distribution data, the first Dimensional data, The standard normal distribution data of the b-th pore profile Dimensional data, For the standard normal distribution data, the first Dimensional data, where 'a' is the dimension of the data, and avg() is used to calculate the mean;

[0123] S543. Based on the covariance matrix, obtain the eigenvalues ​​and eigenvectors;

[0124] S544. Obtain the principal components based on the eigenvalues ​​and eigenvectors;

[0125] S545. Principal components are used as the main features.

[0126] The application firstly adopts a DeepLabv3+ model to recognize a to-be-recognized picture, obtains a pixel point classification result array, then segments the to-be-recognized picture, obtains all hole contour sets on the picture, and then finds the classification result with the most pixel points in the same hole contour by counting the pixel points corresponding to each classification result in the same hole contour, so as to take the classification result with the most pixel points as the category of the same hole contour, improve the accuracy of hole contour classification, and avoid the situation that multiple classification results appear in the same contour. After obtaining the accurate category of each hole contour, the abnormal hole contour is found through main feature clustering, so that the data operation amount can be reduced.

Claims

1. A method for identifying abnormal pores and fractures in shale based on machine learning, characterized in that, Includes the following steps: S1. Preprocess the rock images and label images to obtain the training set and test set; S2. Train the DeepLabv3+ model using the training set and the test set to obtain the trained DeepLabv3+ model; S3. The trained DeepLabv3+ model is used to identify the image to be identified, and an array of pixel classification results is obtained. S4. Segment the image to be recognized to obtain a set of all hole and slit contours in the image; S5. Based on the set of hole and slot contours and the array of pixel classification results, find the abnormal hole and slot contours; Step S5 includes the following sub-steps: S51. Based on the pixel classification result array, traverse all pixels in the hole contour set, count the number of pixels corresponding to each classification result in the same hole contour, and take the classification result with the most pixels as the category of the same hole contour. S52. Calculate the length, width, area, perimeter, and pixel distribution variance of the hole profile for each category; S53. Construct a feature dataset from the length, width, area, perimeter, pixel distribution variance, and category; S54. Select the main features from the feature dataset; S55. The main features are clustered using the k-means clustering method to obtain the abnormal pore contours. Step S52 includes the following sub-steps: S521. Create the bounding rectangle of the hole / slit outline for each category, and use the length and width of the bounding rectangle as the length and width of the hole / slit outline for that category. S522. Use the number of pixels within the bounding rectangle as the area of ​​the hole contour for this category; S523. Count the number of edge pixels of the hole contour and use it as the perimeter of the hole contour of this category. S524. Calculate the pixel distribution variance of the hole contour based on the average pixel value within the hole contour. The formula for calculating the pixel distribution variance of the hole profile in step S524 is as follows: in, Let Variance be the pixel distribution variance of the aperture contour. This is the value of the first pixel on the hole / slit outline. This is the second pixel value on the hole / slit outline. This is the value of the 3rd pixel on the hole / slit outline. The first on the hole profile pixel value, This is the average pixel value. This represents the number of pixel values ​​within the hole / slit outline. Step S54 includes the following sub-steps: S541. The zero-mean method is used to process the feature dataset to obtain standard normal distribution data; S542. Calculate the covariance matrix based on the standard normal distribution data; The formula for calculating the elements of the covariance matrix in step S542 is as follows: in, The first element in the covariance matrix Line number Column elements, The number of holes / slots. For the first In the standard normal distribution data of the pore profile, the th Dimensional data, For the standard normal distribution data, the first Dimensional data, For the first In the standard normal distribution data of the pore profile, the th Dimensional data, For the standard normal distribution data, the first Dimensional data, For data dimensions, To calculate the mean; S543. Based on the covariance matrix, obtain the eigenvalues ​​and eigenvectors; S544. Obtain the principal components based on the eigenvalues ​​and eigenvectors; S545, Treat principal components as primary features.

2. The method for identifying shale anomalies and fractures based on machine learning according to claim 1, characterized in that, Step S1 includes the following sub-steps: S11. Crop the rock image and label image to obtain a rock image and label image with a size of 512*512; S12. Mark the 512*512 label image to obtain the marked image; S13. Divide the 512*512 rock images and labeled images into training and testing sets.

3. The method for identifying shale anomalies and fractures based on machine learning according to claim 2, characterized in that, Step S12 specifically involves: In a 512*512 label image, the red pixels distributed in R(120-255), G(0-100), and B(0-100) are marked with a pixel value of 1. In a 512*512 label image, the yellow pixels distributed in R(200-255), G(200-255), and B(0-150) are marked with a pixel value of 2; In a 512*512 label image, the blue pixels distributed in R(0-100), G(200-255), and B(200-255) are labeled with a pixel value of 3. In a 512*512 label image, the green pixels distributed in R(0-100), G(120-255), and B(0-100) are labeled with a pixel value of 4. All other pixels in the 512*512 label image are marked as 0.

4. The method for identifying shale anomalies and fractures based on machine learning according to claim 1, characterized in that, The loss function for training the DeepLabv3+ model in step S2 is: in, For loss function, This is an array of DeepLabv3+ model prediction results for the corresponding image. Here is an array of labeled image samples for the corresponding image, where c is the category label value. As a regulating factor, "To calculate the result in the array that is equal to the value of c, For the statistical array, the categories are The number of pixels.

5. The method for identifying shale anomalies and fractures based on machine learning according to claim 1, characterized in that, The weight formula for training the DeepLabv3+ model in step S2 is as follows: in, For the first Weights for each training iteration For the first Weights for each training iteration For learning rate, For the first The true label value of the training iterations. For the first The actual output value of the DeepLabv3+ model after training. For the first The sample data input to the DeepLabv3+ model during training.

6. The method for identifying shale anomalies and fractures based on machine learning according to claim 1, characterized in that, In step S2, the following formula is used as the objective function to evaluate the completion of DeepLabv3+ model training: in, For the number of categories, For the first The number of true instances that were correctly identified by the class. For the first The number of false positives identified by class misidentification. For the first Total number of false counterexamples.

7. The method for identifying shale anomalies and fractures based on machine learning according to claim 1, characterized in that, Step S4 includes the following sub-steps: S41. Use the Otsu threshold segmentation method to segment the image to be identified and obtain the first organic matter and inorganic matter segmentation threshold. S42. Assign 0 to the pixel values ​​of the pixels in the image to be identified that are greater than the first organic matter and inorganic matter segmentation threshold, and obtain the assigned image. S43. Use the Otsu threshold segmentation method to segment the assigned image and obtain the second organic matter and inorganic matter segmentation threshold. S44. The image to be identified is binarized using the second organic and inorganic matter segmentation threshold to obtain the set of hole and slit contours.

Citation Information

Patent Citations

  • A measurement method for automatically identifying real defect holes

    CN109509174A

  • Crack segmentation method and device, electronic device and storage medium

    CN110111334A