Quantitative characterization method and system for different types of pores in shale based on scanning electron microscope images
By combining large-area field-of-view mosaic images with mineral scanning images, and utilizing edge response maps and mineral composition information, accurate identification and classification of shale pores were achieved. This solved the problem of automated identification and quantitative analysis of pore types under large field-of-view conditions, and improved the accuracy and efficiency of the analysis.
Patent Information
- Application Number
- CN202611133579.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-08-25
AI Technical Summary
Existing technologies struggle to accurately identify and classify shale pore types in large-area scanning electron microscope images, especially when grayscale characteristics are similar, leading to problems of missed or misidentified pores. Furthermore, there is a lack of automated quantitative analysis methods.
By acquiring large-area field-of-view stitched images and combining them with mineral scanning images for spatial registration, and utilizing edge response maps and mineral composition information, a variety of digital image processing techniques are employed to enhance and classify pore boundaries, including preprocessing, edge detection, spatial relationship analysis, and machine learning segmentation.
It enables accurate identification and classification of shale pores, improves the integrity and reliability of quantitative pore analysis, and solves the problem of automated identification and quantitative characterization of pore types under large field of view.
Smart Images

Figure CN122636629A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for quantitative characterization of different types of pores in shale based on scanning electron microscope images, belonging to the field of shale pore type identification technology. Background Technology
[0002] Pore structure is a crucial component characterizing the microstructure of rocks, minerals, and porous materials. Its type, morphology, size distribution, and spatial connectivity significantly influence the physical and mechanical properties, flow characteristics, and reservoir performance of these materials. Accurately obtaining quantitative information about pore structure is fundamental to conducting relevant research and evaluation in fields such as energy geology, materials science, and engineering applications.
[0003] Currently, scanning electron microscopy (SEM) is widely used for the observation and analysis of pore structures due to its high spatial resolution. Two-dimensional images acquired through SEM can clearly reflect the morphological characteristics of micron- to nanometer-scale pores and cracks. However, due to the limited field of view of a single SEM image, it is difficult to simultaneously capture both the microscopic details and macroscopic distribution characteristics of pores, often resulting in insufficient representativeness of the analysis results from a single field of view. To address this issue, researchers have gradually adopted large-area SEM image stitching techniques. By stitching together multiple adjacent SEM images, a stitched image covering a larger area of the sample is constructed, thereby achieving a holistic characterization of the pore structure. However, as the field of view expands, problems often arise within the image, such as uneven grayscale, significant contrast variations, blurred boundaries between pores and the matrix, and complex pore types, posing significant challenges to subsequent pore identification and quantitative analysis.
[0004] Existing pore extraction methods are mostly based on single-scale threshold segmentation, manual judgment, or simple image morphology processing. These methods are effective for images with relatively uniform grayscale distributions and clear pore boundaries, but when dealing with large-area stitched images, they are prone to pore omissions, misidentifications, or difficulty in distinguishing different pore types. This is especially true when pore types are finely segmented and their grayscale characteristics are similar, further reducing the extraction effectiveness and failing to meet the requirements for accurate identification and classification. Using highly manual methods for fine processing suffers from high subjectivity, poor repeatability, and low efficiency, making it difficult to meet the needs for refined and quantitative analysis of pore structures.
[0005] Therefore, there is an urgent need to propose a quantitative pore extraction method suitable for large-area field-of-view stitched images. This method should be able to combine digital image processing technology to achieve automatic identification and accurate extraction of pore structures. While ensuring the accuracy of pore boundary identification, it should also improve the integrity and reliability of quantitative pore analysis, so as to overcome the shortcomings of existing technologies in quantitative characterization of large field-of-view and multi-type pores. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method and system for quantitative characterization of different types of shale pores based on scanning electron microscopy (SEM) images. This addresses the following problems in existing technologies: difficulty in performing genetic and occurrence-based fine classification of shale pore and fracture systems based on large-area SEM images; difficulty in automatically subdividing pores and fractures using the spatial contact relationship between pores and surrounding minerals and organic matter; difficulty in distinguishing pore types with similar grayscale and morphology but different genesis when mineral surface scanning data is lacking; and difficulty in achieving stable extraction, geometric measurement, and quantitative classification output of different types of pores and fractures within a unified workflow.
[0007] The technical solution of the present invention is as follows: The first aspect of this invention proposes a method for quantitative characterization of different types of pores in shale based on scanning electron microscopy images, comprising: Step 1: Acquire scanning electron microscope (SEM) images, large-area field-of-view mosaic images, and mineral scanning images of the shale sample to be analyzed; and preprocess the large-area field-of-view mosaic images. Step 2: Obtain the edge response map of the large-area view stitched image, perform pore-matrix boundary enhancement and initial pore identification on the edge response map, and obtain the comprehensive boundary enhancement result and the initial binary segmentation result of the target pore region; Step 3: Determine the usability of the mineral scanning image. If the mineral scanning image meets the usability requirements, spatially register the preprocessed large-area view stitched image with the mineral scanning image, and analyze the spatial relationship between the boundary and neighborhood of each target pore region and the mineral components in the initial binary segmentation result. Based on the spatial relationship, classify and extract the target pores. Otherwise, the initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected. Output the image results or correction results of different types of pores extracted by classification.
[0008] According to a preferred embodiment of the present invention, the specific implementation process of step 1 includes: The shale sample to be analyzed is prepared by one or more of the following methods: cutting, mounting, mechanical polishing, argon ion polishing, and conductive coating, so that the surface of the shale sample meets the requirements for scanning electron microscopy (SEM) imaging. The prepared shale sample is then placed under a scanning electron microscope for observation and imaging to obtain the SEM image of the shale sample. In the scanning electron microscope (SEM) image, select the region of interest, which is the area on the surface of the shale sample to be analyzed that represents the porosity development characteristics of the target layer or target lithofacies. This includes one or more of the following: organic matter enrichment bands, clay mineral enrichment areas, rigid mineral grain enrichment areas, bedding development areas, microcrack development areas, and transition zones. At the same time, avoid polishing scratches, chipping, contamination, edge breakage, and areas with severe charging. Among them, the particle boundary drift threshold, gray standard deviation multiple threshold, and gray difference multiple threshold are preset, with values ranging from 5 to 20 pixels, 1.5 to 3.0, and 0.2 to 0.6, respectively. Areas with severe charging are indicated by the appearance of continuous bright spots, bright bands, or dark bands in a local area and the pixel area accounting for 5% to 30% of the local window area, or the drift of the same particle boundary position between adjacent repeated scan frames is greater than the particle boundary drift threshold, or the local gray standard deviation is higher than the gray standard deviation multiple threshold of the gray standard deviation of the adjacent normal area and is accompanied by boundary distortion, or the gray difference between pores and matrix in a local area is lower than the gray difference multiple threshold of the average gray difference between pores and matrix in the whole image. Backscattered electron imaging was performed on the region of interest, and the surface of the shale sample to be analyzed was scanned in a regular grid, that is, the region of interest was divided into M×N adjacent fields of view. Multiple adjacent images were acquired one by one in a fixed row and column order, and 5% to 30% overlap was retained between adjacent fields of view. The multiple adjacent images obtained by scanning were stitched together to form a large-area field-of-view stitched image. After sample preparation, the shale samples to be analyzed are subjected to surface scanning, matrix scanning or point-by-point elemental analysis to obtain the elemental composition information at each location. Combined with the grayscale characteristics, mineral morphology characteristics and element combination discrimination rules of backscattered images, i.e., large-area field-of-view mosaic images, mineral scanning images of the corresponding areas are established with respect to the scanning electron microscope images. Preprocessing of large-area visual field stitched images includes one or more operations such as image denoising, grayscale normalization and brightness correction, local contrast enhancement, background correction and stitching boundary smoothing, scale unification and pixel calibration.
[0009] Further preferably, establishing a mineral scanning image of the region corresponding to the scanning electron microscope image includes: Mineral scan images include elemental distribution maps, mineral classification images, and mineral composition images; The elemental surface distribution map was obtained by using a scanning electron microscope and an energy dispersive spectrometer. This included: simultaneously collecting X-ray counts of features while traversing the region of interest by pixel or scan step size, and generating two-dimensional intensity maps or content maps of one or more elements among C, O, Si, Al, K, Na, Ca, Mg, Fe, S, and Ti after energy dispersive spectrometry, background subtraction, and peak overlap correction. Normalization and noise suppression were then performed to obtain the elemental surface distribution map. Pixels or superpixels in the elemental distribution map are assigned to corresponding mineral components, including: regions with high C and varying enrichment of Si, Al, Ca, Fe, and S are classified as organic matter; regions with high Si, presence of O, and low levels of Al, K, Na, Ca, Mg, and Fe are classified as quartz; regions with high Si and Al and enrichment of K, Na, or Ca are classified as feldspar, with K enrichment classified as potassium feldspar and Na or Ca enrichment classified as plagioclase; regions with simultaneous enrichment of Al and Si, and at least one of K, Mg, or Fe, exhibiting platy or flocculent morphology, are classified as clay minerals; regions with co-enrichment of Fe and S are classified as pyrite; regions with high Ca, presence of C and O, low Mg, and low levels of Si and Al are classified as calcite; regions with co-enrichment of Ca and Mg and presence of C and O are classified as dolomite; T Regions with high concentrations of element i are classified as ilmenite or rutile-type titanium-bearing minerals; regions co-enriched with Ba and S are classified as barite; regions co-enriched with Ca and P are classified as apatite; regions that do not meet the above rules or contain multiple mineral mixtures are marked as undetermined components or mixed components; wherein, a high threshold for the first element, a high multiple threshold for the second element, a low threshold for the first element, and a low multiple threshold for the second element are preset, with values ranging from 0.55 to 0.85, 0.5 to 2.0, 0.15 to 0.45, and 0.5 to 1.5 respectively; high element means that the normalized element intensity is greater than the high threshold for the first element, or greater than the product of the current field mean of the element plus the high multiple threshold for the second element and the standard deviation; low element means that the normalized intensity is less than the low threshold for the first element, or less than the product of the current field mean of the element minus the low multiple threshold for the second element and the standard deviation; Each pixel or superpixel is assigned to a corresponding mineral component and then labeled accordingly to obtain a mineral classification image. The mineral classification image is corrected using the label-controlled watershed algorithm to obtain a mineral composition image.
[0010] According to a preferred embodiment of the present invention, step 2 includes the following specific implementation process: By employing one or more of Gaussian scale space, wavelet decomposition scale space, or image pyramid methods, smoothing filters or multi-resolution decomposition with different scale parameters are applied to the preprocessed large-area view stitched image to obtain images with multiple scale layers. Edge response maps are obtained by using edge detection operators on images at multiple scales to extract regions with significant gray-level changes, i.e., regions whose gradient magnitude is greater than 1.0 to 3.0 times the average gradient magnitude of the entire image, or regions greater than the 60% to 95th percentile of the gradient magnitude distribution; where the edge detection operator is the Canny operator, Sobel operator, Laplacian operator, or LoG operator. Constraints and filters are applied to the edge response map, including: edge pixels whose edge response values reach 0.2 to 0.6 times the normalized edge response value, or 1.0 to 3.0 times the mean edge response value, or are at the 60% to 95th percentile of the edge response distribution, or edge chains formed by connecting edge pixels are selected as candidate edges. Local grayscale mean and gradient direction are obtained on both sides of the candidate edge within a width of 1 to 5 pixels. Only candidate edges that are adjacent to the low grayscale aperture candidate area on one side and the matrix area on the other side are retained. Specifically, this includes: 60% to 90% of the pixels in the 1 to 5 pixel buffer zone along the normal direction of the candidate edge belong to the low grayscale aperture candidate area, and 50% to 90% of the pixels in the 1 to 5 pixel buffer zone along the opposite normal direction do not belong to the low grayscale aperture candidate area. Candidate edges with an average grayscale value 5 to 60 8-bit grayscale levels or 0.05 to 0.30 normalized grayscale values higher than the average grayscale value of the low grayscale aperture candidate area are retained. Among them, the low grayscale aperture candidate area refers to the area where the grayscale value in the local window is lower than 0.5 to 1.5 times the standard deviation of the window mean, or the area lower than the 5% to 40% quantile of the grayscale distribution of the whole image. The connectivity, continuity and closure trend of the retained candidate edges are analyzed. Candidate edges with an edge chain pixel count or edge chain polyline arc length of not less than 3 to 30 pixels, smooth directional changes and forming a local closed contour with the low grayscale aperture candidate area are retained. The connectivity, continuity, and closure trend of the retained candidate edges are analyzed, and an edge chain length threshold is preset, the value of which ranges from 3 to 30 pixels; candidate edges that are retained with an edge chain pixel count or edge chain polygonal arc length not less than the edge chain length threshold, smooth directional changes, and form a local closed contour with the low grayscale aperture candidate area; A short edge length threshold is preset, and the value of the short edge length threshold is in the range of 3 to 10 pixels; candidate edges with a length less than the short edge length threshold and that do not participate in the closure of any low grayscale pore candidate area outer contour, particle internal texture edges, and candidate edges that lack spatial correspondence with the low grayscale pore candidate area are eliminated; After obtaining the comprehensive boundary enhancement results, the candidate aperture regions of the preprocessed large-area view stitched image are identified, including: performing threshold segmentation, region growing, edge-guided segmentation, machine learning segmentation, or deep learning segmentation model on the preprocessed large-area view stitched image to obtain the initial binary segmentation results of the target aperture region; wherein, the initial binary segmentation results of the target aperture region include one or more of the following: aperture region location, boundary contour, connected region information, and target confidence.
[0011] Further optimization involves analyzing the connectivity, continuity, and closure tendency of the retained candidate edges; including: Connectivity analysis uses 8-neighbor connectivity tracing, which treats adjacent edge pixels in the horizontal, vertical, and diagonal directions as connected and assigns the same edge chain number to connected edge pixels. Continuity analysis involves calculating the distance between the endpoints of candidate edges and the angle between their directions. Pre-set thresholds for endpoint distance and tangent direction angle, with values ranging from 2 to 15 pixels and 15° to 60°, respectively. When the distance between two endpoints is less than the endpoint distance threshold, and the angle between the tangent directions at the endpoints is also less than the tangent direction angle threshold, the two candidate edges are considered continuous. Here, a segment endpoint represents a pixel in an edge chain that has only one 8-neighbor connection. Closure trend analysis calculates the overlap rate between candidate edges and the outer contour of low-grayscale aperture candidate areas, the closure distance between segment endpoints, and the enclosed area of edge chains. The outer contour of the low-grayscale aperture candidate area represents the outermost boundary contour extracted from each considered connected region after connectivity analysis. The overlap rate is the proportion of edge pixels within a 1-5 pixel range from the outer contour of the low-grayscale aperture candidate area to the total number of pixels in the edge chain. The closure distance is the shortest distance between adjacent segment endpoints or between a segment endpoint and the break in the outer contour of the low-grayscale aperture candidate area. The enclosed area of the edge chain represents the area enclosed by the closed contour formed by the edge chain. Further preferred, the target confidence level is C0 = a1P + a2B + a3G + a4M; where P represents the porosity probability, B represents the boundary closure degree, G represents the low grayscale consistency, M represents the morphological rationality, and a1 to a4 represent the weights and sum to 1. Wherein, the porosity probability P is the probability that a pixel output by threshold segmentation, machine learning model, or deep learning model belongs to a porosity; the boundary closure B is the proportion of the contour length supported by the comprehensive boundary enhancement result in the porosity contour to the total contour length, or 1 minus the ratio of the length of the unclosed gap to the total length of the porosity contour; and the low grayscale consistency G is the proportion of the pixel area satisfying the low grayscale threshold in the porosity region to the porosity area, where the low grayscale threshold is the 5% to 40% quantile of the grayscale distribution of the entire image, or the local window grayscale mean minus 0.5 to 2.0. The local grayscale standard deviation is multiplied by 1; the morphological rationality M is the degree to which the target morphological parameters fall within the labeled sample or the preset threshold range. The first aspect ratio threshold, roundness threshold, and skeleton thickness ratio threshold are preset, and their values range from 3 to 5, 0.2 to 0.6, and 5 to 10, respectively. The morphological threshold range for hole-type targets is that the aspect ratio is less than the first aspect ratio threshold, the roundness is not less than the roundness threshold, and the ratio of skeleton length to local thickness is less than the skeleton thickness ratio threshold. The morphological threshold range for slit-type targets is that the aspect ratio is not less than the first aspect ratio threshold, or the ratio of skeleton length to local thickness is not less than the skeleton thickness ratio threshold.
[0012] According to a preferred embodiment of the present invention, the availability of the mineral scanning image is determined. If the mineral scanning image meets the availability criteria, spatial registration is performed between the preprocessed large-area view mosaic image and the mineral scanning image, and the spatial relationship between the boundaries and neighborhoods of each target pore region in the initial binary segmentation result and the mineral components is analyzed; including: The usability of mineral scan images is determined by one or more of the following conditions: (1) The mineral scanning image and the preprocessed large-area field-of-view mosaic image have an overlap or correspondence in the field of view, that is, they contain the same mineral grain boundaries, the same bedding structure, the same cracks or the same artificial control points, and the overlapping area is not less than 50% to 100% of the target analysis area of the preprocessed large-area field-of-view mosaic image; (2) The mineral scan image has clear mineral boundaries or mineral classification information, that is, the main mineral categories can be distinguished. The mineral boundary deviation threshold, the effective classification area ratio threshold, and the main mineral area ratio threshold are preset, and the values of the three are 1 to 20 pixels, 70% to 95%, and 5% to 10%, respectively. The average deviation between the mineral boundary and the corresponding mineral boundary in the backscattered image does not exceed the mineral boundary deviation threshold, and the effective classification area ratio of the main mineral category is not lower than the effective classification area ratio threshold. Among them, the main mineral categories include one or more of organic matter, clay minerals, quartz, feldspar, pyrite, calcite, and dolomite, or mineral categories whose area ratio in the target analysis area is not lower than the main mineral area ratio threshold. (3) The resolution, pixel scale, or imaging quality of the mineral scan image meets the requirements of registration analysis; the pixel size multiple threshold, the minimum mineral tag pixel number threshold, the dominant mineral area ratio threshold, the classification confidence threshold, and the dominant mineral area ratio difference threshold are preset, with the values ranging from 1 to 20, 2 to 5 pixels, 50% to 90%, 0.5 to 0.9, and 5% to 20%, respectively; the pixel size of the mineral scan image is not greater than the product of the pixel size of the preprocessed large-area field-of-view stitched image and the pixel size multiple threshold, or after resampling, the minimum target pore boundary can be minimized. Neighborhood mineral components remain identifiable, meaning that within a neighborhood buffer zone extending 2–20 pixels outward from the minimum target pore or 5%–30% of the equivalent circle diameter, the number of mineral tag pixels is not less than the minimum mineral tag pixel count threshold, and the area proportion of the dominant mineral category is not less than the dominant mineral area proportion threshold or the classification confidence is not less than the classification confidence threshold; wherein, the dominant mineral category includes the mineral category with the highest area proportion within the neighborhood buffer zone and whose area proportion is higher than the dominant mineral area proportion difference threshold of other mineral categories, or the mineral category whose area proportion reaches the dominant mineral area proportion threshold; (4) Pre-set the threshold for the proportion of missing pixel area, the threshold for misalignment error and the threshold for the proportion of noise pollution area, with the values of the three being 1% to 20%, 1 to 20 pixels and 5% to 30%, respectively; the proportion of missing pixel area in the mineral scan image is less than the threshold for the proportion of missing pixel area, the misalignment error is less than the threshold for the misalignment error, and the proportion of noise pollution area is less than the threshold for the proportion of noise pollution area. If the scanned images meet the availability requirements, the mineral scanned images are preprocessed, including resampling, denoising, and label smoothing. One or more of the following methods—feature point registration, boundary contour registration, affine transformation, perspective transformation, and non-rigid correction—are used to spatially register the preprocessed large-area field-of-view stitched image and the mineral scan image. Simultaneously, the mineral grain boundaries, light-dark phase interfaces, feature textures, grain combination structures, or manually selected control points in the preprocessed large-area field-of-view stitched image and the mineral scan image are used as registration references to calculate the spatial registration error. This error is controlled within a preset threshold, or does not exceed 50% of the number of pixels corresponding to the minimum target pore recognition scale. After registration, the correspondence between the preprocessed large-area view mosaic image and the mineral scan image in a unified coordinate system is obtained; For each pore target in the initial binary segmentation result of the target pore region, the spatial relationship between the boundary and the neighborhood and the mineral components is analyzed. The spatial relationship includes one or more of the following: boundary contact relationship, neighborhood component proportion relationship, single component encirclement relationship, boundary relationship between two or more types of components, and structural direction relationship. The boundary contact relationships include the total length L of the pore boundary, the contact length Lo between the pore boundary and organic matter, the contact length Lc between the pore boundary and clay minerals, the contact length Lb between the pore boundary and rigid minerals, and the proportions of each contact length to the total boundary length, i.e., Ro=Lo / L, Rc=Lc / L, Rb=Lb / L; where Ro represents the contact ratio between the pore boundary and organic matter, Rc represents the contact ratio between the pore boundary and clay minerals, and Rb represents the contact ratio between the pore boundary and rigid minerals; rigid minerals include one or more of quartz, feldspar, pyrite, calcite, and dolomite. The proportion of neighboring components, including the area proportion of organic matter, clay minerals, rigid minerals and other mineral components in the pore neighborhood buffer zone; The single-component enclosure relationship includes whether a certain mineral component's area ratio within the pore neighborhood buffer reaches a preset area ratio threshold, or whether the contact ratio between the pore boundary and a certain mineral component reaches a preset contact ratio threshold; wherein, the preset area ratio threshold and the preset contact ratio threshold both range from 50% to 90%; The boundary relationship between two or more components includes whether the pore is located in the boundary zone where the contact ratio of at least two mineral components is not less than a preset component contact ratio threshold, and the distance from the centroid of the pore to the boundary line of the two mineral components does not exceed a preset boundary distance threshold; wherein, the preset component contact ratio threshold ranges from 10% to 30%, and the preset boundary distance threshold ranges from 2 to 20 pixels.
[0013] A further preferred value is the classification confidence C = w1Cr + w2Cb + w3Cm + w4Cp; where Cr is the rule matching degree, Cb is the boundary consistency score, Cm is the morphological consistency score, Cp is the model output probability, and w1 to w4 are the weights and their sum is 1. The rule matching degree is calculated based on the proportion of targets that satisfy the classification rules, i.e., Cr = m1 / n1, where n1 represents the number of classification discrimination conditions possessed by the target category, and m1 represents the number of classification discrimination conditions satisfied. A boundary proximity distance threshold is preset, with a value range of 1 to 5 pixels. The boundary consistency score is the proportion of the length of the pore contour that coincides with the comprehensive boundary enhancement result or is no more than the boundary proximity distance threshold from the comprehensive boundary enhancement result to the total length of the pore contour, with a value range of 0 to 1. The morphological consistency score is calculated based on the distance between the target's morphological parameters and the mean of the corresponding category samples, i.e., the target's area, aspect ratio, and circle. After normalization of the degree, skeleton length, local thickness, and directional parameters, a morphological feature vector X is constructed. The mean of the samples of the corresponding category is used to construct a reference vector μ. The degree of morphological deviation is characterized by Euclidean distance, Mahalanobis distance, or weighted distance d(X,μ). Then, it is converted into a score in the range of 0 to 1 by Cm=exp[-d(X,μ)] or Cm=1 / [1+d(X,μ)]. The output probability of the classification model represents the pore classification probability obtained by inputting the pore local image patch, the initial binary segmentation result, the pore edge response map, the local gray-level statistical features, morphological parameters, texture features, neighborhood gray-level gradient features, and / or mineral scan image into the classification model.
[0014] According to a preferred embodiment of the present invention, target pores are classified and extracted based on spatial relationships; including: Based on the aspect ratio of the target pore morphology parameters, pores, i.e., target pores, are classified into pore-type targets and fracture-type targets. A first aspect ratio threshold, a roundness threshold, and a skeleton thickness ratio threshold are preset, with values ranging from 3 to 5, 0.2 to 0.6, and 5 to 10, respectively. These values are determined according to the image resolution of the shale sample to be analyzed, the development characteristics of the target pores and fractures, or labeled samples, and remain unchanged during the classification process of the same batch of images. Targets with an aspect ratio less than the first aspect ratio threshold, a roundness not less than the roundness threshold, and a skeleton length to local average thickness ratio less than the skeleton thickness ratio threshold are identified as pore-type targets. Targets with an aspect ratio not less than the first aspect ratio threshold, or a skeleton length to local average thickness ratio not less than the skeleton thickness ratio threshold, and which extend continuously in a certain direction, are identified as fracture-type targets. Among pore-type targets, at least two or more categories should be classified as organic-clay composite pores, organic matter rift pores, intergranular pores, and intragranular pores; among crack-type targets, at least one or two categories should be classified as organic cracks and inorganic cracks; the specific classification rules are as follows: Organic-clay composite pore: A first component ratio threshold is preset, and the value of the first component ratio threshold ranges from 10% to 30%; if the target pore is located near the contact zone between organic matter and clay minerals, and the boundary of the target pore is in contact with both organic matter and clay minerals, or the proportion of organic matter and clay minerals in the adjacent buffer zone is not lower than the first component ratio threshold, or the contact ratio of the two is not lower than the first component ratio threshold, then it is determined to be an organic-clay composite pore. Organic matter pyrolysis pores: A second component ratio threshold is preset, and the value of the second component ratio threshold ranges from 60% to 95%. If the pores are located inside the organic matter, that is, the proportion of organic matter area in the buffer zone of the pore region is not less than the second component ratio threshold, or the proportion of pore boundary in contact with organic matter Ro is not less than the second component ratio threshold, and the pore morphology is isolated pore, honeycomb, bubble pore or pyrolysis-derived pore, then it is determined to be an organic matter pyrolysis pore. Intergranular pores: If a pore is located between the boundaries of two or more mineral particles, and the pore boundary is in contact with multiple mineral particles, and it is in the form of intergranular gaps or boundary-type irregular pores, then it is determined to be an intergranular pore. Intragranular pores: Pre-set intragranular pore contact ratio threshold and intragranular pore neighborhood area ratio threshold, both ranging from 60% to 95%; if a pore is located inside a single inorganic mineral particle, and the contact ratio between the pore boundary and the same inorganic mineral is not lower than the intragranular pore contact ratio threshold, and the mineral area ratio within the pore neighborhood buffer is not lower than the intragranular pore neighborhood area ratio threshold, then it is determined to be an intragranular pore; Organic seam: Pre-set thresholds for organic seam aspect ratio, organic matter contact ratio, and organic matter boundary distance, with values ranging from 3 to 5, 50% to 90%, and 2 to 20 pixels, respectively; if the pores are elongated and connected, the organic seam aspect ratio is not lower than the organic seam aspect ratio threshold, and Ro is not lower than the organic matter contact ratio threshold, or the average distance between the pore skeleton and the organic matter boundary does not exceed the organic matter boundary distance threshold, then it is determined to be an organic seam; Inorganic fracture: The inorganic fracture aspect ratio threshold, inorganic component contact ratio threshold, and directional angle threshold are preset, with the values ranging from 3 to 5, 50% to 95%, and 0° to 30°, respectively. If the pore is located inside an inorganic mineral, at the boundary of an inorganic mineral, or between multiple inorganic particles, and is elongated and connected, extending along the weak surface of the mineral structure, the particle boundary, or the direction of the fracture, and the inorganic fracture aspect ratio is not lower than the inorganic fracture aspect ratio threshold, and Rc+Rb is not lower than the inorganic component contact ratio threshold, or the angle between the pore skeleton and the inorganic mineral boundary, the bedding direction, or the particle boundary direction does not exceed the directional angle threshold, then it is determined to be an inorganic fracture. When the contact ratio between the pore boundary and a certain component exceeds 70%, it is determined to be a component-dominated pore type; when the contact ratio between at least two types of components exceeds 20%, it is determined to be a boundary type, composite type, or interparticle pore. When the primary criterion, namely spatial relationship conflict, is not met or the unique determination condition is not satisfied, correction is made by combining the proportion of components in the neighborhood buffer and the boundary consistency score. Pre-set thresholds for contact ratio dominance difference, contact ratio dominance, boundary consistency, boundary consistency dominance difference, and contact ratio proximity are used, with values ranging from 5% to 20%, 50% to 90%, 0.5 to 0.9, 0.05 to 0.20, and 5% to 20%, respectively. If the contact ratio at the pore boundary is inconsistent with the proportion of components in the neighborhood buffer, the category with a contact ratio higher than the contact ratio dominance difference threshold for other categories, or a contact ratio reaching the contact ratio dominance threshold, and a boundary consistency score not lower than the boundary consistency threshold or higher than the boundary consistency dominance difference threshold for other categories, is retained. If the contact ratio difference between two categories is less than the contact ratio proximity threshold, the category with the larger component proportion in the neighborhood buffer is used as the corrected category. If a determination still cannot be completed, the target is marked as a low-confidence target.
[0015] According to a preferred embodiment of the present invention, the initial binary segmentation result of the target pore region is verified and corrected, and low-confidence candidate pore targets are screened and corrected; including: Based on the comprehensive boundary enhancement results, the consistency of the boundaries in the initial binary segmentation results of the target pore region is checked, including: calculating the overlap rate between the pore contour (i.e., the pore boundary) and the comprehensive boundary enhancement results; the average boundary response value (i.e., the average value of the edge response values in the 1-3 pixel neighborhood corresponding to the pore contour); the boundary closure degree; and the inner-outer grayscale difference (i.e., the average grayscale difference between the inner 1-5 pixel buffer zone and the outer 1-5 pixel buffer zone along the normal direction of the pore boundary). A boundary overlap rate threshold and a boundary closure degree threshold are preset, with values ranging from 30% to 80% and 0.3 to 0.8, respectively. If the overlap rate between the pore contour and the enhanced boundary is lower than the boundary overlap rate threshold, or the boundary closure degree is lower than the boundary closure degree threshold, then the target is determined to need correction. The correction targets are adjusted by: pre-setting thresholds for the mean edge response value, normalized edge response value, 8-bit grayscale difference value, normalized grayscale difference value, grayscale difference coefficient of variation value, endpoint distance value, and orientation angle value. The value ranges for these seven values are 0.3–0.8, 0.2–0.5, 5–60 8-bit grayscale levels, 0.05–0.30, 0.2–0.6, 2–15 pixels, and 15°–60°, respectively. For local edge response values lower than the mean edge response value of the entire image, or normalized edge response values lower than the mean edge response value, the correction is applied. For regions where the grayscale difference between the inner and outer edges is not lower than the 8-bit grayscale difference threshold or the normalized grayscale difference threshold, and the coefficient of variation of the inner and outer grayscale difference at 3 to 10 consecutive boundary sampling points is not higher than the grayscale difference coefficient of variation threshold, the boundaries are adjusted along the local maximum gradient direction; broken edges with endpoint distances less than the endpoint distance threshold and directional angles less than the directional angle threshold are connected; edges that are not adjacent to low-grayscale pore candidate regions are removed; isolated noise or holes inside the pores are morphologically filled or removed to obtain the corrected initial binary segmentation result; Low-confidence candidate pore targets are screened from low-confidence targets or the corrected initial binary segmentation results; a classification confidence threshold and a low contrast factor threshold are preset, with values ranging from 0.5 to 0.8 and 0.2 to 0.6, respectively; the screened candidate pore targets meet one or more of the following conditions, including: classification confidence is lower than the classification confidence threshold; simultaneously satisfying two or more classification rules; having overlapping gray-level features and similar morphological features; located in complex boundary regions, i.e., regions where mineral particles, organic matter, clay flaky structures, or microcracks intersect and the boundaries are discontinuous; low-contrast regions, i.e., regions where the gray-level difference between pores and matrix is lower than the low contrast factor threshold of the average gray-level difference between pores and matrix in the entire image; and multiphase mixed regions, i.e., regions where the gray-level and texture of at least two types of minerals or organic matter overlap within a local window. The system outputs magnified images, boundary contours, area, roundness, aspect ratio, directionality, neighborhood grayscale gradient, and local structural features of the selected low-confidence candidate porosity targets. It also receives expert constraint information in the image interaction interface, including whether the targets possess closed pore-like features, fractured and stretched features, whether they extend along bedding, lamellar structures, or weak surfaces, whether they are located in organic matter accumulation zones, or near the contact zone between organic matter and clay minerals. Based on preset classification rules and expert constraint information, the system completes the category correction for the low-confidence candidate porosity targets. The corrected initial binary segmentation results are subjected to connected component analysis and pore instance labeling, including: classifying independent pore regions into individual pore instances; for adhered regions, instance splitting is performed using watershed segmentation, skeleton constraint separation, morphological separation, or curvature-assisted segmentation methods; combining the pixel scale calibration information of the preprocessed large-area view stitched image, one or more parameters of each pore instance are calculated, including area, perimeter, equivalent aperture, maximum Feret diameter, minimum Feret diameter, aspect ratio, roundness, shape factor, directional parameter, local thickness, and skeleton length, and the pixel scale is converted into the actual physical scale; the equivalent aperture D is calculated as follows: ; Where A is the area of the pore instance, and D is the diameter of the circle with the same area as the pore instance, i.e., the diameter of the equivalent circle; Statistical analysis was performed on all pore samples to obtain quantitative indicators such as the number of pores, pore porosity, pore size distribution, area distribution, aspect ratio distribution, roundness distribution, directional distribution, and the proportion of different types of pores.
[0016] The classification and statistical results are output in a unified manner, and are verified by one or more of the following methods: manual sampling, repeated identification, comparison with manual measurement results, and comparison with mercury porosimetry, gas adsorption, nuclear magnetic resonance or thin section observation results. For abnormal targets, they are marked and prompted, and the pore-matrix boundary enhancement and initial pore identification, classification extraction or correction are carried out again.
[0017] A computer device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of a method for quantitative characterization of different types of pores in shale based on scanning electron microscope images.
[0018] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for quantitative characterization of different types of pores in shale based on scanning electron microscope images.
[0019] A second aspect of the present invention provides a quantitative characterization system for different types of shale pores based on scanning electron microscopy images, comprising: The image acquisition module is configured to: acquire scanning electron microscope images, large-area field-of-view mosaic images, and mineral scanning images of the shale sample to be analyzed; and preprocess the large-area field-of-view mosaic images. The initial pore recognition module is configured to: acquire the edge response map of a large-area view spliced image, perform pore-matrix boundary enhancement and initial pore recognition on the edge response map, and obtain the comprehensive boundary enhancement result and the initial binary segmentation result of the target pore region; The classification and correction module is configured to: determine the availability of the mineral scan image; if the mineral scan image meets the availability requirements, spatially register the preprocessed large-area view mosaic image with the mineral scan image, and analyze the spatial relationship between the boundary and neighborhood of each target pore region and the mineral components in the initial binary segmentation result, and classify and extract the target pores based on the spatial relationship. Otherwise, the initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected. Output the image results or correction results of different types of pores extracted by classification.
[0020] The beneficial effects of this invention are as follows: 1. Achieve precise classification and identification of pores and fissures of different origins: This invention breaks through the limitations of existing technologies, which mainly focus on pore / non-pore identification or coarse classification. For the first time, based on the spatial contact relationship after the registration of scanning electron microscope images and mineral surface scan images, it achieves fine classification and extraction of different types of pores and fissures, such as organic clay composite pores, organic matter pyrolysis pores, intergranular pores, intragranular pores, organic fissures, and inorganic fissures.
[0021] 2. Improve the accuracy and reliability of quantitative porosity analysis: By employing large-area stitched image analysis, multi-scale boundary enhancement, mineral constraint classification, and result correction mechanisms, this invention can effectively reduce omissions and misclassifications caused by factors such as uneven grayscale, pore scale differences, boundary ambiguity, and multiphase mixing, thereby improving the accuracy of pore boundary identification and classification results.
[0022] 3. It has strong applicability under different data conditions: When mineral surface scan images are available, high-precision automatic classification can be achieved through multi-source registration and spatial contact relationships. When mineral surface scan images are not available, low-confidence targets can be corrected through an interactive constraint compensation mechanism, thereby ensuring that the method has good scalability and stability under different data conditions.
[0023] 4. Achieve a standardized and integrated quantitative extraction process: This invention integrates image acquisition, preprocessing, recognition, registration, classification, correction, instantiation, and quantitative statistics into a standardized process, which is beneficial to improving the automation, repeatability, and consistency of results in quantitative analysis of shale porosity.
[0024] 5. Enhance geological interpretation capabilities: This invention establishes the correspondence between pore and fracture types and their occurrence medium and boundary contact relationships, providing more direct and reliable microscopic data support for the study of shale pore evolution laws, reservoir space formation mechanisms and reservoir evaluation at different evolution stages. Attached Figure Description
[0025] Figure 1 This is a flowchart of the quantitative characterization method for different types of pores in shale based on scanning electron microscope images according to the present invention; Figure 2 This is a schematic diagram of the quantitative extraction of pore distribution according to the present invention. Detailed Implementation
[0026] The present invention will be further described below with reference to the embodiments and accompanying drawings, but is not limited thereto.
[0027] Example 1 Terminology Explanation: 1. Gaussian scale space: refers to convolving the original image I0(x,y) with a two-dimensional Gaussian kernel G(x,y,σ) with different standard deviations σ to form a set of scale layer images. σ is used to characterize the smooth scale and is selected from 0.5 to 5.0 pixels. It can also be adjusted according to the target aperture scale. It is used to enhance the boundary response of small, medium and large pores at different scales.
[0028] 2. Wavelet Decomposition Scale Space: This refers to using discrete wavelet transform or multi-resolution wavelet decomposition to decompose an image into approximate components and detail components such as horizontal, vertical, and diagonal components, and to represent boundary, texture, and noise information at different spatial frequencies at different decomposition levels. Haar, Daubechies, or Symlet wavelets can be used, and the preferred number of decomposition levels is 1 to 4.
[0029] 3. Edge Chain: Refers to a sequence of edge pixels that are continuously connected according to 4 or 8 neighborhoods in the edge detection result. Edge chains may have attributes such as start point, end point, length, average direction, direction change rate, overlap rate with the outer contour of the pore candidate area, and degree of closure, which are used to determine whether the edge can form an effective pore boundary.
[0030] 4. Superpixel: A superpixel is a spatially adjacent unit of pixels that share similar elemental spectra, backscattered grayscale values, texture features, or mineral category probabilities. Superpixels can be obtained through simple linear iterative clustering, watershed segmentation, or region merging algorithms. The pixels or superpixels described in this invention can serve as spatial analysis units in elemental surface distribution maps, mineral classification images, or resampled mineral scan images.
[0031] 5. Texture edges inside particles: These refer to the grayscale variation edges inside mineral particles caused by crystal cleavage, banding, brightness fluctuations, polishing marks, or charging effects. These edges do not correspond to the actual pore boundaries and need to be eliminated in this invention through low grayscale region constraint, closure, and connectivity analysis.
[0032] 6. Multi-scale consistency fusion: This refers to mapping the edge responses or segmentation results on different scale layers to the same coordinate system, and then fusing them according to the rules of maximum response, weighted response, logical union, voting consistency, or scale persistence to obtain a comprehensive boundary enhancement result that takes into account both small pores and large gaps.
[0033] 7. Morphological connection, broken edge repair and local closure enhancement: refers to the use of image morphological operations such as dilation, erosion, opening operation, closing operation, bridging, thinning, hole filling, endpoint connection or edge completion based on the shortest path to make discontinuous edges form more continuous pore contours.
[0034] 8. Neighborhood Buffer Zone: This refers to a ring or extended region formed by extending outwards by a certain pixel distance from the pore boundary or pore region. It is used to statistically analyze the area ratio and spatial inclusion relationship of mineral components around the pore. In this invention, the extended distance is preferably 2 to 20 pixels, or 5% to 30% of the equivalent circle diameter of the target pore.
[0035] 9. Spatial contact relationship: refers to the contact length, contact ratio, enclosure relationship, boundary relationship and relative position relationship between the pore boundary or its adjacent buffer zone and organic matter, clay minerals, rigid minerals or other mineral components.
[0036] 10. Non-rigid correction: This refers to a class of registration methods that, in addition to overall translation, rotation, scaling, shearing, or perspective transformations, allow continuous deformation of the image in local areas during image registration. It is used to correct local misalignments caused by scan drift, local sample deformation, stitching errors, or different imaging modes. Commonly used non-rigid correction algorithms include thin-plate spline transformation, B-spline free deformation model, elastic registration model, and optical flow field correction model.
[0037] 11. Feature Point Registration: This refers to extracting points with stable grayscale, texture, or geometric features from two images to be registered as control points, establishing a correspondence through feature descriptor matching, and calculating the geometric transformation model between the images. Commonly used algorithms include scale-invariant feature transformation algorithms, accelerated robust feature algorithms, oriented fast rotation binary descriptor algorithms, and random sampling consistency mismatch removal algorithms.
[0038] 12. Boundary Contour Registration: This refers to using common mineral grain boundaries, pore boundaries, phase interfaces, or other continuous contours in two images as the registration basis, and calculating the spatial transformation relationship between the images through contour distance, shape similarity, or nearest-point iteration relationships. Common methods include iterative nearest-point algorithms, shape context matching algorithms, and contour matching algorithms based on distance transformations.
[0039] 13. Contrast-Limited Adaptive Histogram Equalization: This refers to existing image enhancement methods that divide the image into blocks, perform histogram equalization on each local window, and suppress excessive noise amplification by limiting the contrast threshold. Adaptive histogram equalization, contrast-limited adaptive histogram equalization, and local grayscale stretching are all existing image enhancement algorithms that can be directly called upon.
[0040] 14. Concentration: A region in which a certain natural resource (such as minerals, energy, or biological resources) is relatively densely distributed in space. It is a standard term in the field of resource science and technology.
[0041] Quantitative characterization method of different types of pores in shale based on scanning electron microscopy images, such as Figure 1 As shown, it includes: Step 1: Acquire scanning electron microscope (SEM) images, large-area field-of-view mosaic images, and mineral scanning images of the shale sample to be analyzed; and preprocess the large-area field-of-view mosaic images. Step 2: Obtain the edge response map of the large-area view stitched image, perform pore-matrix boundary enhancement and initial pore identification on the edge response map, and obtain the comprehensive boundary enhancement result and the initial binary segmentation result of the target pore region; Step 3: Determine the usability of the mineral scanning image. If the mineral scanning image meets the usability requirements, spatially register the preprocessed large-area view stitched image with the mineral scanning image, and analyze the spatial relationship between the boundary and neighborhood of each target pore region and the mineral components in the initial binary segmentation result. Based on the spatial relationship, classify and extract the target pores. Otherwise, the initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected. Output the image results or correction results of different types of pores extracted by classification.
[0042] Example 2 The method for quantitative characterization of different types of shale pores based on scanning electron microscopy images as described in Example 1 differs in that: The specific implementation process of step 1 includes: Sample preparation for the shale sample to be analyzed includes one or more of the following: cutting, mounting, mechanical polishing, argon ion polishing, and conductive coating, to ensure that the surface of the shale sample meets the requirements for scanning electron microscopy (SEM) imaging. The specific methods can be selected based on the shale sample's brittleness, organic matter content, conductivity, and target observation scale. The prepared shale sample is then placed under a scanning electron microscope for observation and imaging to obtain a SEM image of the shale sample, which is used to characterize the microstructural features of the shale sample, such as mineral grains, pores, fractures, organic matter, and matrix. In the scanning electron microscope (SEM) image, select the region of interest, which is the area on the surface of the shale sample to be analyzed that represents the porosity development characteristics of the target layer or target lithofacies. This includes one or more of the following: organic matter enrichment bands, clay mineral enrichment areas, rigid mineral grain enrichment areas, bedding development areas, microcrack development areas, and transition zones. At the same time, avoid polishing scratches, chipping, contamination, edge breakage, and areas with severe charging. Among them, the particle boundary drift threshold, gray standard deviation multiple threshold, and gray difference multiple threshold are preset, with values ranging from 5 to 20 pixels, 1.5 to 3.0, and 0.2 to 0.6, respectively. Areas with severe charging are indicated by the appearance of continuous bright spots, bright bands, or dark bands in a local area and the pixel area accounting for 5% to 30% of the local window area, or the drift of the same particle boundary position between adjacent repeated scan frames is greater than the particle boundary drift threshold, or the local gray standard deviation is higher than the gray standard deviation multiple threshold of the gray standard deviation of the adjacent normal area and is accompanied by boundary distortion, or the gray difference between pores and matrix in a local area is lower than the gray difference multiple threshold of the average gray difference between pores and matrix in the whole image. Backscattered electron imaging is performed on the region of interest (ROI), and the surface of the shale sample to be analyzed is scanned using a regular grid, dividing the ROI into M×N adjacent fields of view. Multiple adjacent images are acquired field by field in a fixed row and column order, with a 5%–30% overlap between adjacent fields of view to facilitate image registration and seam correction. The multiple adjacent images are then stitched together to form a large-area mosaic image. Stitching can be performed using the built-in stitching function of the scanning electron microscope or external image stitching software. During stitching, it is preferable to retain a certain overlap between adjacent images to facilitate image registration and seam correction. The resolution of a single image is 1024×768 pixels to 8192×8192 pixels; the magnification is 500x to 50000x; the pixel size is 5 nm / pixel to 200 nm / pixel; and the area of a single stitched field of view is 0.05 mm² to 5 mm². The shale sample to be analyzed after sample preparation was subjected to surface scanning, lattice scanning or point-by-point elemental analysis using an energy dispersive spectroscopy (EDS) instrument to obtain the elemental composition information at each location. Combined with the grayscale characteristics, mineral morphology characteristics and element combination discrimination rules of backscattered images (i.e., large-area field-of-view mosaic images), mineral scanning images of the corresponding areas were established. Preprocessing of large-area field-of-view stitched images to improve image quality and enhance the separability between pores and matrix includes one or more operations such as image denoising, grayscale normalization and brightness correction, local contrast enhancement, background correction and stitching boundary smoothing, scale unification and pixel calibration. Image denoising: Median filtering, bilateral filtering, nonlocal mean filtering, or Gaussian filtering are used to suppress random noise in scanning electron microscope images while preserving the aperture boundary structure as much as possible; the median filtering window is 3×3 to 9×9 pixels, and the standard deviation of Gaussian filtering is 0.5 to 3. Gray-level normalization and brightness correction: The gray-level values of different image regions are normalized to reduce the brightness deviation between different fields of view or spliced regions; Local contrast enhancement: Adaptive histogram equalization, contrast-limited adaptive histogram equalization, or local grayscale stretching methods are used to improve the recognizability of pore and matrix boundaries in low-contrast regions. Background correction and stitching boundary smoothing: Correction and smoothing of grayscale drift, stitching seams and background unevenness in large-area field-of-view stitched images to reduce subsequent recognition errors; Scale unification and pixel calibration: Record and unify the pixel scale information of scanning electron microscope images; pixel scale information is usually automatically generated by the scanning electron microscope imaging system during image acquisition, including parameters such as scale bar length, pixel resolution or magnification; the pixel scale information can be used to convert the pixel size in the image into the actual physical size, which can be used for subsequent quantitative calculation of parameters such as pore area, pore diameter, perimeter, slit width and slit length.
[0043] Create mineral scanning images of the regions corresponding to the scanning electron microscope images, including: Mineral scan images include elemental distribution maps, mineral classification images, and mineral composition images; Elemental surface distribution maps were acquired by combining scanning electron microscopy with energy dispersive spectroscopy (EDS). This included: synchronously acquiring X-ray counts of features while traversing the region of interest by pixel or scan step size; generating two-dimensional intensity maps or content maps of one or more elements from C, O, Si, Al, K, Na, Ca, Mg, Fe, S, and Ti after EDS interpretation, background subtraction, and peak overlap correction; and then normalizing and suppressing noise to obtain the elemental surface distribution maps. The normalized elemental intensities were expressed as 0 to 1, or as mass percentage or atomic percentage. Pixels or superpixels in the elemental distribution map are assigned to corresponding mineral components, including: regions with high C and varying enrichment of Si, Al, Ca, Fe, and S are classified as organic matter; regions with high Si, presence of O, and low levels of Al, K, Na, Ca, Mg, and Fe are classified as quartz; regions with high Si and Al and enrichment of K, Na, or Ca are classified as feldspar, with K enrichment classified as potassium feldspar and Na or Ca enrichment classified as plagioclase; regions with simultaneous enrichment of Al and Si, and at least one of K, Mg, or Fe, exhibiting platy or flocculent morphology, are classified as clay minerals; regions with co-enrichment of Fe and S are classified as pyrite; regions with high Ca, presence of C and O, low Mg, and low levels of Si and Al are classified as calcite; regions with co-enrichment of Ca and Mg and presence of C and O are classified as dolomite; T Regions with high concentrations of element i are classified as ilmenite or rutile-type titanium-bearing minerals; regions co-enriched with Ba and S are classified as barite; regions co-enriched with Ca and P are classified as apatite; regions that do not meet the above rules or contain multiple mineral mixtures are marked as undetermined components or mixed components; wherein, a high threshold for the first element, a high multiple threshold for the second element, a low threshold for the first element, and a low multiple threshold for the second element are preset, with values ranging from 0.55 to 0.85, 0.5 to 2.0, 0.15 to 0.45, and 0.5 to 1.5 respectively; high element means that the normalized element intensity is greater than the high threshold for the first element, or greater than the product of the current field mean of the element plus the high multiple threshold for the second element and the standard deviation; low element means that the normalized intensity is less than the low threshold for the first element, or less than the product of the current field mean of the element minus the low multiple threshold for the second element and the standard deviation; Each pixel or superpixel is assigned to a corresponding mineral component and then labeled accordingly to obtain a mineral classification image. The mineral classification image is corrected using the label-controlled watershed algorithm (the boundaries of the initial mineral classification results are snapped to the boundaries of particles with higher gradient magnitudes in the backscattered image; majority filtering or neighborhood merging is performed on isolated misclassified patches smaller than 3 to 50 pixels; classification regions that cross obvious particle boundaries are segmented according to the particle boundaries; and regions with weak elemental signals but stable backscattered gray levels and morphologies are reclassified according to neighboring mineral categories and morphological constraints), resulting in a mineral composition image. The specific implementation process of step 2 includes: Based on the preprocessed large-area view mosaic image, the pore-matrix boundary is enhanced to improve the detectability of pore targets at different scales. One or more of Gaussian scale space, wavelet decomposition scale space or image pyramid method are used to apply smoothing filtering or multi-resolution decomposition with different scale parameters to the preprocessed large-area view mosaic image to obtain multiple scale layer images, which are used to characterize the boundary features of small pores, medium pores and large pores respectively. Edge response maps are obtained by extracting regions with significant gray-level changes (i.e., regions whose gradient magnitudes are 1.0 to 3.0 times greater than the average gradient magnitude of the entire image, or regions greater than the 60% to 95th percentile of the gradient magnitude distribution) on images at multiple scales using edge detection operators. The edge detection operators are Canny, Sobel, Laplacian, or LoG operators. Taking the Canny operator as an example, it includes steps such as gradient calculation, non-maximum suppression, and double threshold connection to obtain the initial edge response results at the current scale. To suppress false edges caused by noise, mineral textures, or shadow effects, the edge response map is constrained and screened, including: pre-setting a normalized edge response threshold, an edge response mean multiple threshold, and an edge response quantile threshold, with values ranging from 0.2 to 0.6, 1.0 to 3.0, and 60% to 95%, respectively; pixels with edge response values not lower than the normalized edge response threshold, or not lower than the edge response mean multiple threshold, or not lower than the edge response quantile threshold are designated as edge pixels, and edge pixels or edge chains formed by connecting edge pixels are designated as candidate edges; Local grayscale mean and gradient direction are obtained on both sides of the candidate edge within a width of 1-5 pixels. Only candidate edges that are adjacent to low grayscale aperture candidate areas on one side and adjacent to matrix areas on the other side are retained. Specifically, this includes: pre-setting an 8-bit grayscale difference threshold, a normalized grayscale difference threshold, a low grayscale standard deviation multiple threshold, and a low grayscale quantile threshold. The values of these four thresholds are 5-60 8-bit grayscale levels, 0.05-0.30, 0.5-1.5, and 5%-40%, respectively. 60%-90% of the pixels within a 1-5 pixel buffer zone along the normal direction of the candidate edge are considered to have a grayscale mean and gradient direction. In a low grayscale aperture candidate region, if 50% to 90% of the pixels within a 1-5 pixel buffer band along the opposite normal direction do not belong to the low grayscale aperture candidate region, and the difference between the average grayscale of the opposite normal buffer band and the average grayscale of the low grayscale aperture candidate region is not lower than the 8-bit grayscale difference threshold or the normalized grayscale difference threshold, the corresponding candidate edge is preserved; wherein, the low grayscale aperture candidate region refers to the region within a local window whose grayscale value is lower than the window mean minus the product of the low grayscale standard deviation multiple threshold and the standard deviation, or the region whose grayscale value is lower than the grayscale value corresponding to the low grayscale quantile threshold; The connectivity, continuity, and closure trend of the retained candidate edges are analyzed, and an edge chain length threshold is preset, the value of which ranges from 3 to 30 pixels; candidate edges that are retained with an edge chain pixel count or edge chain polygonal arc length not less than the edge chain length threshold, smooth directional changes, and form a local closed contour with the low grayscale aperture candidate area; A short edge length threshold is preset, and the value of the short edge length threshold is in the range of 3 to 10 pixels; candidate edges with a length less than the short edge length threshold and that do not participate in the closure of any low grayscale pore candidate area outer contour, particle internal texture edges, and candidate edges that lack spatial correspondence with the low grayscale pore candidate area are eliminated; After constraints and filtering, the final edge response map is obtained, and a fusion process is performed on the final edge response map. Multi-scale positional deviation thresholds, endpoint distance thresholds, and orientation angle thresholds are pre-set, with values ranging from 1 to 5 pixels, 2 to 15 pixels, and 15° to 60°, respectively. The fusion process includes pixel-level maximum response fusion (taking the maximum edge response at the same pixel location at different scales), weighted summation fusion (normalizing and weighting the responses at each scale according to the target scale weight), logical joint fusion (taking the union of the binary edge maps at each scale), or multi-scale consistency fusion (preserving the edge response stable at at least two scales). One or more of the following are selected: edges that appear or whose positional deviation in adjacent scales is less than the multi-scale positional deviation threshold; after fusion processing, morphological connection (using 3×3 to 9×9 structuring elements for closing or bridging operations), broken edge repair (connecting edge segments whose endpoint distance is less than the endpoint distance threshold and whose direction angle is less than the direction angle threshold), and local closure enhancement (filling holes in near-closed contours and retaining areas consistent with low-grayscale pore candidate areas) are combined to improve the continuity and integrity of pore boundaries, forming a comprehensive boundary enhancement result, namely, pore-matrix boundary enhancement result; After obtaining the comprehensive boundary enhancement results, candidate aperture regions are identified in the preprocessed large-area viewport stitched image. Low gray-level seed quantile threshold, low gray-level seed standard deviation multiple threshold, 8-bit gray-level expansion threshold, and normalized gray-level expansion threshold are pre-set, with values ranging from 5% to 20%, 0.5 to 1.5, 5 to 30 8-bit gray levels, and 0.02 to 0.15, respectively. Thresholding segmentation (Otsu threshold, local adaptive threshold, or multi-threshold segmentation) and region growing (expanding from low gray-level seed points to their neighborhoods, where the low gray-level seed points are those with gray values lower than a certain threshold) are performed on the preprocessed large-area viewport stitched image. The initial binary segmentation result of the target pore region is obtained by using one or more of the following methods: the gray value corresponding to the low gray seed quantile threshold, or the product of the local window mean minus the low gray seed standard deviation multiple threshold and the standard deviation, and located within the area enclosed by the comprehensive boundary enhancement result; the gray value of the pixel to be expanded and the average gray value of the current region are less than the 8-bit gray expansion threshold or the normalized gray expansion threshold, and the expansion path does not cross the strong edges in the comprehensive boundary enhancement result; edge-guided segmentation (segmenting the comprehensive boundary enhancement result as a constraint boundary); machine learning segmentation; or deep learning segmentation model (using random forest, support vector machine, U-Net, or Mask R-CNN, etc.); wherein the initial binary segmentation result of the target pore region includes one or more of the following: pore region location, boundary contour, connected region information, and target confidence.
[0044] The connectivity, continuity, and closure tendency of the retained candidate edges are analyzed, including: Connectivity analysis uses 8-neighbor connectivity tracing, which treats adjacent edge pixels in the horizontal, vertical, and diagonal directions as connected and assigns the same edge chain number to connected edge pixels. Continuity analysis involves calculating the distance between the endpoints of candidate edges and the angle between their directions. Pre-set thresholds for endpoint distance and tangent direction angle, with values ranging from 2 to 15 pixels and 15° to 60° respectively. When the distance between two endpoints is less than the endpoint distance threshold, and the angle between the tangent directions at the endpoints is less than the tangent direction angle threshold, the two candidate edges are considered continuous. Here, a segment endpoint represents a pixel in an edge chain with only one 8-neighbor connection (each pixel has a maximum of 8 adjacent directions (horizontal, vertical, diagonal); if an edge pixel has only one adjacent edge pixel, it is an "endpoint / termination point," used for subsequent break detection and connection judgment, primarily to identify whether an edge is broken). Closure trend analysis involves calculating the overlap rate between candidate edges and the outer contour of low-grayscale aperture candidate areas, the closure distance between fragment endpoints, and the enclosed area of edge chains. The outer contour of the low-grayscale aperture candidate area represents the outermost boundary contour extracted from each considered connected region after connectivity analysis of the low-grayscale aperture candidate area. The overlap rate is the proportion of edge pixels within a 1-5 pixel range from the outer contour of the low-grayscale aperture candidate area to the total number of pixels in the edge chain (retaining edge chains with an overlap rate of 30%-90%). A closure distance threshold and an enclosed area threshold are preset, with values ranging from 2-15 pixels and 3-50 pixels, respectively. The closure distance is the shortest distance between adjacent fragment endpoints or between fragment endpoints and the break point of the outer contour of the low-grayscale aperture candidate area, and does not exceed the closure distance threshold. The enclosed area of the edge chain represents the area enclosed by the closed contour formed by the edge chain, and is not less than the enclosed area threshold. The target confidence level is C0 = a1P + a2B + a3G + a4M; where P represents the porosity probability, B represents the boundary closure, G represents the low grayscale consistency, M represents the morphological rationality, and a1 to a4 represent the weights and sum to 1 (the weights can be adaptively determined based on the samples). Wherein, the porosity probability P is the probability that a pixel output by threshold segmentation, machine learning model, or deep learning model belongs to a porosity; the boundary closure B is the proportion of the contour length supported by the comprehensive boundary enhancement result in the porosity contour to the total contour length, or 1 minus the ratio of the length of the unclosed gap to the total length of the porosity contour; the low grayscale consistency G is the proportion of the pixel area that meets the low grayscale threshold in the porosity region to the porosity area, where the low grayscale threshold is the 5% to 40% quantile of the grayscale distribution of the entire image, or the local window grayscale mean minus 0.5 to 2.0 times the local grayscale standard deviation; and the morphological rationality M is the target morphological parameters (area, roundness). The morphological threshold range for pore-like targets is determined by the degree to which the aspect ratio, local thickness, etc., fall within the range of the labeled sample (existing typical pore sample) or the preset threshold range. A first aspect ratio threshold, a roundness threshold, and a skeleton thickness ratio threshold are preset, with the values of the three ranging from 3 to 5, 0.2 to 0.6, and 5 to 10, respectively. The morphological threshold range for pore-like targets is that the aspect ratio is less than the first aspect ratio threshold, the roundness is not less than the roundness threshold, and the ratio of skeleton length to local thickness is less than the skeleton thickness ratio threshold. The morphological threshold range for slit-like targets is that the aspect ratio is not less than the first aspect ratio threshold, or the ratio of skeleton length to local thickness is not less than the skeleton thickness ratio threshold.
[0045] The usability of the mineral scan image is determined. If the mineral scan image meets the usability requirements, spatial registration is performed between the preprocessed large-area view mosaic image and the mineral scan image. The spatial relationships between the boundaries and neighborhoods of each target pore region and the mineral components in the initial binary segmentation results are analyzed, including: The usability of mineral scan images is determined by one or more of the following conditions: (1) The mineral scanning image and the preprocessed large-area field-of-view mosaic image have an overlap or correspondence in the field of view, that is, they contain the same mineral grain boundaries, the same bedding structure, the same cracks or the same artificial control points, and the overlapping area is not less than 50% to 100% of the target analysis area of the preprocessed large-area field-of-view mosaic image; (2) The mineral scan image has clear mineral boundaries or mineral classification information, that is, the main mineral categories can be distinguished; the mineral boundary deviation threshold, effective classification confidence threshold, effective classification area ratio threshold and main mineral area ratio threshold are preset, and the values of the four are 1 to 20 pixels, 0.5 to 0.9, 70% to 95% and 5% to 10%, respectively; the average deviation between the mineral boundary and the corresponding mineral boundary in the backscattered image does not exceed the mineral boundary deviation threshold, and the effective classification area ratio of the main mineral category (the proportion of the area of pixels or superpixels that are assigned a clear mineral category and whose classification confidence is not lower than the effective classification confidence threshold to the area of the target analysis region) is not lower than the effective classification area ratio threshold; wherein, the main mineral category includes one or more of organic matter, clay minerals, quartz, feldspar, pyrite, calcite and dolomite, or mineral categories whose area ratio in the target analysis region is not lower than the main mineral area ratio threshold; (3) The resolution, pixel scale, or imaging quality of the mineral scan image meets the requirements of registration analysis; the pixel size multiple threshold, the minimum mineral tag pixel number threshold, the dominant mineral area ratio threshold, the classification confidence threshold, and the dominant mineral area ratio difference threshold are preset, with the values ranging from 1 to 20, 2 to 5 pixels, 50% to 90%, 0.5 to 0.9, and 5% to 20%, respectively; the pixel size of the mineral scan image is not greater than the product of the pixel size of the preprocessed large-area field-of-view stitched image and the pixel size multiple threshold, or after resampling, the minimum target pore boundary can be minimized. Neighborhood mineral components remain identifiable, meaning that within a neighborhood buffer zone extending 2–20 pixels outward from the minimum target pore or 5%–30% of the equivalent circle diameter, the number of mineral tag pixels is not less than the minimum mineral tag pixel count threshold, and the area proportion of the dominant mineral category is not less than the dominant mineral area proportion threshold or the classification confidence is not less than the classification confidence threshold; wherein, the dominant mineral category includes the mineral category with the highest area proportion within the neighborhood buffer zone and whose area proportion is higher than the dominant mineral area proportion difference threshold of other mineral categories, or the mineral category whose area proportion reaches the dominant mineral area proportion threshold; (4) Pre-set the threshold for the proportion of missing pixel area, the threshold for misalignment error and the threshold for the proportion of noise pollution area, with the values of the three being 1% to 20%, 1 to 20 pixels and 5% to 30%, respectively; the proportion of missing pixel area in the mineral scan image is less than the threshold for the proportion of missing pixel area, the misalignment error is less than the threshold for the misalignment error, and the proportion of noise pollution area is less than the threshold for the proportion of noise pollution area. By selecting the aforementioned path, this method can maintain the adaptability, consistency, and feasibility of the process under different data conditions. If the scanned images meet the availability requirements, the mineral scanned images are preprocessed, including resampling, denoising, and label smoothing. Spatial registration is performed between the preprocessed large-area field-of-view mosaic image and the mineral scan image using one or more of the following methods: feature point registration, boundary contour registration, affine transformation, perspective transformation, and non-rigid correction. Simultaneously, the registration error is calculated using mineral grain boundaries, light-dark phase interfaces, characteristic textures, grain combination structures, or manually selected control points (grain sharp corners, pyrite grains, carbonate mineral boundaries, crack endpoints, or other stable feature points that can be located in both types of images) from the preprocessed large-area field-of-view mosaic image and the mineral scan image as registration references. A registration error threshold is pre-set, ranging from 1 to 20 pixels, and the registration error is controlled within this threshold or does not exceed 50% of the number of pixels corresponding to the minimum target pore size. For example, when the minimum target pore size is 40 nm and the SEM pixel size is 10... When the resolution is nm / pixel, the smallest target pore recognition scale corresponds to 4 pixels, so the registration error is preferably no more than 2 pixels. When the resolution of the mineral scanning image is low, a relaxed registration error threshold is preset. The value range of the relaxed registration error threshold is 10 to 20 pixels, and the registration error can be relaxed to no more than the relaxed registration error threshold according to the pixel size of the mineral scanning image and the actual classification requirements. After registration, the correspondence between the preprocessed large-area field-of-view mosaic image and the mineral scan image in a unified coordinate system is obtained, which is used for subsequent analysis of the spatial contact relationship between pore boundaries and different minerals and organic matter. For each pore target in the initial binary segmentation result of the target pore region, the spatial relationship between the boundary and the neighborhood and the mineral components is analyzed. The spatial relationship includes one or more of the following: boundary contact relationship, neighborhood component proportion relationship, single component encirclement relationship, boundary relationship between two or more types of components, and structural direction relationship. The boundary contact relationships include the total length L of the pore boundary, the contact length Lo between the pore boundary and organic matter, the contact length Lc between the pore boundary and clay minerals, the contact length Lb between the pore boundary and rigid minerals, and the proportions of each contact length to the total boundary length, i.e., Ro=Lo / L, Rc=Lc / L, Rb=Lb / L; where Ro represents the contact ratio between the pore boundary and organic matter, Rc represents the contact ratio between the pore boundary and clay minerals, and Rb represents the contact ratio between the pore boundary and rigid minerals; rigid minerals include one or more of quartz, feldspar, pyrite, calcite, and dolomite. The proportion of neighboring components, including the area proportion of organic matter, clay minerals, rigid minerals and other mineral components in the pore neighborhood buffer zone; The single-component enclosure relationship includes whether a certain mineral component's area ratio within the pore neighborhood buffer reaches a preset area ratio threshold, or whether the contact ratio between the pore boundary and a certain mineral component reaches a preset contact ratio threshold; wherein, the preset area ratio threshold and the preset contact ratio threshold both range from 50% to 90%; The boundary relationship between two or more components includes whether the pore is located in the boundary zone where the contact ratio of at least two mineral components is not less than a preset component contact ratio threshold, and the distance from the centroid of the pore to the boundary line of the two mineral components does not exceed a preset boundary distance threshold; wherein, the preset component contact ratio threshold ranges from 10% to 30%, and the preset boundary distance threshold ranges from 2 to 20 pixels. Structural orientation relationships include the angles between the long axis of pores, the skeleton direction, or the direction of crack extension and the particle boundaries, bedding directions, or weak mineral structures; among which, weak mineral structures refer to the structural interfaces that form pore extensions in bedding planes, platy clay mineral arrangement planes, mineral cleavage planes, particle contact interfaces, or microcrack extension planes.
[0046] The classification confidence score C = w1Cr + w2Cb + w3Cm + w4Cp; Cr is the rule matching degree, Cb is the boundary consistency score, Cm is the morphological consistency score, Cp is the model output probability, and w1 to w4 are the weights and their sum is 1. The rule matching degree is calculated based on the proportion of targets that satisfy the classification rules, i.e., Cr = m1 / n1, where n1 represents the number of classification discrimination conditions possessed by the target category, and m1 represents the number of classification discrimination conditions satisfied. A boundary proximity distance threshold is preset, with a value range of 1 to 5 pixels. The boundary consistency score is the proportion of the length of the pore contour that coincides with the comprehensive boundary enhancement result or is no more than the boundary proximity distance threshold from the comprehensive boundary enhancement result to the total length of the pore contour, with a value range of 0 to 1. The morphological consistency score is calculated based on the distance between the target's morphological parameters and the mean of the corresponding category samples (samples of existing typical pores), i.e., the target's area, aspect ratio, roundness, skeleton length, and local... After normalization of thickness and orientation parameters, a morphological feature vector X is formed. The mean of samples of the corresponding category is used to form a reference vector μ. The degree of morphological deviation is represented by Euclidean distance, Mahalanobis distance, or weighted distance d(X,μ). Then, it is converted into a score in the range of 0 to 1 according to Cm=exp[-d(X,μ)] or Cm=1 / [1+d(X,μ)]. The higher the value, the more the target morphology conforms to the corresponding category features. The output probability of the classification model represents the pore classification probability obtained by inputting the pore local image patch, the initial binary segmentation result, the pore edge response map, the local gray-level statistical features, morphological parameters, texture features, neighborhood gray-level gradient features, and / or mineral scan image into the classification model (random forest, support vector machine, gradient boosting tree, U-Net, Mask R-CNN, or one or more lightweight convolutional neural networks).
[0047] Target pores are classified and extracted based on spatial relationships; including: Based on the aspect ratio of the target pore morphology parameters (such as area, perimeter, aspect ratio, roundness, equivalent circle diameter, Feret maximum diameter, Feret minimum diameter, skeleton length, local thickness, directional parameters, etc.), pores, i.e., target pores, are classified into pore-type targets and fracture-type targets. A first aspect ratio threshold, a roundness threshold, and a skeleton thickness ratio threshold are preset, with values ranging from 3 to 5, 0.2 to 0.6, and 5 to 10, respectively. These values are determined according to the image resolution of the shale sample to be analyzed, the development characteristics of the target pores and fractures, or labeled samples, and remain unchanged during the classification process of the same batch of images. Targets with an aspect ratio less than the first aspect ratio threshold, a roundness not less than the roundness threshold, and a skeleton length to local average thickness ratio less than the skeleton thickness ratio threshold are identified as pore-type targets. Targets with an aspect ratio not less than the first aspect ratio threshold, or a skeleton length to local average thickness ratio not less than the skeleton thickness ratio threshold, and which extend continuously along a certain direction, are identified as fracture-type targets. Among pore-type targets, at least two or more categories should be classified as organic-clay composite pores, organic matter rift pores, intergranular pores, and intragranular pores; among crack-type targets, at least one or two categories should be classified as organic cracks and inorganic cracks; the specific classification rules are as follows: Organic-clay composite pore: A contact zone distance threshold, a contact zone equivalent circle diameter ratio threshold, and a first component ratio threshold are preset, with the values ranging from 2 to 20 pixels, 5% to 30%, and 10% to 30%, respectively. If the distance from the centroid of the target pore or the boundary of the target pore to the organic matter-clay mineral boundary does not exceed the contact zone distance threshold, or does not exceed the product of the pore equivalent circle diameter and the contact zone equivalent circle diameter ratio threshold, and the boundary of the target pore is in contact with both organic matter and clay minerals, or the proportions of organic matter and clay minerals in the neighboring buffer zone are not lower than the first component ratio threshold, or the contact ratios of both are not lower than the first component ratio threshold, then it is determined to be an organic-clay composite pore. Organic matter pyrolysis pores: A second component ratio threshold is preset, and the value of the second component ratio threshold ranges from 60% to 95%. If the pores are located inside the organic matter, that is, the proportion of organic matter area in the buffer zone of the pore region is not less than the second component ratio threshold, or the proportion of pore boundary in contact with organic matter Ro is not less than the second component ratio threshold, and the pore morphology is isolated pore, honeycomb, bubble pore or pyrolysis-derived pore, then it is determined to be an organic matter pyrolysis pore. Intergranular pores: If a pore is located between the boundaries of two or more mineral particles, and the pore boundary is in contact with multiple mineral particles, and it is in the form of intergranular gaps or boundary-type irregular pores, then it is determined to be an intergranular pore. Intragranular pores: Pre-set intragranular pore contact ratio threshold and intragranular pore neighborhood area ratio threshold, both ranging from 60% to 95%; if a pore is located inside a single inorganic mineral particle, and the contact ratio between the pore boundary and the same inorganic mineral is not lower than the intragranular pore contact ratio threshold, and the mineral area ratio within the pore neighborhood buffer is not lower than the intragranular pore neighborhood area ratio threshold, then it is determined to be an intragranular pore; Organic seam: Pre-set thresholds for organic seam aspect ratio, organic matter contact ratio, and organic matter boundary distance, with values ranging from 3 to 5, 50% to 90%, and 2 to 20 pixels, respectively; if the pores are elongated and connected, the organic seam aspect ratio is not lower than the organic seam aspect ratio threshold, and Ro is not lower than the organic matter contact ratio threshold, or the average distance between the pore skeleton and the organic matter boundary does not exceed the organic matter boundary distance threshold, then it is determined to be an organic seam; Inorganic fracture: The inorganic fracture aspect ratio threshold, inorganic component contact ratio threshold, and directional angle threshold are preset, with the values ranging from 3 to 5, 50% to 95%, and 0° to 30°, respectively. If the pore is located inside an inorganic mineral, at the boundary of an inorganic mineral, or between multiple inorganic particles, and is elongated and connected, extending along the weak surface of the mineral structure, the particle boundary, or the direction of the fracture, and the inorganic fracture aspect ratio is not lower than the inorganic fracture aspect ratio threshold, and Rc+Rb is not lower than the inorganic component contact ratio threshold, or the angle between the pore skeleton and the inorganic mineral boundary, the bedding direction, or the particle boundary direction does not exceed the directional angle threshold, then it is determined to be an inorganic fracture. When the contact ratio between the pore boundary and a certain component exceeds 70%, it is determined to be a component-dominated pore type; when the contact ratio between at least two types of components exceeds 20%, it is determined to be a boundary type, composite type, or interparticle pore; the above thresholds can be adjusted according to the sample type, image resolution, and annotation experience, and are not limited to the above values; in a preferred embodiment, the pore type is determined based on spatial contact relationship and inclusion relationship as the main criteria, and morphological parameters such as aspect ratio, roundness, orientation, skeleton length, and local thickness as auxiliary criteria; When the primary criterion, namely spatial relationship conflict, is not met or the unique determination condition is not satisfied, correction is made by combining the proportion of components in the neighborhood buffer and the boundary consistency score. Pre-set thresholds for contact ratio dominance difference, contact ratio dominance, boundary consistency, boundary consistency dominance difference, and contact ratio proximity are used, with values ranging from 5% to 20%, 50% to 90%, 0.5 to 0.9, 0.05 to 0.20, and 5% to 20%, respectively. If the contact ratio at the pore boundary is inconsistent with the proportion of components in the neighborhood buffer, the category with a contact ratio higher than the contact ratio dominance difference threshold for other categories, or a contact ratio reaching the contact ratio dominance threshold, and a boundary consistency score not lower than the boundary consistency threshold or higher than the boundary consistency dominance difference threshold for other categories, is retained. If the contact ratio difference between two categories is less than the contact ratio proximity threshold, the category with the larger component proportion in the neighborhood buffer is used as the corrected category. If a determination still cannot be completed, the target is marked as a low-confidence target.
[0048] The initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected; including: In cases where the mineral scan image is determined to be nonexistent, unavailable, or unusable, based on the initial binary segmentation result of the target pore region, the pores are corrected, instance-marked, compensated for, classified, and quantitatively extracted using only the SEM image and its derived boundary, grayscale, and morphological information. Specifically, the derived boundary information is obtained by integrating boundary enhancement results, edge response maps, and pore contours; grayscale information is obtained from the local grayscale mean, grayscale variance, grayscale gradient, and grayscale histogram of the SEM image; and morphological information is obtained from the pore binary region through connected component analysis and geometric measurements. Based on the comprehensive boundary enhancement results, the consistency of the boundaries in the initial binary segmentation results of the target pore region is checked, including: calculating the overlap rate between the pore contour (i.e., the pore boundary) and the comprehensive boundary enhancement results; the average boundary response value (i.e., the average value of the edge response values in the 1-3 pixel neighborhood corresponding to the pore contour); the boundary closure degree; and the inner-outer grayscale difference (i.e., the average grayscale difference between the inner 1-5 pixel buffer zone and the outer 1-5 pixel buffer zone along the normal direction of the pore boundary). A boundary overlap rate threshold and a boundary closure degree threshold are preset, with values ranging from 30% to 80% and 0.3 to 0.8, respectively. If the overlap rate between the pore contour and the enhanced boundary is lower than the boundary overlap rate threshold, or the boundary closure degree is lower than the boundary closure degree threshold, then the target is determined to need correction. The correction targets are modified by pre-setting thresholds for the mean edge response, normalized edge response, 8-bit grayscale difference, normalized grayscale difference, grayscale difference coefficient of variation, endpoint distance, and orientation angle, with the values ranging from 0.3 to 0.8, 0.2 to 0.5, 5 to 60 8-bit grayscale levels, 0.05 to 0.30, 0.2 to 0.6, 2 to 15 pixels, and 15° to 60°, respectively. For local edge response values lower than the mean edge response of the entire image, or normalized edge response values lower than the normalized edge response threshold, but not within the image... For regions where the grayscale difference is not lower than the 8-bit grayscale difference threshold or the normalized grayscale difference threshold, and the coefficient of variation of the internal and external grayscale differences at 3 to 10 consecutive boundary sampling points is not higher than the grayscale difference coefficient of variation threshold, the boundary is adjusted along the local maximum gradient direction; broken edges with endpoint distances less than the endpoint distance threshold and directional angles less than the directional angle threshold are connected; edges that are not adjacent to low grayscale pore candidate regions are removed; isolated noise or pores inside the pores are morphologically filled or removed to suppress pseudo-pore regions caused by mineral textures, shadow effects, or noise, resulting in a corrected initial binary segmentation result; Low-confidence candidate pore targets are screened from low-confidence targets or the corrected initial binary segmentation results; a classification confidence threshold and a low contrast factor threshold are preset, with values ranging from 0.5 to 0.8 and 0.2 to 0.6, respectively; the screened candidate pore targets meet one or more of the following conditions, including: classification confidence is lower than the classification confidence threshold; simultaneously satisfying two or more classification rules (classification rules when classifying and extracting target pores based on spatial relationships); having overlapping gray-level features and similar morphological features; located in complex boundary regions, i.e., regions where mineral particles, organic matter, clay flaky structures, or microcracks intersect and the boundaries are discontinuous; low-contrast regions, i.e., regions where the gray-level difference between pores and matrix is lower than the low contrast factor threshold of the average gray-level difference between pores and matrix in the entire image; and multiphase mixed regions, i.e., regions where the gray-level and texture of at least two types of minerals or organic matter overlap within a local window. The system outputs magnified images, boundary contours, area, roundness, aspect ratio, directionality, neighborhood gray-level gradient, and local structural features of the selected low-confidence candidate pore targets. It also receives expert constraint information in the image interaction interface (a software interface running on a computer or workstation, used to display candidate targets and their neighborhoods, providing options for selection, annotation, dropdown selection, or shortcut key input to obtain limited expert constraint information). This information includes whether the target has closed pore-like features, whether it has fractured and stretched features, whether it extends along bedding, lamellar structures, or weak surfaces, whether it is located in an organic matter accumulation zone, or whether it is located near the contact zone between organic matter and clay minerals. Finally, it classifies the target according to preset classification rules (based on spatial...). The classification rules for target pore extraction and expert constraint information are used to correct the category of low-confidence candidate pore targets (the correction is automatically completed in ImageJ software; if the expert constraints show that the target has a closed bubble-like shape and is located in an organic matter accumulation area, it is preferentially corrected to an organic matter fracture pore; if the target shows that it extends along the direction of bedding or weak surface and is slender, it is corrected to an organic fracture or inorganic fracture by combining grayscale and morphology; if the target shows that it is located near the contact zone between organic matter and clay minerals, it is preferentially corrected to an organic clay composite pore; if the target shows that it is located between mineral particles, it is corrected to an intergranular pore; if the target shows that it is located inside a single particle, it is corrected to an intragranular pore). The corrected initial binary segmentation results are subjected to connected component analysis and pore instance labeling, including: classifying independent pore regions into individual pore instances (labeling unconnected pore regions with different object numbers); for adhered regions, instance splitting is performed using watershed segmentation, skeleton constraint separation, morphological separation, or curvature-assisted segmentation methods; combining the pixel scale calibration information of the preprocessed large-area view stitched image, one or more parameters of each pore instance are calculated, including area, perimeter, equivalent aperture, maximum Feret diameter, minimum Feret diameter, aspect ratio, roundness, shape factor, directional parameter, local thickness, and skeleton length, and the pixel scale is converted to the actual physical scale; the equivalent aperture D is calculated as follows: ; Where A is the area of the pore instance, and D is the diameter of the circle with the same area as the pore instance, i.e., the equivalent circle diameter; when the unit of A is μm², the unit of D is μm; when A is expressed in pixel area, it is first converted into the actual physical area according to the pixel scale calibration information before D is calculated. Statistical analysis was performed on all pore samples to obtain quantitative indicators such as the number of pores, pore porosity, pore size distribution, area distribution, aspect ratio distribution, roundness distribution, directional distribution, and the proportion of different types of pores.
[0049] The classification and statistical results are output in a unified manner and verified using one or more of the following methods: manual sampling, repeated identification, comparison with manual measurement results, and comparison with mercury intrusion porosimetry, gas adsorption, nuclear magnetic resonance, or thin section observation results. For abnormal targets, they are marked and prompted, and pore-matrix boundary enhancement and initial pore identification, classification extraction, or correction are performed again to improve the verifiability of the results.
[0050] Example 3 A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the quantitative characterization method for different types of shale porosity based on scanning electron microscope images as described in Embodiment 1 or 2.
[0051] Example 4 A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for quantitative characterization of different types of shale porosity based on scanning electron microscope images as described in Embodiment 1 or 2.
[0052] Example 5 A quantitative characterization system for different types of shale pores based on scanning electron microscopy images includes: The image acquisition module is configured to: acquire scanning electron microscope images, large-area field-of-view mosaic images, and mineral scanning images of the shale sample to be analyzed; and preprocess the large-area field-of-view mosaic images. The initial pore recognition module is configured to: acquire the edge response map of a large-area view spliced image, perform pore-matrix boundary enhancement and initial pore recognition on the edge response map, and obtain the comprehensive boundary enhancement result and the initial binary segmentation result of the target pore region; The classification and correction module is configured to: determine the availability of the mineral scan image; if the mineral scan image meets the availability requirements, spatially register the preprocessed large-area view mosaic image with the mineral scan image, and analyze the spatial relationship between the boundary and neighborhood of each target pore region and the mineral components in the initial binary segmentation result, and classify and extract the target pores based on the spatial relationship. Otherwise, the initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected. Output the image results or correction results of different types of pores extracted by classification.
Claims
1. A method for quantitative characterization of different types of pores in shale based on scanning electron microscopy images, characterized in that, include: Step 1: Acquire scanning electron microscope (SEM) images, large-area field-of-view mosaic images, and mineral scanning images of the shale sample to be analyzed; and preprocess the large-area field-of-view mosaic images. Step 2: Obtain the edge response map of the large-area view stitched image, perform pore-matrix boundary enhancement and initial pore identification on the edge response map, and obtain the comprehensive boundary enhancement result and the initial binary segmentation result of the target pore region; Step 3: Determine the usability of the mineral scanning image. If the mineral scanning image meets the usability requirements, spatially register the preprocessed large-area view stitched image with the mineral scanning image, and analyze the spatial relationship between the boundary and neighborhood of each target pore region and the mineral components in the initial binary segmentation result. Based on the spatial relationship, classify and extract the target pores. Otherwise, the initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected. Output the image results or correction results of different types of pores extracted by classification.
2. The method for quantitative characterization of different types of shale pores based on scanning electron microscopy images according to claim 1, characterized in that, The specific implementation process of step 1 includes: The shale sample to be analyzed is prepared by one or more of the following methods: cutting, mounting, mechanical polishing, argon ion polishing, and conductive coating, so that the surface of the shale sample meets the requirements for scanning electron microscopy (SEM) imaging. The prepared shale sample is then placed under a scanning electron microscope for observation and imaging to obtain the SEM image of the shale sample. In the scanning electron microscope (SEM) image, select the region of interest, which is the area on the surface of the shale sample to be analyzed that represents the porosity development characteristics of the target layer or target lithofacies. This includes one or more of the following: organic matter enrichment bands, clay mineral enrichment areas, rigid mineral grain enrichment areas, bedding development areas, microcrack development areas, and transition zones. At the same time, avoid polishing scratches, chipping, contamination, edge breakage, and areas with severe charging. Among them, the particle boundary drift threshold, gray standard deviation multiple threshold, and gray difference multiple threshold are preset, with values ranging from 5 to 20 pixels, 1.5 to 3.0, and 0.2 to 0.6, respectively. Areas with severe charging are indicated by the appearance of continuous bright spots, bright bands, or dark bands in a local area and the pixel area accounting for 5% to 30% of the local window area, or the drift of the same particle boundary position between adjacent repeated scan frames is greater than the particle boundary drift threshold, or the local gray standard deviation is higher than the gray standard deviation multiple threshold of the gray standard deviation of the adjacent normal area and is accompanied by boundary distortion, or the gray difference between pores and matrix in a local area is lower than the gray difference multiple threshold of the average gray difference between pores and matrix in the whole image. Backscattered electron imaging was performed on the region of interest, and the surface of the shale sample to be analyzed was scanned in a regular grid, that is, the region of interest was divided into M×N adjacent fields of view. Multiple adjacent images were acquired one by one in a fixed row and column order, and 5% to 30% overlap was retained between adjacent fields of view. The multiple adjacent images obtained by scanning were stitched together to form a large-area field-of-view stitched image. After sample preparation, the shale samples to be analyzed are subjected to surface scanning, matrix scanning or point-by-point elemental analysis to obtain the elemental composition information at each location. Combined with the grayscale characteristics, mineral morphology characteristics and element combination discrimination rules of backscattered images, i.e., large-area field-of-view mosaic images, mineral scanning images of the corresponding areas are established with respect to the scanning electron microscope images. Preprocessing of large-area visual field stitched images includes one or more operations such as image denoising, grayscale normalization and brightness correction, local contrast enhancement, background correction and stitching boundary smoothing, scale unification and pixel calibration.
3. The method for quantitative characterization of different types of shale pores based on scanning electron microscopy images according to claim 2, characterized in that, Creating mineral scanning images of the regions corresponding to the scanning electron microscope images, including: Mineral scan images include elemental distribution maps, mineral classification images, and mineral composition images; The elemental surface distribution map was obtained by using a scanning electron microscope and an energy dispersive spectrometer. This included: simultaneously collecting X-ray counts of features while traversing the region of interest by pixel or scan step size, and generating two-dimensional intensity maps or content maps of one or more elements among C, O, Si, Al, K, Na, Ca, Mg, Fe, S, and Ti after energy dispersive spectrometry, background subtraction, and peak overlap correction. Normalization and noise suppression were then performed to obtain the elemental surface distribution map. Pixels or superpixels in the elemental distribution map are assigned to corresponding mineral components, including: regions with high C and varying enrichment of Si, Al, Ca, Fe, and S are classified as organic matter; regions with high Si, presence of O, and low levels of Al, K, Na, Ca, Mg, and Fe are classified as quartz; regions with high Si and Al and enrichment of K, Na, or Ca are classified as feldspar, with K enrichment classified as potassium feldspar and Na or Ca enrichment classified as plagioclase; regions with simultaneous enrichment of Al and Si, and at least one of K, Mg, or Fe, exhibiting platy or flocculent morphology, are classified as clay minerals; regions with co-enrichment of Fe and S are classified as pyrite; regions with high Ca, presence of C and O, low Mg, and low levels of Si and Al are classified as calcite; regions with co-enrichment of Ca and Mg and presence of C and O are classified as dolomite; T Regions with high concentrations of element i are classified as ilmenite or rutile-type titanium-bearing minerals; regions co-enriched with Ba and S are classified as barite; regions co-enriched with Ca and P are classified as apatite; regions that do not meet the above rules or contain multiple mineral mixtures are marked as undetermined components or mixed components; wherein, a high threshold for the first element, a high multiple threshold for the second element, a low threshold for the first element, and a low multiple threshold for the second element are preset, with values ranging from 0.55 to 0.85, 0.5 to 2.0, 0.15 to 0.45, and 0.5 to 1.5 respectively; high element means that the normalized element intensity is greater than the high threshold for the first element, or greater than the product of the current field mean of the element plus the high multiple threshold for the second element and the standard deviation; low element means that the normalized intensity is less than the low threshold for the first element, or less than the product of the current field mean of the element minus the low multiple threshold for the second element and the standard deviation; Each pixel or superpixel is assigned to a corresponding mineral component and then labeled accordingly to obtain a mineral classification image. The mineral classification image is corrected using the label-controlled watershed algorithm to obtain a mineral composition image.
4. The method for quantitative characterization of different types of shale pores based on scanning electron microscopy images according to claim 3, characterized in that, By employing one or more of Gaussian scale space, wavelet decomposition scale space, or image pyramid methods, smoothing filters or multi-resolution decomposition with different scale parameters are applied to the preprocessed large-area view stitched image to obtain images with multiple scale layers. Edge response maps are obtained by using edge detection operators on images at multiple scales to extract regions with significant gray-level changes, i.e., regions whose gradient magnitude is greater than 1.0 to 3.0 times the average gradient magnitude of the entire image, or regions greater than the 60% to 95th percentile of the gradient magnitude distribution; where the edge detection operator is the Canny operator, Sobel operator, Laplacian operator, or LoG operator. To suppress false edges caused by noise, mineral textures, or shadow effects, the edge response map is constrained and screened, including: pre-setting a normalized edge response threshold, an edge response mean multiple threshold, and an edge response quantile threshold, with values ranging from 0.2 to 0.6, 1.0 to 3.0, and 60% to 95%, respectively; pixels with edge response values not lower than the normalized edge response threshold, or not lower than the edge response mean multiple threshold, or not lower than the edge response quantile threshold are designated as edge pixels, and edge pixels or edge chains formed by connecting edge pixels are designated as candidate edges; Local grayscale mean and gradient direction are obtained on both sides of the candidate edge within a width of 1-5 pixels. Only candidate edges that are adjacent to low grayscale aperture candidate areas on one side and adjacent to matrix areas on the other side are retained. Specifically, this includes: pre-setting an 8-bit grayscale difference threshold, a normalized grayscale difference threshold, a low grayscale standard deviation multiple threshold, and a low grayscale quantile threshold. The values of these four thresholds are 5-60 8-bit grayscale levels, 0.05-0.30, 0.5-1.5, and 5%-40%, respectively. 60%-90% of the pixels within a 1-5 pixel buffer zone along the normal direction of the candidate edge are considered to have a grayscale mean and gradient direction. In a low grayscale aperture candidate region, if 50% to 90% of the pixels within a 1-5 pixel buffer band along the opposite normal direction do not belong to the low grayscale aperture candidate region, and the difference between the average grayscale of the opposite normal buffer band and the average grayscale of the low grayscale aperture candidate region is not lower than the 8-bit grayscale difference threshold or the normalized grayscale difference threshold, the corresponding candidate edge is preserved; wherein, the low grayscale aperture candidate region refers to the region within a local window whose grayscale value is lower than the window mean minus the product of the low grayscale standard deviation multiple threshold and the standard deviation, or the region whose grayscale value is lower than the grayscale value corresponding to the low grayscale quantile threshold; The connectivity, continuity, and closure trend of the retained candidate edges are analyzed, and an edge chain length threshold is preset, the value of which ranges from 3 to 30 pixels; candidate edges that are retained with an edge chain pixel count or edge chain polygonal arc length not less than the edge chain length threshold, smooth directional changes, and form a local closed contour with the low grayscale aperture candidate area; A short edge length threshold is preset, and the value of the short edge length threshold is in the range of 3 to 10 pixels; candidate edges with a length less than the short edge length threshold and that do not participate in the closure of any low grayscale pore candidate area outer contour, particle internal texture edges, and candidate edges that lack spatial correspondence with the low grayscale pore candidate area are eliminated; After constraints and filtering, the final edge response map is obtained. The final edge response map is then fused, including one or more of the following: pixel-level maximum response fusion, weighted summation fusion, logical joint fusion, or multi-scale consistency fusion. After fusion, combined with morphological connectivity, broken edge repair, and local closure enhancement, a comprehensive boundary enhancement result is formed, namely the pore-matrix boundary enhancement result. After obtaining the comprehensive boundary enhancement results, candidate aperture regions are identified in the preprocessed large-area view-field stitched image. This includes: performing threshold segmentation, region growing, edge-guided segmentation, machine learning segmentation, or deep learning segmentation model on the preprocessed large-area view-field stitched image to obtain the initial binary segmentation results of the target aperture regions. The initial binary segmentation results of the target aperture regions include one or more of the following: aperture region location, boundary contour, connected region information, and target confidence. The connectivity, continuity, and closure tendency of the retained candidate edges are analyzed, including: Connectivity analysis uses 8-neighbor connectivity tracing, which treats adjacent edge pixels in the horizontal, vertical, and diagonal directions as connected and assigns the same edge chain number to connected edge pixels. Continuity analysis involves calculating the distance between the endpoints of candidate edges and the angle between their directions. Pre-set thresholds for endpoint distance and tangent direction angle, with values ranging from 2 to 15 pixels and 15° to 60°, respectively. When the distance between two endpoints is less than the endpoint distance threshold, and the angle between the tangent directions at the endpoints is also less than the tangent direction angle threshold, the two candidate edges are considered continuous. Here, a segment endpoint represents a pixel in an edge chain that has only one 8-neighbor connection. Closure trend analysis calculates the overlap rate between candidate edges and the outer contour of low-grayscale aperture candidate areas, the closure distance between segment endpoints, and the enclosed area of edge chains. The outer contour of the low-grayscale aperture candidate area represents the outermost boundary contour extracted from each considered connected region after connectivity analysis. The overlap rate is the proportion of edge pixels within a 1-5 pixel range from the outer contour of the low-grayscale aperture candidate area to the total number of pixels in the edge chain. The closure distance is the shortest distance between adjacent segment endpoints or between a segment endpoint and the break in the outer contour of the low-grayscale aperture candidate area. The enclosed area of the edge chain represents the area enclosed by the closed contour formed by the edge chain. The target confidence level is C0 = a1P + a2B + a3G + a4M; where P represents the porosity probability, B represents the boundary closure, G represents the low grayscale consistency, M represents the morphological rationality, and a1 to a4 represent the weights and sum to 1. Wherein, the porosity probability P is the probability that a pixel output by threshold segmentation, machine learning model, or deep learning model belongs to a porosity; the boundary closure B is the proportion of the contour length supported by the comprehensive boundary enhancement result in the porosity contour to the total contour length, or 1 minus the ratio of the length of the unclosed gap to the total length of the porosity contour; and the low grayscale consistency G is the proportion of the pixel area satisfying the low grayscale threshold in the porosity region to the porosity area, where the low grayscale threshold is the 5% to 40% quantile of the grayscale distribution of the entire image, or the local window grayscale mean minus 0.5 to 2.
0. The local grayscale standard deviation is multiplied by 1; the morphological rationality M is the degree to which the target morphological parameters fall within the labeled sample or the preset threshold range. The first aspect ratio threshold, roundness threshold, and skeleton thickness ratio threshold are preset, and their values range from 3 to 5, 0.2 to 0.6, and 5 to 10, respectively. The morphological threshold range for hole-type targets is that the aspect ratio is less than the first aspect ratio threshold, the roundness is not less than the roundness threshold, and the ratio of skeleton length to local thickness is less than the skeleton thickness ratio threshold. The morphological threshold range for slit-type targets is that the aspect ratio is not less than the first aspect ratio threshold, or the ratio of skeleton length to local thickness is not less than the skeleton thickness ratio threshold.
5. The method for quantitative characterization of different types of shale pores based on scanning electron microscopy images according to claim 4, characterized in that, The usability of the mineral scan image is determined. If the mineral scan image meets the usability requirements, spatial registration is performed between the preprocessed large-area view mosaic image and the mineral scan image. The spatial relationships between the boundaries and neighborhoods of each target pore region and the mineral components in the initial binary segmentation results are analyzed, including: The usability of mineral scan images is determined by one or more of the following conditions: (1) The mineral scanning image and the preprocessed large-area field-of-view mosaic image have an overlap or correspondence in the field of view, that is, they contain the same mineral grain boundaries, the same bedding structure, the same cracks or the same artificial control points, and the overlapping area is not less than 50% to 100% of the target analysis area of the preprocessed large-area field-of-view mosaic image; (2) The mineral scan image has clear mineral boundaries or mineral classification information, that is, the main mineral categories can be distinguished. The mineral boundary deviation threshold, the effective classification area ratio threshold, and the main mineral area ratio threshold are preset, and the values of the three are 1 to 20 pixels, 70% to 95%, and 5% to 10%, respectively. The average deviation between the mineral boundary and the corresponding mineral boundary in the backscattered image does not exceed the mineral boundary deviation threshold, and the effective classification area ratio of the main mineral category is not lower than the effective classification area ratio threshold. Among them, the main mineral categories include one or more of organic matter, clay minerals, quartz, feldspar, pyrite, calcite, and dolomite, or mineral categories whose area ratio in the target analysis area is not lower than the main mineral area ratio threshold. (3) The resolution, pixel scale, or imaging quality of the mineral scan image meets the requirements of registration analysis; the pixel size multiple threshold, the minimum mineral tag pixel number threshold, the dominant mineral area ratio threshold, the classification confidence threshold, and the dominant mineral area ratio difference threshold are preset, with the values ranging from 1 to 20, 2 to 5 pixels, 50% to 90%, 0.5 to 0.9, and 5% to 20%, respectively; the pixel size of the mineral scan image is not greater than the product of the pixel size of the preprocessed large-area field-of-view stitched image and the pixel size multiple threshold, or after resampling, the minimum target pore boundary can be minimized. Neighborhood mineral components remain identifiable, meaning that within a neighborhood buffer zone extending 2–20 pixels outward from the minimum target pore or 5%–30% of the equivalent circle diameter, the number of mineral tag pixels is not less than the minimum mineral tag pixel count threshold, and the area proportion of the dominant mineral category is not less than the dominant mineral area proportion threshold or the classification confidence is not less than the classification confidence threshold; wherein, the dominant mineral category includes the mineral category with the highest area proportion within the neighborhood buffer zone and whose area proportion is higher than the dominant mineral area proportion difference threshold of other mineral categories, or the mineral category whose area proportion reaches the dominant mineral area proportion threshold; (4) Pre-set the threshold for the proportion of missing pixel area, the threshold for misalignment error and the threshold for the proportion of noise pollution area, with the values of the three being 1% to 20%, 1 to 20 pixels and 5% to 30%, respectively; the proportion of missing pixel area in the mineral scan image is less than the threshold for the proportion of missing pixel area, the misalignment error is less than the threshold for the misalignment error, and the proportion of noise pollution area is less than the threshold for the proportion of noise pollution area. If the scanned images meet the availability requirements, the mineral scanned images are preprocessed, including resampling, denoising, and label smoothing. One or more of the following methods—feature point registration, boundary contour registration, affine transformation, perspective transformation, and non-rigid correction—are used to spatially register the preprocessed large-area field-of-view stitched image and the mineral scan image. Simultaneously, the mineral grain boundaries, light-dark phase interfaces, feature textures, grain combination structures, or manually selected control points in the preprocessed large-area field-of-view stitched image and the mineral scan image are used as registration references to calculate the spatial registration error. This error is controlled within a preset threshold, or does not exceed 50% of the number of pixels corresponding to the minimum target pore recognition scale. After registration, the correspondence between the preprocessed large-area view mosaic image and the mineral scan image in a unified coordinate system is obtained; For each pore target in the initial binary segmentation result of the target pore region, the spatial relationship between the boundary and the neighborhood and the mineral components is analyzed. The spatial relationship includes one or more of the following: boundary contact relationship, neighborhood component proportion relationship, single component encirclement relationship, boundary relationship between two or more types of components, and structural direction relationship. The boundary contact relationships include the total length L of the pore boundary, the contact length Lo between the pore boundary and organic matter, the contact length Lc between the pore boundary and clay minerals, the contact length Lb between the pore boundary and rigid minerals, and the proportions of each contact length to the total boundary length, i.e., Ro=Lo / L, Rc=Lc / L, Rb=Lb / L; where Ro represents the contact ratio between the pore boundary and organic matter, Rc represents the contact ratio between the pore boundary and clay minerals, and Rb represents the contact ratio between the pore boundary and rigid minerals; rigid minerals include one or more of quartz, feldspar, pyrite, calcite, and dolomite. The proportion of neighboring components, including the area proportion of organic matter, clay minerals, rigid minerals and other mineral components in the pore neighborhood buffer zone; The single-component enclosure relationship includes whether a certain mineral component's area ratio within the pore neighborhood buffer reaches a preset area ratio threshold, or whether the contact ratio between the pore boundary and a certain mineral component reaches a preset contact ratio threshold; wherein, the preset area ratio threshold and the preset contact ratio threshold both range from 50% to 90%; The boundary relationship between two or more components includes whether the pore is located in the boundary zone where the contact ratio of at least two mineral components is not less than a preset component contact ratio threshold, and the distance from the centroid of the pore to the boundary line of the two mineral components does not exceed a preset boundary distance threshold; wherein, the preset component contact ratio threshold ranges from 10% to 30%, and the preset boundary distance threshold ranges from 2 to 20 pixels. Structural orientation relationships include the angles between the long axis of pores, the skeleton direction, or the direction of crack extension and the particle boundaries, bedding directions, or weak mineral structures; among them, weak mineral structures refer to the structural interfaces that form pore extensions in bedding planes, platy clay mineral arrangement planes, mineral cleavage planes, particle contact interfaces, or microcrack extension planes. The classification confidence score C = w1Cr + w2Cb + w3Cm + w4Cp; Cr is the rule matching degree, Cb is the boundary consistency score, Cm is the morphological consistency score, Cp is the model output probability, and w1 to w4 are the weights and their sum is 1. The rule matching degree is calculated based on the proportion of targets that satisfy the classification rules, i.e., Cr = m1 / n1, where n1 represents the number of classification discrimination conditions possessed by the target category, and m1 represents the number of classification discrimination conditions satisfied. A boundary proximity distance threshold is preset, with a value range of 1 to 5 pixels. The boundary consistency score is the proportion of the length of the pore contour that coincides with the comprehensive boundary enhancement result or is no more than the boundary proximity distance threshold from the comprehensive boundary enhancement result to the total length of the pore contour, with a value range of 0 to 1. The morphological consistency score is calculated based on the distance between the target's morphological parameters and the mean of the corresponding category samples, i.e., the target's area, aspect ratio, and circle. After normalization of the degree, skeleton length, local thickness, and directional parameters, a morphological feature vector X is constructed. The mean of the samples of the corresponding category is used to construct a reference vector μ. The degree of morphological deviation is characterized by Euclidean distance, Mahalanobis distance, or weighted distance d(X,μ). Then, it is converted into a score in the range of 0 to 1 by Cm=exp[-d(X,μ)] or Cm=1 / [1+d(X,μ)]. The output probability of the classification model represents the pore classification probability obtained by inputting the pore local image patch, the initial binary segmentation result, the pore edge response map, the local gray-level statistical features, morphological parameters, texture features, neighborhood gray-level gradient features, and / or mineral scan image into the classification model.
6. The method for quantitative characterization of different types of shale pores based on scanning electron microscopy images according to claim 5, characterized in that, Target pores are classified and extracted based on spatial relationships; including: Based on the aspect ratio of the target pore morphology parameters, pores, i.e., target pores, are classified into pore-type targets and fracture-type targets. A first aspect ratio threshold, a roundness threshold, and a skeleton thickness ratio threshold are preset, with values ranging from 3 to 5, 0.2 to 0.6, and 5 to 10, respectively. These values are determined according to the image resolution of the shale sample to be analyzed, the development characteristics of the target pores and fractures, or labeled samples, and remain unchanged during the classification process of the same batch of images. Targets with an aspect ratio less than the first aspect ratio threshold, a roundness not less than the roundness threshold, and a skeleton length to local average thickness ratio less than the skeleton thickness ratio threshold are identified as pore-type targets. Targets with an aspect ratio not less than the first aspect ratio threshold, or a skeleton length to local average thickness ratio not less than the skeleton thickness ratio threshold, and which extend continuously in a certain direction, are identified as fracture-type targets. Among pore-type targets, at least two or more categories should be classified as organic-clay composite pores, organic matter rift pores, intergranular pores, and intragranular pores; among crack-type targets, at least one or two categories should be classified as organic cracks and inorganic cracks; the specific classification rules are as follows: Organic-clay composite pore: A first component ratio threshold is preset, and the value of the first component ratio threshold ranges from 10% to 30%; if the target pore is located near the contact zone between organic matter and clay minerals, and the boundary of the target pore is in contact with both organic matter and clay minerals, or the proportion of organic matter and clay minerals in the adjacent buffer zone is not lower than the first component ratio threshold, or the contact ratio of the two is not lower than the first component ratio threshold, then it is determined to be an organic-clay composite pore. Organic matter pyrolysis pores: A second component ratio threshold is preset, and the value of the second component ratio threshold ranges from 60% to 95%. If the pores are located inside the organic matter, that is, the proportion of organic matter area in the buffer zone of the pore region is not less than the second component ratio threshold, or the proportion of pore boundary in contact with organic matter Ro is not less than the second component ratio threshold, and the pore morphology is isolated pore, honeycomb, bubble pore or pyrolysis-derived pore, then it is determined to be an organic matter pyrolysis pore. Intergranular pores: If a pore is located between the boundaries of two or more mineral particles, and the pore boundary is in contact with multiple mineral particles, and it is in the form of intergranular gaps or boundary-type irregular pores, then it is determined to be an intergranular pore. Intragranular pores: Pre-set intragranular pore contact ratio threshold and intragranular pore neighborhood area ratio threshold, both ranging from 60% to 95%; if a pore is located inside a single inorganic mineral particle, and the contact ratio between the pore boundary and the same inorganic mineral is not lower than the intragranular pore contact ratio threshold, and the mineral area ratio within the pore neighborhood buffer is not lower than the intragranular pore neighborhood area ratio threshold, then it is determined to be an intragranular pore; Organic seam: Pre-set thresholds for organic seam aspect ratio, organic matter contact ratio, and organic matter boundary distance, with values ranging from 3 to 5, 50% to 90%, and 2 to 20 pixels, respectively; if the pores are elongated and connected, the organic seam aspect ratio is not lower than the organic seam aspect ratio threshold, and Ro is not lower than the organic matter contact ratio threshold, or the average distance between the pore skeleton and the organic matter boundary does not exceed the organic matter boundary distance threshold, then it is determined to be an organic seam; Inorganic fracture: The inorganic fracture aspect ratio threshold, inorganic component contact ratio threshold, and directional angle threshold are preset, with the values ranging from 3 to 5, 50% to 95%, and 0° to 30°, respectively. If the pore is located inside an inorganic mineral, at the boundary of an inorganic mineral, or between multiple inorganic particles, and is elongated and connected, extending along the weak surface of the mineral structure, the particle boundary, or the direction of the fracture, and the inorganic fracture aspect ratio is not lower than the inorganic fracture aspect ratio threshold, and Rc+Rb is not lower than the inorganic component contact ratio threshold, or the angle between the pore skeleton and the inorganic mineral boundary, the bedding direction, or the particle boundary direction does not exceed the directional angle threshold, then it is determined to be an inorganic fracture. When the contact ratio between the pore boundary and a certain component exceeds 70%, it is determined to be a component-dominated pore type; when the contact ratio between at least two types of components exceeds 20%, it is determined to be a boundary type, composite type, or interparticle pore. When the primary criterion, namely spatial relationship conflict, is not met or the unique determination condition is not satisfied, correction is made by combining the proportion of components in the neighborhood buffer and the boundary consistency score. Pre-set thresholds for contact ratio dominance difference, contact ratio dominance, boundary consistency, boundary consistency dominance difference, and contact ratio proximity are used, with values ranging from 5% to 20%, 50% to 90%, 0.5 to 0.9, 0.05 to 0.20, and 5% to 20%, respectively. If the contact ratio at the pore boundary is inconsistent with the proportion of components in the neighborhood buffer, the category with a contact ratio higher than the contact ratio dominance difference threshold for other categories, or a contact ratio reaching the contact ratio dominance threshold, and a boundary consistency score not lower than the boundary consistency threshold or higher than the boundary consistency dominance difference threshold for other categories, is retained. If the contact ratio difference between two categories is less than the contact ratio proximity threshold, the category with the larger component proportion in the neighborhood buffer is used as the corrected category. If a determination still cannot be completed, the target is marked as a low-confidence target.
7. The method for quantitative characterization of different types of shale pores based on scanning electron microscopy images according to claim 6, characterized in that, The initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected; including: Based on the comprehensive boundary enhancement results, the consistency of the boundaries in the initial binary segmentation results of the target pore region is checked, including: calculating the overlap rate between the pore contour (i.e., the pore boundary) and the comprehensive boundary enhancement results; the average boundary response value (i.e., the average value of the edge response values in the 1-3 pixel neighborhood corresponding to the pore contour); the boundary closure degree; and the inner-outer grayscale difference (i.e., the average grayscale difference between the inner 1-5 pixel buffer zone and the outer 1-5 pixel buffer zone along the normal direction of the pore boundary). A boundary overlap rate threshold and a boundary closure degree threshold are preset, with values ranging from 30% to 80% and 0.3 to 0.8, respectively. If the overlap rate between the pore contour and the enhanced boundary is lower than the boundary overlap rate threshold, or the boundary closure degree is lower than the boundary closure degree threshold, then the target is determined to need correction. The correction targets are adjusted by: pre-setting thresholds for the mean edge response value, normalized edge response value, 8-bit grayscale difference value, normalized grayscale difference value, grayscale difference coefficient of variation value, endpoint distance value, and orientation angle value. The value ranges for these seven values are 0.3–0.8, 0.2–0.5, 5–60 8-bit grayscale levels, 0.05–0.30, 0.2–0.6, 2–15 pixels, and 15°–60°, respectively. For local edge response values lower than the mean edge response value of the entire image, or normalized edge response values lower than the mean edge response value, the correction is applied. For regions where the grayscale difference between the inner and outer edges is not lower than the 8-bit grayscale difference threshold or the normalized grayscale difference threshold, and the coefficient of variation of the inner and outer grayscale difference at 3 to 10 consecutive boundary sampling points is not higher than the grayscale difference coefficient of variation threshold, the boundaries are adjusted along the local maximum gradient direction; broken edges with endpoint distances less than the endpoint distance threshold and directional angles less than the directional angle threshold are connected; edges that are not adjacent to low-grayscale pore candidate regions are removed; isolated noise or holes inside the pores are morphologically filled or removed to obtain the corrected initial binary segmentation result; Low-confidence candidate pore targets are screened from low-confidence targets or the corrected initial binary segmentation results; a classification confidence threshold and a low contrast factor threshold are preset, with values ranging from 0.5 to 0.8 and 0.2 to 0.6, respectively; the screened candidate pore targets meet one or more of the following conditions, including: classification confidence is lower than the classification confidence threshold; simultaneously satisfying two or more classification rules; having overlapping gray-level features and similar morphological features; located in complex boundary regions, i.e., regions where mineral particles, organic matter, clay flaky structures, or microcracks intersect and the boundaries are discontinuous; low-contrast regions, i.e., regions where the gray-level difference between pores and matrix is lower than the low contrast factor threshold of the average gray-level difference between pores and matrix in the entire image; and multiphase mixed regions, i.e., regions where the gray-level and texture of at least two types of minerals or organic matter overlap within a local window. The system outputs magnified images, boundary contours, area, roundness, aspect ratio, directionality, neighborhood grayscale gradient, and local structural features of the selected low-confidence candidate porosity targets. It also receives expert constraint information in the image interaction interface, including whether the targets possess closed pore-like features, fractured and stretched features, whether they extend along bedding, lamellar structures, or weak surfaces, whether they are located in organic matter accumulation zones, or near the contact zone between organic matter and clay minerals. Based on preset classification rules and expert constraint information, the system completes the category correction for the low-confidence candidate porosity targets. The corrected initial binary segmentation results are subjected to connected component analysis and pore instance labeling, including: classifying independent pore regions into individual pore instances; for adhered regions, instance splitting is performed using watershed segmentation, skeleton constraint separation, morphological separation, or curvature-assisted segmentation methods; combining the pixel scale calibration information of the preprocessed large-area view stitched image, one or more parameters of each pore instance are calculated, including area, perimeter, equivalent aperture, maximum Feret diameter, minimum Feret diameter, aspect ratio, roundness, shape factor, directional parameter, local thickness, and skeleton length, and the pixel scale is converted into the actual physical scale; the equivalent aperture D is calculated as follows: ; Where A is the area of the pore instance, and D is the diameter of the circle with the same area as the pore instance, i.e. the equivalent circle diameter; statistical analysis of all pore instances yields quantitative indicators such as the number of pores, pore porosity, pore size distribution, area distribution, aspect ratio distribution, roundness distribution, directional distribution, and the proportion of different types of pores in the sample. The classification and statistical results are output in a unified manner, and are verified by one or more of the following methods: manual sampling, repeated identification, comparison with manual measurement results, and comparison with mercury porosimetry, gas adsorption, nuclear magnetic resonance or thin section observation results. For abnormal targets, they are marked and prompted, and the pore-matrix boundary enhancement and initial pore identification, classification extraction or correction are carried out again.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the quantitative characterization method for different types of shale porosity based on scanning electron microscope images as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the quantitative characterization method for different types of shale porosity based on scanning electron microscope images as described in any one of claims 1-7.
10. A quantitative characterization system for different types of shale pores based on scanning electron microscopy images, characterized in that, include: The image acquisition module is configured to: acquire scanning electron microscope images, large-area field-of-view mosaic images, and mineral scanning images of the shale sample to be analyzed; and preprocess the large-area field-of-view mosaic images. The initial pore recognition module is configured to: acquire the edge response map of a large-area view spliced image, perform pore-matrix boundary enhancement and initial pore recognition on the edge response map, and obtain the comprehensive boundary enhancement result and the initial binary segmentation result of the target pore region; The classification and correction module is configured to: determine the availability of the mineral scan image; if the mineral scan image meets the availability requirements, spatially register the preprocessed large-area view mosaic image with the mineral scan image, and analyze the spatial relationship between the boundary and neighborhood of each target pore region and the mineral components in the initial binary segmentation result, and classify and extract the target pores based on the spatial relationship. Otherwise, the initial binary segmentation results of the target pore region are verified and corrected, and low-confidence candidate pore targets are screened and corrected. Output the image results or correction results of different types of pores extracted by classification.