Shale pore identification method and device, electronic equipment and storage medium
By processing shale images using a convolutional neural network model, organic and inorganic pores are automatically identified and labeled, solving the problem of difficulty in distinguishing shale pore types in existing technologies and improving the accuracy of research and development of shale oil and gas occurrence.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PETROLEUM & CHEMICAL CORP
- Filing Date
- 2023-02-16
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies struggle to accurately and quantitatively distinguish between organic and inorganic pores in shale, and the lack of automated pore identification methods leads to uncertainties in the research and development of shale oil and gas occurrence.
A convolutional neural network model was used to process shale images. Through grayscale image processing and connected component analysis, organic and inorganic pores in the shale were automatically identified and marked.
It enables automatic identification and marking of shale pore types, improving the accuracy of shale oil and gas occurrence research and the scientific nature of development methods.
Smart Images

Figure CN118506043B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of exploration technology for continental shale oil, and in particular to a method, apparatus, electronic device and storage medium for identifying the pores of shale. Background Technology
[0002] Shale reservoirs have complex spatial structures and small pore sizes, primarily consisting of nanopores, which are diverse in type, including organic pores, inorganic pores, and microfractures. Oil and gas in the organic pores of shale reservoirs exist in an adsorbed and dissolved state, while oil and gas in the inorganic pores exist mostly in a free state. Accurate quantitative characterization of organic and inorganic pores in shale is crucial for studying the occurrence state of shale oil and gas, evaluating resource quality, and formulating reasonable development strategies.
[0003] Currently, fluid intrusion methods (gas adsorption, mercury intrusion porosimetry, and nuclear magnetic resonance) are the mainstream methods for quantitative characterization of the pore structure of porous media materials. Numerous studies have used this technique to investigate the pore structure characteristics of shale. However, theoretically, none of these methods can distinguish between organic and inorganic pores in shale. Furthermore, while imaging techniques can identify organic pores, they all rely on manual marking, which is inefficient and lacks automated identification methods. Summary of the Invention
[0004] To address the aforementioned issues, this application provides a method, apparatus, electronic device, and storage medium for identifying pore types in shale, which can automatically identify and mark the types of pores.
[0005] This application provides a method for identifying the porosity of shale, including:
[0006] Acquire images of the shale to be identified;
[0007] Based on the image, determine the grayscale image of the pores in the shale to be identified;
[0008] The grayscale image is input into a pre-established neural network model to determine the type of pores in the shale to be identified;
[0009] A pore type marking map of the shale to be identified is determined based on the type of pores.
[0010] In some embodiments, determining the grayscale image of the pores in the shale to be identified based on the image includes:
[0011] The image is converted to grayscale to obtain a first grayscale image;
[0012] Extract the connected component map and the binary map of pores from the first grayscale image;
[0013] The location of each pore is determined based on the connected body diagram;
[0014] Determine the outer rectangle of each pore, and determine the position of the outer rectangle based on the position of each pore;
[0015] Based on the position and size of the outer rectangle, the grayscale image of the pores is extracted from the first grayscale image.
[0016] In some embodiments, determining the outer rectangle of each pore includes:
[0017] Determine the circumscribed rectangle of each aperture;
[0018] The outer rectangle is determined based on the center of the circumscribed rectangle, wherein the area of the outer rectangle is greater than the area of the circumscribed rectangle.
[0019] In some embodiments, the method further includes:
[0020] Obtain sample images of shale;
[0021] Extract a local image, including the pores, from the sample image;
[0022] The types of pores in each local image are labeled to obtain training samples, wherein the training samples include local images and the labels corresponding to the local images;
[0023] The training samples are input into a convolutional neural network model for training to obtain the neural network model.
[0024] In some embodiments, the labels include: organic pore labels and inorganic pore labels, and the loss function of the convolutional neural network model includes:
[0025]
[0026] Where N is the number of samples, y i p represents the label of the i-th sample. i This represents the probability that the i-th sample is an organic pore.
[0027] In some embodiments, the convolutional neural network model includes: a sequentially connected input layer, a custom feature extraction layer, a first convolutional layer, a first normalization layer, a first activation layer, a pooling layer, a second convolutional layer, a second normalization layer, a second activation layer, a fully connected layer, a third activation layer, and an output layer, wherein the input layer is used to input a two-dimensional image; the feature extraction layer is used to extract features from the aperture sample image; the first convolutional layer includes a two-dimensional sliding convolutional filter; the first normalization layer employs a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; the first activation layer uses the ReLU function to normalize the input... Each element undergoes a thresholding operation, where any value less than zero is set to zero; Pooling layer: used to divide the input into rectangular pooling regions and calculate the average of each region to perform downsampling; Second convolutional layer includes: a two-dimensional sliding convolutional filter; Second normalization layer: uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; Second activation layer: uses the ReLU function to perform a thresholding operation on each element of the input, where any value less than zero is set to zero; Third activation layer uses the sogmoid function to normalize the output; Output layer is used to calculate cross-entropy loss.
[0028] In some embodiments, the feature extraction layer is used to extract features from a pore sample image, including:
[0029] The training samples are converted to grayscale to obtain a second grayscale image;
[0030] Perform grayscale statistics on the second grayscale image to obtain the number of pixels corresponding to each grayscale value in the second grayscale image;
[0031] A matrix is used to determine the grayscale frequency based on the number of pixels corresponding to each grayscale value;
[0032] The matrix is processed into an image to obtain the pore sample image features of each training sample.
[0033] This application provides a shale porosity identification device, comprising:
[0034] The acquisition module is used to acquire images of the shale to be identified.
[0035] The first determining module is used to determine the grayscale image of the pores in the shale to be identified based on the image;
[0036] The second determining module is used to input the grayscale image into a pre-established neural network model to determine the type of pores in the shale to be identified;
[0037] A marking module is used to determine a pore type marking map of the shale to be identified based on the type of pores.
[0038] This application provides a storage medium storing a computer program that can be executed by one or more processors and can be used to implement the methods described in any of the above-described embodiments.
[0039] This application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in any of the above-mentioned embodiments.
[0040] This application provides a method, apparatus, electronic device, and storage medium for identifying shale pores. The method involves acquiring an image of the shale to be identified; determining a grayscale image of the pores in the shale based on the image; inputting the grayscale image into a pre-established neural network model to determine the type of pores in the shale; and determining a pore type labeling map of the shale based on the pore type. This method enables automatic identification and labeling of pore types. Attached Figure Description
[0041] The present application will be described in more detail below based on embodiments and with reference to the accompanying drawings.
[0042] Figure 1 A schematic diagram illustrating the implementation process of a shale porosity identification method provided in this application embodiment;
[0043] Figure 2 This is a schematic diagram of an inorganic pore sample image provided in an embodiment of this application;
[0044] Figure 3 This is a schematic diagram of an organic pore sample image provided in an embodiment of this application;
[0045] Figure 4 A schematic diagram of a neural network structure provided in an embodiment of this application;
[0046] Figure 5 A schematic diagram of a custom feature extraction process provided in an embodiment of this application;
[0047] Figure 6 This is a schematic diagram illustrating the training convergence situation provided in an embodiment of this application;
[0048] Figure 7 A schematic flowchart illustrating the identification of shale pore types provided in this application embodiment;
[0049] Figure 8 A schematic diagram of the outer rectangle of a pore provided in an embodiment of this application;
[0050] Figure 9 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application.
[0051] In the accompanying drawings, the same parts are referred to by the same reference numerals, and the drawings are not drawn to scale. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0054] If the application documents contain similar descriptions such as "first, second, third", the following explanation shall be added: In the following description, the terms "first, second, third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0056] To address the problems existing in related technologies, this application provides a method for identifying the porosity of shale. The method is executed by an electronic device, specifically a terminal, which may include, but is not limited to, mobile phones, personal computers, tablets, laptops, personal digital assistants, etc. The functionality of the shale porosity identification method provided in this application can be implemented by the processor of the electronic device calling program code, which can be stored in a computer storage medium.
[0057] Example 1
[0058] This application provides a method for identifying the porosity of shale. Figure 1 This is a schematic diagram illustrating the implementation process of a shale porosity identification method provided in an embodiment of this application, as shown below. Figure 1 As shown, it includes:
[0059] Step S101: Obtain an image of the shale to be identified.
[0060] In this embodiment, the shale to be identified can be road shale. The image can be a two-dimensional digital image, such as an electron microscope scan image or a CT scan interface image.
[0061] In this embodiment of the application, the image of shale includes an image of pores.
[0062] In this embodiment of the application, the electronic device can acquire an image of the shale to be identified by input from an input device, such as an electron microscope, a CT scanning device, or a storage device.
[0063] In some embodiments, the electronic device can communicate with a server to obtain images of the shale to be identified.
[0064] Step S102: Determine the grayscale image of the pores in the shale to be identified based on the image.
[0065] In this embodiment of the application, the shale may include multiple pores, and the grayscale image of the pores may be a grayscale image slightly larger than that of the pores.
[0066] In this embodiment of the application, step S102 can be implemented through the following steps:
[0067] Step S21: Convert the image to grayscale to obtain a first grayscale image.
[0068] In this embodiment, the image can be converted to grayscale. If the image is a color image, it needs to be converted to grayscale. If the image has 16 bits or 32 bits, it needs to be converted to 8 bits. The first grayscale image is an 8-bit grayscale image. The grayscale range of an 8-bit grayscale image is 0-255, where 0 represents black and 255 represents white, for a total of 256 grayscale values.
[0069] Step S22: Extract the connected component map and the binary map of pores from the first grayscale image.
[0070] In this embodiment of the application, threshold segmentation or other algorithms can be used to extract the pore portion of shale, thereby obtaining a binary map of the pores.
[0071] In this embodiment of the application, a seed filling algorithm or other algorithms can be used to obtain a connected graph of connected components in the image.
[0072] Step S23: Determine the location of each pore based on the connected body diagram.
[0073] In this embodiment of the application, the position of each pore can be located through a connected body diagram.
[0074] Step S24: Determine the outer rectangle of each hole, and determine the position of the outer rectangle based on the position of each hole.
[0075] In this embodiment of the application, determining the outer rectangle of each pore in step S24 can be achieved through the following steps:
[0076] Step S241: Determine the circumscribed rectangle of each aperture.
[0077] In this embodiment of the application, the circumscribed rectangle can be E. i This indicates that the length w of the outer rectangle i , width h i .
[0078] Step S242: Determine the outer rectangle based on the center of the circumscribed rectangle, wherein the area of the outer rectangle is greater than the area of the circumscribed rectangle.
[0079] In this embodiment of the application, rectangle E i Draw rectangle E in the center i ', Rectangle E i Slightly larger than rectangle E i Rectangle E i 'the length of w i ′、width h i The length and width of the outer rectangle can be represented as:
[0080] w′ i =[σw i ],h′ i =[σh i ];
[0081] Where σ is the proportionality coefficient, σ>1, which can be selected as needed, and [] is the rounding operation.
[0082] In this embodiment, the position of each hole can be considered as the position of each outer rectangle.
[0083] Step S25: Extract the grayscale image of the pores from the first grayscale image based on the position and size of the outer rectangle.
[0084] In this embodiment of the application, since each pore corresponds to an outer rectangle, the grayscale image of each pore can be extracted from the first grayscale image by the position and size of the outer rectangle of each pore.
[0085] Step S103: Input the grayscale image into a pre-established neural network model to determine the type of pores in the shale to be identified.
[0086] In this embodiment of the application, the input of the pre-established neural network model is a grayscale image, and the output includes the type of pores. The type of pores may include organic pores and inorganic pores. When outputting the type of pores, a numerical label can be used instead. For example, inorganic pores are labeled as 0 and organic pores are labeled as 1.
[0087] In this embodiment of the application, after inputting the grayscale image of each pore, the digital label of each pore will be determined.
[0088] In this embodiment of the application, the above steps can be repeated to obtain the pore type of each pore.
[0089] In this embodiment of the application, the neural network model may be a convolutional neural network.
[0090] Step S104: Determine the pore type marking map of the shale to be identified based on the type of pores.
[0091] In this embodiment of the application, after determining the type of each pore, each pore can be marked in the connected volume diagram. The marking can be a number corresponding to the type. In some embodiments, different colors can be used based on the pore type to obtain a pore type marking map. For example, organic pores are marked in red, and inorganic pores are marked in green.
[0092] The shale pore identification method provided in this application involves acquiring an image of the shale to be identified; determining a grayscale image of the pores in the shale based on the image; inputting the grayscale image into a pre-established neural network model to determine the type of pores in the shale to be identified; and determining a pore type labeling image of the shale to be identified based on the pore type. This method can automatically identify and label the type of pores.
[0093] Example 2
[0094] Based on the foregoing embodiments, this application further provides a method for identifying the porosity of shale, including:
[0095] Step S201: Obtain a sample image of the shale.
[0096] In this embodiment of the application, the sample image may be an electron microscope scan image, a CT scan interface image, etc.
[0097] Step S202: Extract a local image including pores from the sample image.
[0098] In this embodiment of the application, the local image of the pore can be obtained by automatic recognition or manual screenshotting.
[0099] Step S203: Label the type of pores in each local image to obtain training samples, wherein the training samples include local images and the labels corresponding to the local images.
[0100] In this embodiment of the application, sample images can be classified and labeled. For example, inorganic pore images are labeled as 0 and organic pore images are labeled as 1. Then 0 or 1 is the label corresponding to the local image.
[0101] Step S204: Input the training samples into the convolutional neural network model for training to obtain the neural network model.
[0102] In this embodiment, the convolutional neural network model includes: a sequentially connected input layer, a custom feature extraction layer, a first convolutional layer, a first normalization layer, a first activation layer, a pooling layer, a second convolutional layer, a second normalization layer, a second activation layer, a fully connected layer, a third activation layer, and an output layer. The input layer is used to input a two-dimensional image; the feature extraction layer is used to extract features from the aperture sample image; the first convolutional layer includes a two-dimensional sliding convolutional filter; the first normalization layer uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; the first activation layer uses the ReLU function to normalize the input... Each element undergoes a thresholding operation, where any value less than zero is set to zero; Pooling layer: used to divide the input into rectangular pooling regions and calculate the average of each region to perform downsampling; Second convolutional layer includes: a two-dimensional sliding convolutional filter; Second normalization layer: uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; Second activation layer: uses the ReLU function to perform a thresholding operation on each element of the input, where any value less than zero is set to zero; Third activation layer uses the sogmoid function to normalize the output; Output layer is used to calculate cross-entropy loss.
[0103] In this embodiment, the first convolutional layer has 8 filters, a 3x3 kernel size, and a 1x1 span. The second convolutional layer has 16 filters, a 3x3 kernel size, and a 1x1 span. The fully connected layer has 400 neurons.
[0104] In this embodiment of the application, the feature extraction layer is used to extract features from the pore sample image, including:
[0105] Step S31: Convert the training samples to grayscale to obtain a second grayscale image.
[0106] In this embodiment, the second grayscale image is an 8-bit grayscale image. The training samples can be sample images.
[0107] Step S32: Perform grayscale statistics on the second grayscale image to obtain the number of pixels corresponding to each grayscale value in the second grayscale image.
[0108] In this embodiment, the grayscale range of the 8-bit grayscale image is 0-255, where 0 represents black and 255 represents white, for a total of 256 grayscale values. The number of pixels with each of the 256 grayscale values can be counted, denoted by m. i This represents the number of pixels with a grayscale value of i in the image.
[0109] Step S33: Determine the grayscale frequency matrix based on the number of pixels corresponding to each grayscale value.
[0110] In this embodiment of the application, 256 grayscale frequencies can be arranged sequentially from top to bottom or from left to right to form a 16*16 matrix, thereby determining the grayscale frequency matrix. The grayscale frequencies can be considered as a number.
[0111] Step S34: The matrix is processed into an image to obtain the pore sample image features of each training sample.
[0112] In this embodiment of the application, the image processing involves scaling the data in the matrix to a grayscale range, that is, scaling the data in the matrix to a grayscale range of 0-255, thereby obtaining a pore sample feature map.
[0113] In this embodiment of the application, c i Let c be the value of the i-th pixel in image C. i The calculation method can be:
[0114]
[0115] In the formula, [] indicates rounding to the nearest integer.
[0116] In this embodiment of the application, by performing feature extraction, the number of pixels in the image data can be reduced, thereby achieving higher accuracy with fewer convolutional and pooling layers.
[0117] In this embodiment, during training, a subset of sample images can be designated as the training set and a subset as the validation set. The network is trained using a loss function as the objective, thereby obtaining a neural network model. In this embodiment, training can stop when both the training accuracy and the loss value meet certain conditions. For example, training is complete when the accuracy is greater than an accuracy threshold, or when the loss value is less than a loss value threshold. For instance, training is complete when the accuracy reaches 90% and the loss value is less than 0.05.
[0118] In this embodiment, the loss function is the cross-entropy function, which can be expressed as:
[0119]
[0120] In the formula, N is the number of samples, y i p represents the label of the i-th sample. i This represents the probability that the i-th sample is an organic pore.
[0121] Step S205: Obtain an image of the shale to be identified.
[0122] In this embodiment, the shale to be identified can be road shale. The image can be a two-dimensional digital image, such as an electron microscope scan image or a CT scan interface image.
[0123] In this embodiment of the application, the image of shale includes an image of pores.
[0124] In this embodiment of the application, the electronic device can acquire an image of the shale to be identified by input from an input device, such as an electron microscope, a CT scanning device, or a storage device.
[0125] In some embodiments, the electronic device can communicate with a server to obtain images of the shale to be identified.
[0126] Step S206: Determine the grayscale image of the pores in the shale to be identified based on the image.
[0127] In this embodiment of the application, the shale may include multiple pores, and the grayscale image of the pores may be a grayscale image slightly larger than that of the pores.
[0128] In this embodiment of the application, step S206 can be implemented through the following steps:
[0129] Step S61: Convert the image to grayscale to obtain a first grayscale image.
[0130] In this embodiment, the image can be converted to grayscale. If the image is a color image, it needs to be converted to grayscale. If the image has 16 bits or 32 bits, it needs to be converted to 8 bits. The first grayscale image is an 8-bit grayscale image. The grayscale range of an 8-bit grayscale image is 0-255, where 0 represents black and 255 represents white, for a total of 256 grayscale values.
[0131] Step S62: Extract the connected component map and the binary map of pores from the first grayscale image.
[0132] In this embodiment of the application, threshold segmentation or other algorithms can be used to extract the pore portion of shale, thereby obtaining a binary map of the pores.
[0133] In this embodiment of the application, a seed filling algorithm or other algorithms can be used to obtain a connected graph of connected components in the image.
[0134] Step S63: Determine the location of each pore based on the connected body diagram.
[0135] In this embodiment of the application, the position of each pore can be located through a connected body diagram.
[0136] Step S64: Determine the outer rectangle of each hole, and determine the position of the outer rectangle based on the position of each hole.
[0137] In this embodiment of the application, determining the outer rectangle of each pore in step S64 can be achieved through the following steps:
[0138] Step S641: Determine the circumscribed rectangle of each aperture.
[0139] In this embodiment of the application, the circumscribed rectangle can be E. i This indicates that the length w of the outer rectangle i , width h i .
[0140] Step S642: Determine the outer rectangle based on the center of the circumscribed rectangle, wherein the area of the outer rectangle is greater than the area of the circumscribed rectangle.
[0141] In this embodiment of the application, rectangle E i Draw rectangle E in the center i ', Rectangle E i Slightly larger than rectangle E i Rectangle E i 'the length of w i ′、width h i The length and width of the outer rectangle can be represented as:
[0142] w′ i =[σw i ], h′ i =[σh i ];
[0143] Where σ is the proportionality coefficient, σ>1, which can be selected as needed, and [] is the rounding operation.
[0144] In this embodiment, the position of each hole can be considered as the position of each outer rectangle.
[0145] Step S65: Extract the grayscale image of the pores from the first grayscale image based on the position and size of the outer rectangle.
[0146] In this embodiment of the application, since each pore corresponds to an outer rectangle, the grayscale image of each pore can be extracted from the first grayscale image by the position and size of the outer rectangle of each pore.
[0147] Step S207: Input the grayscale image into a pre-established neural network model to determine the type of pores in the shale to be identified.
[0148] In this embodiment of the application, the input of the pre-established neural network model is a grayscale image, and the output includes the type of pores. The type of pores may include organic pores and inorganic pores. When outputting the type of pores, a numerical label can be used instead. For example, inorganic pores are labeled as 0 and organic pores are labeled as 1.
[0149] In this embodiment of the application, after inputting the grayscale image of each pore, the digital label of each pore will be determined.
[0150] In this embodiment of the application, the above steps can be repeated to obtain the pore type of each pore.
[0151] In this embodiment of the application, the neural network model may be a convolutional neural network.
[0152] Step S208: Determine the pore type marking map of the shale to be identified based on the type of pores.
[0153] In this embodiment of the application, after determining the type of each pore, each pore can be marked in the connected volume diagram. The marking can be a number corresponding to the type. In some embodiments, different colors can be used based on the pore type to obtain a pore type marking map. For example, organic pores are marked in red, and inorganic pores are marked in green.
[0154] The shale pore identification method provided in this application involves acquiring an image of the shale to be identified; determining a grayscale image of the pores in the shale based on the image; inputting the grayscale image into a pre-established neural network model to determine the type of pores in the shale to be identified; and determining a pore type labeling image of the shale to be identified based on the pore type. This method can automatically identify and label the type of pores.
[0155] Example 3
[0156] Based on the foregoing embodiments, this application further provides a method for identifying the porosity of shale, the method comprising:
[0157] 1. Obtain sample images.
[0158] In digital images of shale, local sub-images containing shale pores can be obtained using methods such as manual cropping. Figure 2 This is a schematic diagram of an inorganic pore sample image provided in an embodiment of this application. Figure 3 This is a schematic diagram of an organic pore sample image provided in an embodiment of this application. The sample image is required to include shale pores and information on the organic matter and minerals surrounding the pores.
[0159] 2. Classify and label the sample images.
[0160] The selected sample set was manually identified, with inorganic well samples labeled as 0 and organic well samples labeled as 1. One method of labeling was to store inorganic well samples in a folder named 0 and organic well samples in a folder named 1, thereby achieving classification and labeling of the sample images.
[0161] 3. Design the convolutional neural network structure.
[0162] In the embodiments of this application, Figure 4 A schematic diagram of a neural network structure provided in an embodiment of this application is shown below. Figure 4 As shown, the convolutional neural network consists of 12 layers in the following order: input layer, custom feature extraction layer, convolutional layer 1, normalization layer 1, activation layer 1, pooling layer, convolutional layer 2, normalization layer 2, activation layer 2, fully connected layer, output layer, and classification layer. The image input layer feeds a two-dimensional image into the network; the feature extraction layer extracts features from the aperture sample image; convolutional layer 1 uses a two-dimensional sliding convolutional filter with 8 filters, a 3x3 kernel size, and a 1x1 span; normalization layer 1 uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; and activation layer 1 uses the ReLU function to perform a threshold operation on each element of the input, where any element less than zero... The values are all set to zero; Pooling layer: Average pooling is used, which performs downsampling by dividing the input into rectangular pooling regions and calculating the average value of each region; Convolutional layer 2: Two-dimensional sliding convolutional filter, 16 filters, 3*3 kernel size, 1*1 span; Normalization layer 2: Batch normalization algorithm is used to independently normalize mini-batch data of all observations for each channel; Activation layer 2: The ReLU function is used to perform thresholding on each element of the input, where any value less than zero is set to zero; Fully connected layer: One fully connected layer with 400 neurons; Activation layer 3: The output is normalized using the sogmoid function; Output layer: Cross-entropy loss is calculated.
[0163] Custom feature extraction layer design, Figure 5 This is a schematic diagram of a custom feature extraction process provided in an embodiment of this application, such as... Figure 5 As shown, Figure 5 As shown in Figure 5(a), the input image is analyzed. Gray-level statistics are performed on 5(a), and the gray-level distribution is shown in Figure 5(b). The gray-level frequencies are reconstructed as follows: Figure 5 As shown in (c), the pore feature image 5(d) is obtained after transforming the gray-level frequency matrix.
[0164] 4. Online training.
[0165] 75% of the sample images were used as the training set, and 25% as the validation set. Using the loss function as the objective function, the SGDM algorithm was employed with a learning rate of 0.001. The network was trained and converged after 10 iterations. The average accuracy on the test set was 92.5%, with a maximum of 95%. The training loss function value was 4.06e-3. The network meets the application requirements, and the training convergence is as follows: Figure 6 As shown.
[0166] 5. Identify and mark shale pores. Figure 7 This application provides a schematic flowchart for identifying shale pore types, as shown in the embodiments. Figure 7 As shown, it includes:
[0167] Image conversion: Let the digital image of the shale to be labeled be image A. Use the averaging method to convert image A to grayscale and then to 8 bits to obtain the 8-bit grayscale image B of the shale.
[0168] Binarization: Here, a threshold segmentation algorithm is used with a threshold of 50 to obtain a pore binary image, denoted as Figure C.
[0169] Connected component calculation: The seed filling algorithm is used to calculate the connected component graph D in graph C.
[0170] Outer Rectangle: Taking the first hole in Figure D as an example, the circumscribed rectangle E1' is obtained. The length and width of the circumscribed rectangle E1 of D1 are w1 = 26 and h1 = 19, respectively. Taking σ = 1.2, the length and width of the circumscribed rectangle E1' are calculated to be w1 = 26 and h1 = 19, respectively. ′ 1 = 31, h = 23 Figure 8 This is a schematic diagram of the outer rectangle of a pore provided in an embodiment of this application.
[0171] Pore extraction: Extract individual pore grayscale images F1 from the 8-bit grayscale image B of shale based on the position and size of the outer rectangle E1'.
[0172] Neural network identification of pore type: Input F1 into the convolutional neural network model trained in the previous step, and calculate the output to obtain the pore type, 0 or 1.
[0173] Repeat the steps to obtain all pore types, and mark each pore in the connected graph D, marking organic and inorganic pores with different colors to obtain the shale pore type marking graph G.
[0174] In this embodiment, an artificial intelligence method for identifying organic and inorganic pores in shale was designed using a convolutional neural network. Based on the characteristics of shale pores, a shale pore feature extraction layer was designed, which effectively reduced the number of pixels in the image data and automatically identified and marked organic and inorganic pores in shale digital images, providing a basis for further research on the occurrence state and effective development of shale oil and gas.
[0175] Example 4
[0176] Based on the foregoing embodiments, this application provides a shale porosity identification device. The various modules and units included in the device can be implemented by a processor in a computer device; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0177] This application provides a shale pore identification device, which includes:
[0178] The acquisition module is used to acquire images of the shale to be identified.
[0179] The first determining module is used to determine the grayscale image of the pores in the shale to be identified based on the image;
[0180] The second determining module is used to input the grayscale image into a pre-established neural network model to determine the type of pores in the shale to be identified;
[0181] A marking module is used to determine a pore type marking map of the shale to be identified based on the type of pores.
[0182] In some embodiments, determining the grayscale image of the pores in the shale to be identified based on the image includes:
[0183] The image is converted to grayscale to obtain a first grayscale image;
[0184] Extract the connected component map and the binary map of pores from the first grayscale image;
[0185] The location of each pore is determined based on the connected body diagram;
[0186] Determine the outer rectangle of each pore, and determine the position of the outer rectangle based on the position of each pore;
[0187] Based on the position and size of the outer rectangle, the grayscale image of the pores is extracted from the first grayscale image.
[0188] In some embodiments, determining the outer rectangle of each pore includes:
[0189] Determine the circumscribed rectangle of each aperture;
[0190] The outer rectangle is determined based on the center of the circumscribed rectangle, wherein the area of the outer rectangle is greater than the area of the circumscribed rectangle.
[0191] In some embodiments, the shale porosity identification device is further used for:
[0192] Obtain sample images of shale;
[0193] Extract a local image, including the pores, from the sample image;
[0194] The types of pores in each local image are labeled to obtain training samples, wherein the training samples include local images and the labels corresponding to the local images;
[0195] The training samples are input into a convolutional neural network model for training to obtain the neural network model.
[0196] In some embodiments, the labels include: organic pore labels and inorganic pore labels, and the loss function of the convolutional neural network model includes:
[0197]
[0198] Where N is the number of samples, y i p represents the label of the i-th sample. i This represents the probability that the i-th sample is an organic pore.
[0199] In some embodiments, the convolutional neural network model includes: a sequentially connected input layer, a custom feature extraction layer, a first convolutional layer, a first normalization layer, a first activation layer, a pooling layer, a second convolutional layer, a second normalization layer, a second activation layer, a fully connected layer, a third activation layer, and an output layer, wherein the input layer is used to input a two-dimensional image; the feature extraction layer is used to extract features from the aperture sample image; the first convolutional layer includes a two-dimensional sliding convolutional filter; the first normalization layer employs a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; the first activation layer uses the ReLU function to normalize the input... Each element undergoes a thresholding operation, where any value less than zero is set to zero; Pooling layer: used to divide the input into rectangular pooling regions and calculate the average of each region to perform downsampling; Second convolutional layer includes: a two-dimensional sliding convolutional filter; Second normalization layer: uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; Second activation layer: uses the ReLU function to perform a thresholding operation on each element of the input, where any value less than zero is set to zero; Third activation layer uses the sogmoid function to normalize the output; Output layer is used to calculate cross-entropy loss.
[0200] In some embodiments, the feature extraction layer is used to extract features from a pore sample image, including:
[0201] The training samples are converted to grayscale to obtain a second grayscale image;
[0202] Perform grayscale statistics on the second grayscale image to obtain the number of pixels corresponding to each grayscale value in the second grayscale image;
[0203] A matrix is used to determine the grayscale frequency based on the number of pixels corresponding to each grayscale value;
[0204] The matrix is processed into an image to obtain the pore sample image features of each training sample.
[0205] It should be noted that, in the embodiments of this application, if the above-described shale porosity identification method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0206] Example 5
[0207] Accordingly, this application provides a storage medium storing a computer program thereon, characterized in that the computer program, when executed by a processor, implements the steps in the shale porosity identification method provided in the above embodiments.
[0208] This application provides an electronic device; Figure 9 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application, such as... Figure 9 As shown, the electronic device 700 includes: a processor 701, at least one communication bus 702, a user interface 703, at least one external communication interface 704, and a memory 705. The communication bus 702 is configured to enable communication between these components. The user interface 703 may include a display screen, and the external communication interface 704 may include standard wired and wireless interfaces. The processor 701 is configured to execute a program stored in the memory for a shale porosity identification method, to implement the steps in the shale porosity identification method provided in the above embodiment.
[0209] The descriptions of the above embodiments of the electronic devices and storage media are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the embodiments of the computer devices and storage media of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0210] Example 6:
[0211] This embodiment also provides a computer program product, including a computer program that, when executed by a processor, implements the shale porosity identification method described in the above embodiment.
[0212] This application provides a method for identifying the porosity of shale, including:
[0213] Acquire images of the shale to be identified;
[0214] Based on the image, determine the grayscale image of the pores in the shale to be identified;
[0215] The grayscale image is input into a pre-established neural network model to determine the type of pores in the shale to be identified;
[0216] A pore type marking map of the shale to be identified is determined based on the type of pores.
[0217] In some embodiments, determining the grayscale image of the pores in the shale to be identified based on the image includes:
[0218] The image is converted to grayscale to obtain a first grayscale image;
[0219] Extract the connected component map and the binary map of pores from the first grayscale image;
[0220] The location of each pore is determined based on the connected body diagram;
[0221] Determine the outer rectangle of each pore, and determine the position of the outer rectangle based on the position of each pore;
[0222] Based on the position and size of the outer rectangle, the grayscale image of the pores is extracted from the first grayscale image.
[0223] In some embodiments, determining the outer rectangle of each pore includes:
[0224] Determine the circumscribed rectangle of each aperture;
[0225] The outer rectangle is determined based on the center of the circumscribed rectangle, wherein the area of the outer rectangle is greater than the area of the circumscribed rectangle.
[0226] In some embodiments, the method further includes:
[0227] Obtain sample images of shale;
[0228] Extract a local image, including the pores, from the sample image;
[0229] The types of pores in each local image are labeled to obtain training samples, wherein the training samples include local images and the labels corresponding to the local images;
[0230] The training samples are input into a convolutional neural network model for training to obtain the neural network model.
[0231] In some embodiments, the labels include: organic pore labels and inorganic pore labels, and the loss function of the convolutional neural network model includes:
[0232]
[0233] Where N is the number of samples, y i p represents the label of the i-th sample. i This represents the probability that the i-th sample is an organic pore.
[0234] In some embodiments, the convolutional neural network model includes: a sequentially connected input layer, a custom feature extraction layer, a first convolutional layer, a first normalization layer, a first activation layer, a pooling layer, a second convolutional layer, a second normalization layer, a second activation layer, a fully connected layer, a third activation layer, and an output layer, wherein the input layer is used to input a two-dimensional image; the feature extraction layer is used to extract features from the aperture sample image; the first convolutional layer includes a two-dimensional sliding convolutional filter; the first normalization layer employs a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; the first activation layer uses the ReLU function to normalize the input... Each element undergoes a thresholding operation, where any value less than zero is set to zero; Pooling layer: used to divide the input into rectangular pooling regions and calculate the average of each region to perform downsampling; Second convolutional layer includes: a two-dimensional sliding convolutional filter; Second normalization layer: uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; Second activation layer: uses the ReLU function to perform a thresholding operation on each element of the input, where any value less than zero is set to zero; Third activation layer uses the sogmoid function to normalize the output; Output layer is used to calculate cross-entropy loss.
[0235] In some embodiments, the feature extraction layer is used to extract features from a pore sample image, including:
[0236] The training samples are converted to grayscale to obtain a second grayscale image;
[0237] Perform grayscale statistics on the second grayscale image to obtain the number of pixels corresponding to each grayscale value in the second grayscale image;
[0238] A matrix is used to determine the grayscale frequency based on the number of pixels corresponding to each grayscale value;
[0239] The matrix is processed into an image to obtain the pore sample image features of each training sample.
[0240] It should be noted that the descriptions of the above computer program product embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0241] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0242] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0243] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0244] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0245] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0246] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0247] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a controller to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0248] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of pore identification of shale, characterized by, include: Acquire images of the shale to be identified; Based on the image, determine the grayscale image of the pores in the shale to be identified; The grayscale image is input into a pre-established neural network model to determine the type of pores in the shale to be identified; A pore type marking map of the shale to be identified is determined based on the type of pores. The neural network model is trained through the following steps: Obtain sample images of shale; Extract a local image, including the pores, from the sample image; The types of pores in each local image are labeled to obtain training samples, wherein the training samples include local images and the labels corresponding to the local images; The training samples are input into a convolutional neural network model for training to obtain the neural network model; The convolutional neural network model includes: a sequentially connected input layer, a custom feature extraction layer, a first convolutional layer, a first normalization layer, a first activation layer, a pooling layer, a second convolutional layer, a second normalization layer, a second activation layer, a fully connected layer, a third activation layer, and an output layer. The input layer is used to input a two-dimensional image; the feature extraction layer is used to extract features from the aperture sample image; the first convolutional layer includes a two-dimensional sliding convolutional filter; the first normalization layer uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; the first activation layer uses the ReLU function to normalize each input... The first layer performs a thresholding operation on each element of the input, where any value less than zero is set to zero; the second layer performs downsampling by dividing the input into rectangular pooling regions and calculating the average of each region; the third layer performs a thresholding operation on each element of the input using the ReLU function, where any value less than zero is set to zero; the fourth layer performs a thresholding operation on the output using the sogmoid function; and the fifth layer calculates the cross-entropy loss. The custom feature extraction layer includes: The training samples are converted to grayscale to obtain a second grayscale image; Perform grayscale statistics on the second grayscale image to obtain the number of pixels corresponding to each grayscale value in the second grayscale image; A matrix is used to determine the grayscale frequency based on the number of pixels corresponding to each grayscale value; The matrix is processed into an image to obtain the pore sample image features of each training sample.
2. The method according to claim 1, characterized in that, Determining the grayscale image of the pores in the shale to be identified based on the image includes: The image is converted to grayscale to obtain a first grayscale image; Extract the connected component map and the binary map of pores from the first grayscale image; The location of each pore is determined based on the connected body diagram; Determine the outer rectangle of each pore, and determine the position of the outer rectangle based on the position of each pore; Based on the position and size of the outer rectangle, the grayscale image of the pores is extracted from the first grayscale image.
3. The method according to claim 2, characterized in that, Determining the outer rectangle of each pore includes: Determine the circumscribed rectangle of each aperture; The outer rectangle is determined based on the center of the circumscribed rectangle, wherein the area of the outer rectangle is greater than the area of the circumscribed rectangle.
4. The method according to claim 1, characterized in that, The labels include: organic pore labels and inorganic pore labels, and the loss function of the convolutional neural network model includes: ; in, For the number of samples, Let represent the label of the i-th sample. This represents the probability that the i-th sample is an organic pore.
5. A shale porosity identification device, characterized in that, include: The acquisition module is used to acquire images of the shale to be identified. The first determining module is used to determine the grayscale image of the pores in the shale to be identified based on the image; The second determining module is used to input the grayscale image into a pre-established neural network model to determine the type of pores in the shale to be identified; A marking module is used to determine a pore type marking map of the shale to be identified based on the type of pores; The neural network model is trained through the following steps: Obtain sample images of shale; Extract a local image, including the pores, from the sample image; The types of pores in each local image are labeled to obtain training samples, wherein the training samples include local images and the labels corresponding to the local images; The training samples are input into a convolutional neural network model for training to obtain the neural network model; The convolutional neural network model includes: a sequentially connected input layer, a custom feature extraction layer, a first convolutional layer, a first normalization layer, a first activation layer, a pooling layer, a second convolutional layer, a second normalization layer, a second activation layer, a fully connected layer, a third activation layer, and an output layer. The input layer is used to input a two-dimensional image; the feature extraction layer is used to extract features from the aperture sample image; the first convolutional layer includes a two-dimensional sliding convolutional filter; the first normalization layer uses a batch normalization algorithm to independently normalize mini-batch data of all observations for each channel; the first activation layer uses the ReLU function to normalize each input... The first layer performs a thresholding operation on each element of the input, where any value less than zero is set to zero; the second layer performs downsampling by dividing the input into rectangular pooling regions and calculating the average of each region; the third layer performs a thresholding operation on each element of the input using the ReLU function, where any value less than zero is set to zero; the fourth layer performs a thresholding operation on the output using the sogmoid function; and the fifth layer calculates the cross-entropy loss. The custom feature extraction layer includes: The training samples are converted to grayscale to obtain a second grayscale image; Perform grayscale statistics on the second grayscale image to obtain the number of pixels corresponding to each grayscale value in the second grayscale image; A matrix is used to determine the grayscale frequency based on the number of pixels corresponding to each grayscale value; The matrix is processed into an image to obtain the pore sample image features of each training sample.
6. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that, when executed by the processor, performs the method as described in any one of claims 1 to 4.
7. A storage medium, characterized in that, The computer program stored in the storage medium can be executed by one or more processors and can be used to implement the method as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the method described in any one of claims 1-4.