A method, system and device for identifying pore types and calculating surface porosity in tight sandstone reservoirs
Through improved YOLOv8 model and image processing technology, the problems of low accuracy and low efficiency of pore type identification and quantitative calculation in tight sandstone reservoirs are solved, and fast and accurate pore type identification and face rate calculation are achieved.
Patent Information
- Application Number
- CN202411310630.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2044-09-19
AI Technical Summary
The prior art pore type identification and quantitative calculation in tight sandstone reservoirs have problems such as cumbersome operation and low accuracy. In particular, the identification of under-microsheets and manual identification methods under-microsheets are limited by the experience and technology of interpreters, resulting in identification difficulties and large calculation errors.
The improved YOLOv8 model is used to identify the pore types of tight sandstone reservoirs, combine image processing technology to calculate the face rate, optimize the model through training samples, and use similarity perception attention mechanism, spatial and channel reconstruction convolution modules, multi-head detection head and other technical means to improve the accuracy and efficiency of identification and calculation.
The rapid and accurate identification of pore types in dense sandstone flake images and quantitative calculation of face rate are achieved, and the problems of cumbersome identification and large calculation errors in the prior art are solved, and the recognition efficiency and accuracy are improved.
Smart Images

Figure CN119295893B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning image processing technology, and in particular to a method, system, and device for identifying pore types and calculating surface surface ratios in tight sandstone reservoirs. Background Art
[0002] Tight sandstone reservoirs contain a variety of pore types, including primary pores, secondary pores, and microfractures. Primary pores are formed during sedimentation, while secondary pores result from later diagenetic processes, such as dissolution. Microfractures are often caused by tectonic activity and play a significant role in modifying reservoir properties. The pore sizes vary greatly, from nanometers to micrometers, and their morphologies are diverse, making the identification and recognition of pore types in tight sandstone reservoirs a significant challenge.
[0003] Current research on pore types in tight sandstone reservoirs primarily relies on thin-section microscopy, scanning electron microscopy, constant-rate mercury injection testing, nuclear magnetic resonance imaging, and CT scanning. While conventional methods offer some accuracy in identifying pore types in tight sandstone reservoirs, they are mechanically inflexible and inefficient, and are costly in terms of both human resources and financial resources. Therefore, deep learning is crucial for identifying pore types in tight sandstone reservoirs. Currently, this method primarily relies on thin-section microscopy, but this approach is limited by the experience of interpreters and the tedious and laborious manual selection process, making pore type identification in tight sandstone reservoirs challenging.
[0004] Currently, methods for quantitatively calculating pore types in tight sandstone reservoirs include porosimetry and manual identification using cast thin sections. However, porosimetry cannot distinguish between different pore types, requires a high testing environment, and is limited by sample integrity, resulting in significant experimental limitations. Manual identification using cast thin sections is limited by interpreter skill, subjective pore type identification, and inaccurate and inefficient surface area calculations. This leads to significant errors in experimental results, significantly hindering the quantitative calculation of pore types in tight sandstone reservoirs. Summary of the Invention
[0005] The purpose of this application is to provide a method, system and equipment for identifying pore types and calculating surface surface ratio in tight sandstone reservoirs, so as to solve the problems of complicated operation process and low accuracy in the existing pore type identification and quantitative calculation in tight sandstone reservoirs.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a method for identifying pore types and calculating surface porosity in a tight sandstone reservoir, comprising:
[0008] Acquire a target image; the target image is a thin section image of a dense sandstone casting;
[0009] The target image is input into a tight sandstone reservoir pore type identification model to output a pore type identification image; the pore type identification image is marked with pore contours, pore type prediction values, and corresponding pore type identification confidence prediction values; the tight sandstone reservoir pore type identification model is obtained by training an improved YOLOv8 model using training samples; the training samples include cast thin section image samples of tight sandstone, corresponding pore type sample values, and pore type identification confidence sample values;
[0010] Image processing technology is used to calculate the face ratio in the pore type identification image.
[0011] Optionally, the improved YOLOv8 model includes a backbone network, a feature fusion network, and a detection head network connected in sequence;
[0012] The backbone network is used to extract features from the target image to obtain a feature map;
[0013] The feature fusion network is used to perform feature fusion on the feature map to obtain a fused feature map;
[0014] The detection head network is used to predict the fused feature map to obtain a pore type recognition image.
[0015] Optionally, the backbone network includes a first convolutional layer, a second convolutional layer, a first feature fusion module, a third convolutional layer, a second feature fusion module, a fourth convolutional layer, a third feature fusion module, a fifth convolutional layer, a fourth feature fusion module, an SPPF layer, and a similarity-aware attention mechanism subnetwork connected in sequence;
[0016] Among them, the similarity-aware attention mechanism sub-network includes an input layer, an embedding layer, a Dropout layer, a multi-layer similarity-aware attention mechanism layer, a fully connected layer, a Softmax layer and an output layer connected in sequence.
[0017] Optionally, the first feature fusion module, the second feature fusion module, the third feature fusion module and the fourth feature fusion module are all embedded with a spatial and channel reconstruction convolution module.
[0018] Optionally, the feature fusion network includes a first feature fusion subnetwork, a second feature fusion subnetwork and a third feature fusion subnetwork;
[0019] The first feature fusion subnetwork includes a first splicing layer, a first upsampling layer, a second splicing layer, a second upsampling layer, a first multi-head detection head, a third splicing layer, a third upsampling layer, and a second multi-head detection head connected in sequence; wherein the first splicing layer is connected to the first feature fusion module, the second splicing layer is connected to the second feature fusion module, the third splicing layer is connected to the third feature fusion module, and the second multi-head detection head is connected to the similarity-aware attention mechanism subnetwork;
[0020] The second feature fusion sub-network includes a third multi-head detection head and a sixth convolutional layer; wherein the third multi-head detection head is connected to the first upsampling layer, and the sixth convolutional layer is connected to the first multi-head detection head;
[0021] The third feature fusion subnetwork includes a fourth multi-head detection head, a seventh convolutional layer, a fourth splicing layer, a fifth multi-head detection head, an eighth convolutional layer, a fifth splicing layer, a sixth multi-head detection head, a ninth convolutional layer, a sixth splicing layer and a seventh multi-head detection head connected in sequence; wherein, the fourth splicing layer is connected to the third multi-head detection head, the fifth splicing layer is connected to the first multi-head detection head, and the sixth splicing layer is respectively connected to the sixth convolutional layer and the second multi-head detection head.
[0022] Optionally, the detection head network includes a first target detection head, a second target detection head, a third target detection head and a fourth target detection head;
[0023] Among them, the first target detection head is connected to the fourth multi-head detection head, the second target detection head is connected to the fifth multi-head detection head, the third target detection head is connected to the sixth multi-head detection head, and the fourth target detection head is connected to the seventh multi-head detection head.
[0024] Optionally, the training process of the tight sandstone reservoir pore type identification model specifically includes:
[0025] Obtaining a casting thin section image sample of the dense sandstone, and marking the pore types in the casting thin section image sample of the dense sandstone to obtain a marked casting thin section image sample of the dense sandstone;
[0026] Convert the labeled thin-section image samples of the dense sandstone casting into different formats, and use the converted thin-section image samples of the dense sandstone casting into different formats as training samples;
[0027] Inputting the training sample into the improved YOLOv8 model and outputting a pore type identification image;
[0028] A loss function is constructed according to the pore type sample values and the pore type prediction values in the pore type identification image, and the network parameters of the improved YOLOv8 model are adjusted by the loss function to obtain the tight sandstone reservoir pore type identification model.
[0029] Optionally, the face ratio in the pore type identification image is calculated using image processing technology, specifically including:
[0030] Removing the pore type prediction value and the corresponding pore type recognition confidence value marked on the pore type recognition image to obtain a pore type recognition image marked with pore outlines;
[0031] Converting the pore type identification image marked with pore outlines into a grayscale image to obtain a pore type identification grayscale image marked with pore outlines;
[0032] The pore type identification grayscale image marked with pore outlines is filtered and denoised using Gaussian blur filtering technology to obtain a filtered pore type identification grayscale image marked with pore outlines;
[0033] Setting a preset threshold, and converting the filtered grayscale image for pore type identification marked with pore outlines into a black-and-white image for pore type identification marked with pore outlines based on the preset threshold;
[0034] The findContours function is used to detect the pore types marked with pore contours to identify the contours of each pore in the black and white image, and the contourArea function is used to calculate the area of each detected contour to determine the pore area calculation result;
[0035] The calculated results of different types of pore areas are added together to obtain the total area of different types of pores;
[0036] The total area of the pore type identification black and white image marked with the pore outline is calculated, and the surface ratio of different types of pores is determined based on the total area of the pore type identification black and white image marked with the pore outline and the total area of different types of pores.
[0037] In a second aspect, the present application provides a system for identifying pore types and calculating surface porosity in tight sandstone reservoirs, comprising:
[0038] A target image acquisition module is used to acquire a target image; the target image is a thin section image of a dense sandstone casting;
[0039] a pore type identification image determination module, configured to input the target image into a tight sandstone reservoir pore type identification model and output a pore type identification image; the pore type identification image is marked with pore contours, pore type prediction values, and corresponding pore type identification confidence prediction values; the tight sandstone reservoir pore type identification model is obtained by training an improved YOLOv8 model using training samples; the training samples include cast thin section image samples of tight sandstone, corresponding pore type sample values, and pore type identification confidence sample values;
[0040] The face ratio calculation module is used to calculate the face ratio in the pore type identification image using image processing technology.
[0041] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for identifying pore types and calculating surface surface ratio of tight sandstone reservoirs described in any one of the above.
[0042] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0043] This application provides a method, system, and device for identifying pore types and calculating surface porosity in tight sandstone reservoirs. This system trains an improved YOLOv8 segmentation model to generate a tight sandstone reservoir pore type identification model, enabling rapid and accurate identification of pore types in tight sandstone thin-section images. Furthermore, image processing technology is used to quantitatively calculate surface porosity, addressing the large errors and cumbersome workload associated with conventional thin-section surface porosity quantitative calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 This is an application environment diagram of a method for identifying pore types and calculating surface surface ratio in a tight sandstone reservoir in one embodiment of the present application;
[0046] Figure 2 A flow chart of a method for identifying pore types and calculating surface porosity in a tight sandstone reservoir provided in one embodiment of the present application;
[0047] Figure 3 A schematic diagram of a target image provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of a pore type identification image provided by another embodiment of the present application;
[0049] Figure 5 A schematic diagram of the functional modules of the improved YOLOv8 model provided in one embodiment of the present application;
[0050] Figure 6 Schematic diagram of the pore type identification image with pore outlines marked after removing the pore type prediction value and confidence level;
[0051] Figure 7 A schematic diagram of functional modules of a system for identifying pore types and calculating surface surface ratio in tight sandstone reservoirs provided in another embodiment of the present application;
[0052] Figure 8 A schematic diagram of the structure of a computer device provided in one embodiment of the present application.
[0053] Reference numerals:
[0054] Terminal 102, server 104, backbone network 1, feature fusion network 2, first feature fusion sub-network 21, second feature fusion sub-network 22, third feature fusion sub-network 23, detection head network 3, target image acquisition module 4, pore type recognition image determination module 5, face rate calculation module 6. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0056] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0057] Glossary:
[0058] Face ratio: the ratio of pore area to the total image area.
[0059] YOLOv8:
[0060] The YOLOv8 deep learning model is a SOTA (State-of-the-Art) model built on the foundation of the YOLO series of deep learning models. This application integrates the experience of previous versions and introduces innovative features and improvements to further improve its performance and flexibility, making it the first choice for many tasks such as object detection, image segmentation, and pose estimation.
[0061] The method for identifying pore types and calculating surface porosity of tight sandstone reservoirs provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store data that server 104 needs to process. The data storage system can be set up separately, integrated on server 104, or placed on a cloud or other server. Terminal 102 can send a target image to server 104. After server 104 receives the target image, server 104 inputs the target image into a tight sandstone reservoir pore type identification model and outputs a pore type identification image. The pore type identification image is marked with pore contours, pore type prediction values, and corresponding pore type identification confidence prediction values. The tight sandstone reservoir pore type identification model is obtained by training an improved YOLOv8 model using training samples. The training samples include cast thin section image samples of tight sandstone, corresponding pore type sample values, and pore type identification confidence sample values. Image processing technology is used to calculate the face ratio in the pore type identification image. Server 104 can provide feedback to terminal 102 on the obtained pore type prediction value and face ratio. In addition, in some embodiments, the method for identifying the pore type and calculating the surface area ratio of the tight sandstone reservoir can also be implemented independently by the server 104 or the terminal 102. For example, the terminal 102 can directly perform the pore type identification and surface area ratio calculation of the tight sandstone reservoir on the target image, or the server 104 can obtain the target image from the data storage system and perform the pore type identification and surface area ratio calculation of the tight sandstone reservoir on the target image.
[0062] Terminal 102 may include, but is not limited to, various desktop computers, laptops, smartphones, tablet computers, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Server 104 may be implemented as a standalone server or a server cluster consisting of multiple servers, or may be a cloud server.
[0063] In an exemplary embodiment, Figure 2As shown, a method for identifying pore types and calculating surface ratio of tight sandstone reservoirs is provided. The method is executed by a computer device, specifically a computer device such as a terminal or a server, or a terminal and a server. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used to illustrate the process, which includes the following steps S1 to S3.
[0064] Step S1, obtaining a target image; the target image is a thin section image of a dense sandstone casting, and the target image schematic diagram is as follows: Figure 3 shown.
[0065] Step S2: input the target image into the tight sandstone reservoir pore type identification model and output a pore type identification image; Figure 4 As shown, the pore type recognition image is marked with pore outlines, pore type prediction values and corresponding pore type recognition confidence prediction values. Figure 4 The contour corresponding to the red area in the figure is the pore contour; the tight sandstone reservoir pore type recognition model is obtained by training the improved YOLOv8 model using training samples; the training samples include cast thin section image samples of tight sandstone, corresponding pore type sample values, and pore type recognition confidence sample values.
[0066] Step S3: Calculate the face ratio in the pore type recognition image using image processing technology.
[0067] As an optional implementation, Figure 5 As shown, the improved YOLOv8 model includes a backbone network 1, a feature fusion network 2, and a detection head network 3 connected in sequence.
[0068] The backbone network 1 is used to extract features from the target image to obtain a feature map.
[0069] The feature fusion network 2 is used to perform feature fusion on the feature map to obtain a fused feature map.
[0070] The detection head network 3 is used to predict the fused feature map to obtain a pore type recognition image.
[0071] As an optional implementation, Figure 5As shown, the backbone network 1 includes a first convolutional layer, a second convolutional layer, a first feature fusion module, a third convolutional layer, a second feature fusion module, a fourth convolutional layer, a third feature fusion module, a fifth convolutional layer, a fourth feature fusion module, an SPPF layer, and a similarity-aware attention mechanism sub-network connected in sequence. The similarity-aware attention mechanism sub-network includes an input layer, an embedding layer, a Dropout layer, a multi-layer similarity-aware attention mechanism layer, a fully connected layer, a Softmax layer, and an output layer connected in sequence.
[0072] Specifically, a similarity-aware attention mechanism (SimAM) is added to the backbone network 1 of the deep learning model YOLOv8. SimAM is a lightweight self-attention mechanism. Its network structure is similar to the Transformer, but it uses linear layers instead of dot products to calculate attention weights. SimAM can help CNNs focus more on key areas in the image, thereby improving model performance. Advantages: ① Lightweight and efficient: The most significant feature of SimAM is its parameter-free design, which means that no additional parameters are introduced when calculating attention. This is different from many other attention mechanisms that typically require learned parameters to generate attention weights. Because SimAM uses a similarity-based calculation method, its calculation process can be accelerated through analytical solutions, avoiding complex numerical optimization processes and greatly improving computational efficiency. When processing long sequence data, traditional attention mechanisms will cause the computational workload to increase sharply as the sequence length increases. SimAM's lightweight design reduces this computational burden, making it more advantageous in practical applications of large-scale data. ② Global Information Consideration: SimAM considers information from all elements in the input sequence, rather than being limited to local regions. This allows the model to better capture global dependencies when processing data such as images. SimAM can dynamically adjust attention weights based on the characteristics of the input data. This adaptive performance enables it to excel across diverse tasks and datasets. In summary, SimAM offers advantages such as lightweight, high efficiency, global information consideration, parallel computing capabilities, long-term dependency modeling, improved model performance, strong ability to process long sequences, flexibility and versatility, and improved image quality.
[0073] As an optional implementation, Figure 5 As shown, the first feature fusion module, the second feature fusion module, the third feature fusion module and the fourth feature fusion module are all embedded with a spatial and channel reconstruction convolution (SCConv) module.
[0074] Specifically, the SCConv module is integrated into the improved YOLOv8 feature fusion module C2f. SCConv is designed to effectively limit feature redundancy, reducing model parameters and floating-point operations (FLOPs) while also enhancing feature representation capabilities. Advantages: SCConv provides a new perspective on the feature extraction process of convolutional neural networks (CNNs), proposing a method that more effectively utilizes spatial and channel redundancy, thereby reducing redundant features while improving model performance. Experimental results show that models embedded with the spatial and channel reconstruction convolutional module SCConv achieve better performance by significantly reducing complexity and computational cost, and reducing redundant features.
[0075] As an optional implementation, Figure 5 As shown, the feature fusion network 2 includes a first feature fusion sub-network 21, a second feature fusion sub-network 22 and a third feature fusion sub-network 23.
[0076] The first feature fusion subnetwork 21 includes a first splicing layer, a first upsampling layer, a second splicing layer, a second upsampling layer, a first multi-head detection head, a third splicing layer, a third upsampling layer and a second multi-head detection head connected in sequence; wherein, the first splicing layer is connected to the first feature fusion module, the second splicing layer is connected to the second feature fusion module, the third splicing layer is connected to the third feature fusion module, and the second multi-head detection head is connected to the similarity-aware attention mechanism subnetwork.
[0077] The second feature fusion sub-network 22 includes a third multi-head detection head and a sixth convolutional layer; wherein the third multi-head detection head is connected to the first upsampling layer, and the sixth convolutional layer is connected to the first multi-head detection head.
[0078] The third feature fusion subnetwork 23 includes a fourth multi-head detection head, a seventh convolutional layer, a fourth splicing layer, a fifth multi-head detection head, an eighth convolutional layer, a fifth splicing layer, a sixth multi-head detection head, a ninth convolutional layer, a sixth splicing layer and a seventh multi-head detection head connected in sequence; wherein, the fourth splicing layer is connected to the third multi-head detection head, the fifth splicing layer is connected to the first multi-head detection head, and the sixth splicing layer is respectively connected to the sixth convolutional layer and the second multi-head detection head.
[0079] As an optional implementation, Figure 5 As shown, the detection head network 3 includes a first target detection head, a second target detection head, a third target detection head and a fourth target detection head.
[0080] The first target detection head is connected to the fourth multi-head detection head, the second target detection head is connected to the fifth multi-head detection head, the third target detection head is connected to the sixth multi-head detection head, and the fourth target detection head is connected to the seventh multi-head detection head.
[0081] Specifically, the multi-head detection head CSP is integrated into the feature fusion network 2 of the deep learning model YOLOv8. The application of the multi-head detection head CSP structure in the field of target detection is mainly reflected in its ability to effectively improve the model's detection ability for targets of different scales. The multi-head detection head CSP structure achieves efficient fusion of low-level detail information and high-level semantic information by splitting and merging feature maps at different levels, which not only enhances the model's feature expression ability, but also improves the detection accuracy of small targets. In the deep learning model YOLOv8, by introducing the multi-head detection head CSP, targets of different scales can be specially processed, allowing the model to respond to scale changes more flexibly, thereby improving the model's generalization ability and detection performance. The added detection heads target the underlying features. These feature maps have higher resolution and are more sensitive to small targets.
[0082] In this way, the model can more effectively handle targets with large scale differences, especially performing well in detecting small targets. The deep learning model YOLOv8 uses a multi-head detection head CSP, adds a small target detection layer to the multi-head detection head CSP, and adaptively adjusts the network width and depth, further improving the detection effect of small targets. This improvement strategy is simple and effective. Although it increases the amount of computation, it significantly improves the detection performance of small targets. The application of the multi-head detection head CSP structure also involves the optimization of the loss function. For example, the use of Wasserstein distance loss reduces the model's sensitivity to small target position deviations and improves the performance of small target detection.
[0083] As an optional implementation, the training process of the tight sandstone reservoir pore type identification model specifically includes:
[0084] Step S21: Obtain a sample of a dense sandstone cast thin section image and annotate the pore types in the sample to obtain an annotated sample of the dense sandstone cast thin section image. Label the sample using the Labelme annotation tool to create polygon annotations for instance segmentation. The pore types are annotated as primary pores, secondary dissolution pores, and cracks, such as 0: secondary porosity, 1: primary porosity, and 2: cracks.
[0085] Step S22: Convert the labeled thin-section image samples of the dense sandstone casting to a new format and use them as training samples. After labeling, convert the .json file to a .txt file for use in training the deep learning model YOLOv8.
[0086] Step S23: input the training sample into the improved YOLOv8 model and output a pore type identification image.
[0087] In step S24, a loss function is constructed based on the pore type sample values and the pore type prediction values in the pore type identification image, and the network parameters of the improved YOLOv8 model are adjusted using the loss function to obtain the tight sandstone reservoir pore type identification model. The tight sandstone reservoir pore type identification model is capable of identifying and locating pores in the image.
[0088] As an optional implementation, image processing technology is used to calculate the face ratio in the pore type identification image, specifically including:
[0089] Step S31, remove the pore type prediction value and the corresponding pore type recognition confidence value marked on the pore type recognition image to obtain a pore type recognition image marked with pore contours, such as Figure 6 shown.
[0090] Step S32, converting the pore type identification image marked with pore outlines into a grayscale image to obtain a pore type identification grayscale image marked with pore outlines; grayscale images are easier to perform edge detection and outline extraction, thereby simplifying subsequent processing.
[0091] In step S33, Gaussian blur filtering technology is used to filter and denoise the grayscale image for pore type identification marked with pore outlines to obtain a filtered grayscale image for pore type identification marked with pore outlines; this helps to improve the accuracy of edge detection.
[0092] Step S34 , setting a preset threshold, and converting the filtered grayscale image for pore type identification marked with pore outlines into a black and white image for pore type identification marked with pore outlines based on the preset threshold, so as to clearly distinguish the object from the background.
[0093] In step S35 , the findContours function in OpenCV is used to detect the pore types marked with pore contours to identify the contours of each pore in the black and white image, and the contourArea function is used to calculate the area of each detected contour to determine the pore area calculation result.
[0094] Step S36: Add the calculated results of the pore areas of different types to obtain the total areas of the pores of different types.
[0095] Step S37, calculating the total area of the pore type identification black and white image marked with pore outlines, and determining the surface ratio of different types of pores based on the total area of the pore type identification black and white image marked with pore outlines and the total area of different types of pores.
[0096] Among them, contour detection and extraction uses the findContours function in OpenCV to detect pore contours in binary images and identify boundary lines belonging to the same object; select contours of interest as needed and filter them by geometric properties of contours such as area or perimeter; use the contourArea function to directly calculate the area of each contour, and add the areas of all relevant contours in the current image to obtain the total area of the irregular figure, and obtain the pore area calculation result; add the areas of different types of pores to obtain the total area of different types of pores; obtain the total area of the current entire image by multiplying the width and height (in pixels) of the current image, and then obtain the surface ratio of different types of pores by dividing the total area of different types of pores by the total area of the current image.
[0097] Beneficial effects of this application:
[0098] This application improves the YOLOv8 model and trains it to develop a tight sandstone reservoir pore type identification model, enabling rapid and accurate identification of pore types in tight sandstone thin-section images. Furthermore, image processing technology is used to quantitatively calculate the surface area fraction, resolving the large errors and cumbersome workload associated with conventional thin-section surface area fraction quantitative calculations. Specific improvements include the following:
[0099] 1) A similarity-aware attention mechanism is added to the backbone network to improve computational efficiency and thus achieve rapid identification of pore types in dense sandstone thin section images.
[0100] 2) Fusing the SCConv module into the feature fusion module C2f effectively limits feature redundancy and significantly reduces complexity and computational cost.
[0101] 3) Integrate the multi-head detection head CSP into the feature fusion network of the deep learning model YOLOv8, effectively improving the model's detection ability for targets of different scales and improving the model's recognition accuracy.
[0102] Based on the same inventive concept, embodiments of the present application also provide a system for identifying pore type and calculating surface porosity in tight sandstone reservoirs, for implementing the aforementioned method for identifying pore type and calculating surface porosity in tight sandstone reservoirs. The solution provided by this system is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the system for identifying pore type and calculating surface porosity in tight sandstone reservoirs provided below can be found in the limitations of the method for identifying pore type and calculating surface porosity in tight sandstone reservoirs described above, and will not be further elaborated here.
[0103] In an exemplary embodiment, Figure 7 As shown, a system for identifying pore types and calculating surface surface ratio in tight sandstone reservoirs is provided, comprising: a target image acquisition module 4, a pore type identification image determination module 5 and a surface surface ratio calculation module 6.
[0104] The target image acquisition module 4 is used to acquire a target image; the target image is a thin section image of a dense sandstone casting.
[0105] The pore type identification image determination module 5 is used to input the target image into the tight sandstone reservoir pore type identification model and output a pore type identification image; the pore type identification image is marked with pore contours, pore type prediction values and corresponding pore type identification confidence prediction values; the tight sandstone reservoir pore type identification model is obtained by training the improved YOLOv8 model using training samples; the training samples include cast thin section image samples of tight sandstone, corresponding pore type sample values and pore type identification confidence sample values.
[0106] The face ratio calculation module 6 is used to calculate the face ratio in the pore type identification image using image processing technology.
[0107] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store target image processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for identifying pore types and calculating surface ratios in tight sandstone reservoirs is implemented.
[0108] Those skilled in the art will understand that Figure 8 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.
[0109] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0110] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0111] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
[0112] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0113] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for identifying pore types and calculating surface porosity in tight sandstone reservoirs, characterized in that: The method for identifying pore types and calculating surface porosity in tight sandstone reservoirs includes: Acquire a target image; the target image is a thin section image of a dense sandstone casting; The target image is input into a tight sandstone reservoir pore type identification model to output a pore type identification image; the pore type identification image is marked with pore contours, pore type prediction values, and corresponding pore type identification confidence prediction values; the tight sandstone reservoir pore type identification model is obtained by training an improved YOLOv8 model using training samples; the training samples include cast thin section image samples of tight sandstone, corresponding pore type sample values, and pore type identification confidence sample values; calculating the face ratio in the pore type identification image using image processing technology; The improved YOLOv8 model includes a backbone network, a feature fusion network, and a detection head network connected in sequence; The backbone network is used to extract features from the target image to obtain a feature map; The feature fusion network is used to perform feature fusion on the feature map to obtain a fused feature map; The detection head network is used to predict the fused feature map to obtain a pore type recognition image; The backbone network includes a first convolutional layer, a second convolutional layer, a first feature fusion module, a third convolutional layer, a second feature fusion module, a fourth convolutional layer, a third feature fusion module, a fifth convolutional layer, a fourth feature fusion module, an SPPF layer, and a similarity-aware attention mechanism subnetwork connected in sequence; The similarity-aware attention mechanism subnetwork includes an input layer, an embedding layer, a Dropout layer, a multi-layer similarity-aware attention mechanism layer, a fully connected layer, a Softmax layer, and an output layer connected in sequence; The first feature fusion module, the second feature fusion module, the third feature fusion module and the fourth feature fusion module are all embedded with a spatial and channel reconstruction convolution module; The feature fusion network includes a first feature fusion subnetwork, a second feature fusion subnetwork and a third feature fusion subnetwork; The first feature fusion subnetwork includes a first splicing layer, a first upsampling layer, a second splicing layer, a second upsampling layer, a first multi-head detection head, a third splicing layer, a third upsampling layer, and a second multi-head detection head connected in sequence; wherein the first splicing layer is connected to the first feature fusion module, the second splicing layer is connected to the second feature fusion module, the third splicing layer is connected to the third feature fusion module, and the second multi-head detection head is connected to the similarity-aware attention mechanism subnetwork; The second feature fusion sub-network includes a third multi-head detection head and a sixth convolutional layer; wherein the third multi-head detection head is connected to the first upsampling layer, and the sixth convolutional layer is connected to the first multi-head detection head; The third feature fusion subnetwork includes a fourth multi-head detection head, a seventh convolutional layer, a fourth splicing layer, a fifth multi-head detection head, an eighth convolutional layer, a fifth splicing layer, a sixth multi-head detection head, a ninth convolutional layer, a sixth splicing layer, and a seventh multi-head detection head connected in sequence; wherein the fourth splicing layer is connected to the third multi-head detection head, the fifth splicing layer is connected to the first multi-head detection head, and the sixth splicing layer is connected to the sixth convolutional layer and the second multi-head detection head respectively; The face ratio in the pore type identification image is calculated using image processing technology, specifically including: Removing the pore type prediction value and the corresponding pore type recognition confidence value marked on the pore type recognition image to obtain a pore type recognition image marked with pore outlines; Converting the pore type identification image marked with pore outlines into a grayscale image to obtain a pore type identification grayscale image marked with pore outlines; The pore type identification grayscale image marked with pore outlines is filtered and denoised using Gaussian blur filtering technology to obtain a filtered pore type identification grayscale image marked with pore outlines; Setting a preset threshold, and converting the filtered grayscale image for pore type identification marked with pore outlines into a black-and-white image for pore type identification marked with pore outlines based on the preset threshold; The findContours function is used to detect the pore types marked with pore contours to identify the contours of each pore in the black and white image, and the contourArea function is used to calculate the area of each detected contour to determine the pore area calculation result; The calculated results of different types of pore areas are added together to obtain the total area of different types of pores; The total area of the black and white image is identified by the pore type marked with the pore outline, and the face ratio of the different types of pores is determined based on the total area of the black and white image and the total areas of the different types of pores.
2. The method for identifying pore types and calculating surface porosity in tight sandstone reservoirs according to claim 1, characterized in that: The detection head network includes a first target detection head, a second target detection head, a third target detection head and a fourth target detection head; Among them, the first target detection head is connected to the fourth multi-head detection head, the second target detection head is connected to the fifth multi-head detection head, the third target detection head is connected to the sixth multi-head detection head, and the fourth target detection head is connected to the seventh multi-head detection head.
3. The method for identifying pore types and calculating surface porosity in tight sandstone reservoirs according to claim 1, characterized in that: The training process of the tight sandstone reservoir pore type identification model specifically includes: Obtaining a casting thin section image sample of the dense sandstone, and marking the pore types in the casting thin section image sample of the dense sandstone to obtain a marked casting thin section image sample of the dense sandstone; Convert the labeled thin-section image samples of the dense sandstone casting into different formats, and use the converted thin-section image samples of the dense sandstone casting into different formats as training samples; Inputting the training sample into the improved YOLOv8 model and outputting a pore type identification image; A loss function is constructed according to the pore type sample values and the pore type prediction values in the pore type identification image, and the network parameters of the improved YOLOv8 model are adjusted by the loss function to obtain the tight sandstone reservoir pore type identification model.
4. A system for identifying pore types and calculating surface porosity in tight sandstone reservoirs, characterized in that: The tight sandstone reservoir pore type identification and surface surface ratio calculation system includes: A target image acquisition module is used to acquire a target image; the target image is a thin section image of a dense sandstone casting; a pore type identification image determination module, configured to input the target image into a tight sandstone reservoir pore type identification model and output a pore type identification image; the pore type identification image is marked with pore contours, pore type prediction values, and corresponding pore type identification confidence prediction values; the tight sandstone reservoir pore type identification model is obtained by training an improved YOLOv8 model using training samples; the training samples include cast thin section image samples of tight sandstone, corresponding pore type sample values, and pore type identification confidence sample values; a face rate calculation module, configured to calculate the face rate in the pore type identification image using image processing technology; The improved YOLOv8 model includes a backbone network, a feature fusion network, and a detection head network connected in sequence; The backbone network is used to extract features from the target image to obtain a feature map; The feature fusion network is used to perform feature fusion on the feature map to obtain a fused feature map; The detection head network is used to predict the fused feature map to obtain a pore type recognition image; The backbone network includes a first convolutional layer, a second convolutional layer, a first feature fusion module, a third convolutional layer, a second feature fusion module, a fourth convolutional layer, a third feature fusion module, a fifth convolutional layer, a fourth feature fusion module, an SPPF layer, and a similarity-aware attention mechanism subnetwork connected in sequence; The similarity-aware attention mechanism subnetwork includes an input layer, an embedding layer, a Dropout layer, a multi-layer similarity-aware attention mechanism layer, a fully connected layer, a Softmax layer, and an output layer connected in sequence; The first feature fusion module, the second feature fusion module, the third feature fusion module and the fourth feature fusion module are all embedded with a spatial and channel reconstruction convolution module; The feature fusion network includes a first feature fusion subnetwork, a second feature fusion subnetwork and a third feature fusion subnetwork; The first feature fusion subnetwork includes a first splicing layer, a first upsampling layer, a second splicing layer, a second upsampling layer, a first multi-head detection head, a third splicing layer, a third upsampling layer, and a second multi-head detection head connected in sequence; wherein the first splicing layer is connected to the first feature fusion module, the second splicing layer is connected to the second feature fusion module, the third splicing layer is connected to the third feature fusion module, and the second multi-head detection head is connected to the similarity-aware attention mechanism subnetwork; The second feature fusion sub-network includes a third multi-head detection head and a sixth convolutional layer; wherein the third multi-head detection head is connected to the first upsampling layer, and the sixth convolutional layer is connected to the first multi-head detection head; The third feature fusion subnetwork includes a fourth multi-head detection head, a seventh convolutional layer, a fourth splicing layer, a fifth multi-head detection head, an eighth convolutional layer, a fifth splicing layer, a sixth multi-head detection head, a ninth convolutional layer, a sixth splicing layer, and a seventh multi-head detection head connected in sequence; wherein the fourth splicing layer is connected to the third multi-head detection head, the fifth splicing layer is connected to the first multi-head detection head, and the sixth splicing layer is connected to the sixth convolutional layer and the second multi-head detection head respectively; The face ratio in the pore type identification image is calculated using image processing technology, specifically including: Removing the pore type prediction value and the corresponding pore type recognition confidence value marked on the pore type recognition image to obtain a pore type recognition image marked with pore outlines; Converting the pore type identification image marked with pore outlines into a grayscale image to obtain a pore type identification grayscale image marked with pore outlines; The pore type identification grayscale image marked with pore outlines is filtered and denoised using Gaussian blur filtering technology to obtain a filtered pore type identification grayscale image marked with pore outlines; Setting a preset threshold, and converting the filtered grayscale image for pore type identification marked with pore outlines into a black-and-white image for pore type identification marked with pore outlines based on the preset threshold; The findContours function is used to detect the pore types marked with pore contours to identify the contours of each pore in the black and white image, and the contourArea function is used to calculate the area of each detected contour to determine the pore area calculation result; The calculated results of different types of pore areas are added together to obtain the total area of different types of pores; The total area of the black and white image is identified by the pore type marked with the pore outline, and the face ratio of the different types of pores is determined based on the total area of the black and white image and the total areas of the different types of pores.
5. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for identifying pore types and calculating surface surface ratio of tight sandstone reservoirs according to any one of claims 1 to 4.
Citation Information
Patent Citations
Gesture recognition method based on improved YOLOv5 network
CN118116033A
Intelligent detection method for openness of fresh flowers in scenting of jasmine tea
CN118587530A