A lithology identification method and system based on local inference type knowledge matching

CN122676206BActive Publication Date: 2026-10-13SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611183945.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-10-13
Estimated Expiration
2046-08-06

AI Technical Summary

Technical Problem

现有深度学习模型通常作为“黑箱”使用,仅输出岩性类别及概率,难以给出如“粒度级别、分选、结构构造、层理特征、胶结特征、矿物线索”等地质领域专家可理解、可复核的判别依据

Benefits of technology

(1)本发明不再单纯依赖深度学习模型的黑箱输出,而是引入了以岩性实体为核心、关联有规则实体和案例实体的地质知识图谱。在识别过程中,以图像识别模型输出的候选岩性集合作为检索入口,动态构建面向当前样本的候选局部推理子图,并在该子图内执行包括规则匹配和案例匹配在内的多维度知识匹配。通过将初始预测概率与知识匹配结果进行融合判别,本发明能够在输出岩性类别的同步提供可追溯的推理路径,明确给出支持证据或冲突证据。当遇到细砂岩与粉砂岩等图像纹理、颜色高度相似的岩性时,知识图谱中的区分规则和历史案例能够有效介入,有效降低误判率,并使输出结果具备地质专家可理解、可复核的判据表达。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122676206B_ABST
    Figure CN122676206B_ABST
Patent Text Reader

Abstract

The application provides a lithology identification method and system based on local reasoning knowledge matching, and belongs to the technical field of cross between artificial intelligence and geological engineering; the method comprises the following steps: obtaining a candidate lithology set and corresponding initial prediction probability from a standardized rock image through a preset lithology image identification model; taking the candidate lithology set as a search entry, merging a local subgraph dynamically associated with each candidate lithology in a geological knowledge graph into a candidate local reasoning subgraph, and performing knowledge matching in the candidate local reasoning subgraph; and combining the initial prediction probability output by the lithology image identification model and the knowledge matching result to perform lithology identification; according to the candidate lithology category and the image appearance semantic features, the size of the candidate lithology set is adaptively determined, and selective knowledge matching is performed through the construction of the candidate local reasoning subgraph, so that the accuracy of identification of different lithologies, especially similar lithologies, is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of artificial intelligence and geological engineering, and in particular relates to a lithology identification method and system based on local reasoning-based knowledge matching. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Lithology identification is a fundamental task in geological exploration, engineering geological evaluation, and core sample interpretation. With improved capabilities in acquiring image data such as core photographs and rock sample photographs, image-based automated lithology identification technology has become an important direction for improving interpretation efficiency. Currently, mainstream lithology image recognition methods mainly employ deep learning models such as convolutional neural networks and visual Transformers. Through end-to-end feature learning of image texture, color, and morphological structure, they directly output lithology classification results.

[0004] However, the aforementioned existing technologies generally suffer from the following technical problems: (1) Similar lithologies are easily confused and lack interpretability. Existing deep learning models are usually used as "black boxes," only outputting lithology categories and probabilities, making it difficult to provide criterion criteria that can be understood and verified by geological experts, such as "grain size level, sorting, structure, bedding features, cementation features, and mineral clues." Especially when two types of lithologies are highly similar in image texture and color (e.g., fine sandstone and siltstone), the model cannot reliably distinguish them based on high-level visual features alone, and cannot form a traceable reasoning path or provide clear refutation evidence, resulting in a high misjudgment rate and difficulty in verification.

[0005] (2) Insufficient robustness in cross-condition applications. Rock images are highly susceptible to changes in the acquisition environment, such as lighting conditions, photographic equipment, core surface humidity, and weathering degree. The image distribution of the same type of rock varies significantly under different conditions. However, existing deep learning models assume that the training data and test data follow the same independent and identically distributed distribution. When applied across domains (e.g., migrating from a standard laboratory shooting environment to field shooting), they often exhibit significant accuracy degradation and unstable output results, which are difficult to eliminate through simple threshold adjustment or fixed rule post-processing. Summary of the Invention

[0006] To overcome the shortcomings of the prior art, this invention provides a lithology identification method and system based on local reasoning-based knowledge matching. It can adaptively determine the size of the candidate lithology set according to the candidate lithology category and the semantic features of the image appearance, and perform selective knowledge matching by constructing candidate local reasoning subgraphs, which significantly improves the accuracy of identifying different lithologies, especially similar lithologies.

[0007] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: The first aspect of this invention provides a lithology identification method based on local reasoning-based knowledge matching.

[0008] A lithology identification method based on local reasoning-based knowledge matching includes: Obtain rock image data of the rock sample to be identified and preprocess it into a standardized rock image; Construct a geological knowledge graph with geological lithology entities as the core and multiple matching entities associated with them; A candidate lithology set and its corresponding initial prediction probability are obtained from the standardized rock image using a pre-constructed lithology image recognition model. Using the candidate lithology set as the retrieval entry point, the local subgraphs dynamically associated with each candidate lithology in the geological knowledge graph are merged into a candidate local inference subgraph; knowledge matching is performed within the candidate local inference subgraph to obtain the knowledge matching result for each candidate lithology; the knowledge matching includes feature consistency matching, environmental constraint matching, rule matching, and case matching; The initial predicted probability output by the lithology image recognition model is fused and judged with the knowledge matching result to output the lithology recognition result.

[0009] Furthermore, the construction of the geological knowledge graph includes: A semantic representation technique based on rule mapping is used to first extract color, texture, grain and structural features from rock photographs with known lithological labels, and then map continuous visual features into discrete, interpretable semantic entities.

[0010] Furthermore, the lithological image recognition model adopts a multi-branch visual recognition network structure, including: an input layer, a backbone feature extraction network, an image appearance feature prediction branch, a feature fusion layer, and a classification output layer; wherein, the image appearance feature prediction branch is used to output at least one image appearance semantic feature among color category, texture coarseness, grain visibility, stratification visibility, surface density, and edge morphology.

[0011] Furthermore, the local subgraphs associated with each candidate lithology dynamic in the geological knowledge graph will be merged into a candidate local inference subgraph, including: After obtaining the candidate lithology set, image appearance feature nodes, attribute nodes, environment nodes, rule nodes, and case nodes that are directly related to and indirectly constrained by the candidate lithology are extracted in the geological knowledge graph around each candidate lithology. The relationships between these nodes that are related to the current discrimination task are retained to construct the candidate local reasoning subgraph corresponding to the candidate lithology.

[0012] Further, knowledge matching is performed within the candidate local reasoning subgraph, including: For samples lacking auxiliary geological information, candidate local inference subgraphs are constructed only around candidate lithology, image appearance features, rule nodes, and case nodes, and image appearance feature matching, rule matching, and case matching are performed, but environment matching is not performed. If any of the image appearance features are missing some attributes or the prediction confidence is lower than the preset confidence threshold, then matching is performed only on the available attributes that meet the confidence requirements, and the matching results are normalized.

[0013] Furthermore, the rule matching includes lithology discrimination rule matching, easily confused lithology differentiation rule matching, environmental constraint rule matching, and anomaly identification rule matching; wherein, each rule has a set of triggering conditions, rule weight, and rule confidence.

[0014] Furthermore, a lithology identification method based on local reasoning-based knowledge matching also includes a closed-loop update step, specifically: The output lithology identification results are compared with the manual verification results, and misidentified samples and low-confidence samples are identified. Error attribution analysis is performed on the misidentified samples and low-confidence samples. If the error is attributed to either insufficient image feature extraction or semantic prediction bias, the corresponding samples are used to perform incremental training and retraining of the lithology image identification model. If the error is attributed to either knowledge gaps or unreasonable relationships, the regular entities, case entities, and relationships between entities in the geological knowledge graph are updated.

[0015] A second aspect of the present invention provides a lithology identification system based on local reasoning-based knowledge matching.

[0016] A lithology identification system based on local reasoning-based knowledge matching includes: The rock sample processing module is configured to: acquire rock image data of the rock sample to be identified and preprocess it into a standardized rock image; The knowledge graph construction module is configured to: construct a geological knowledge graph with geological lithology entities as the core and multiple matching entities associated with it; The model building module is configured to: obtain a set of candidate lithologies and their corresponding initial prediction probabilities from the standardized rock images using a pre-built lithology image recognition model; The local reasoning-based knowledge matching module is configured to: use the candidate lithology set as the retrieval entry point, merge the local subgraphs that are dynamically associated with each candidate lithology in the geological knowledge graph into a candidate local reasoning subgraph; perform knowledge matching within the candidate local reasoning subgraphs to obtain the knowledge matching result for each candidate lithology; the knowledge matching includes feature consistency matching, environmental constraint matching, rule matching, and case matching; The lithology identification module is configured to fuse and discriminate the initial prediction probability output by the lithology image identification model with the knowledge matching result to output the lithology identification result; The closed-loop update module is configured to: compare the output lithology identification results with the manual verification results, and identify misidentified samples and low-confidence samples; and perform error attribution analysis and error correction on the misidentified samples and low-confidence samples.

[0017] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the steps of a lithology identification method based on local reasoning knowledge matching as described in the first aspect of the present invention.

[0018] The fourth aspect of the present invention provides an electronic device including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of a lithology identification method based on local reasoning knowledge matching as described in the first aspect of the present invention.

[0019] The above one or more technical solutions have the following beneficial effects: (1) This invention no longer relies solely on the black-box output of deep learning models, but instead introduces a geological knowledge graph centered on lithological entities and associated with regular entities and case entities. During the identification process, the candidate lithology set output by the image recognition model is used as the retrieval entry point to dynamically construct a candidate local reasoning subgraph for the current sample, and multi-dimensional knowledge matching, including rule matching and case matching, is performed within this subgraph. By fusing the initial prediction probability with the knowledge matching results, this invention can provide a traceable reasoning path simultaneously with the output lithology category, clearly providing supporting or conflicting evidence. When encountering lithologies with highly similar image textures and colors, such as fine sandstone and siltstone, the differentiation rules and historical cases in the knowledge graph can effectively intervene, effectively reducing the misjudgment rate and enabling the output results to have a criterion expression that can be understood and verified by geological experts.

[0020] (2) This invention abandons the existing method of global static retrieval of knowledge graphs, and instead adaptively constructs candidate local reasoning subgraphs based on the candidate lithology and image appearance semantic features output by the image recognition model. This subgraph can flexibly cope with the situation of incomplete information in actual engineering: for samples lacking auxiliary geological information, matching is performed only based on the available image appearance features, rules and cases; for cases where the confidence of some attributes of image appearance features is low, matching is performed only with attributes that meet the confidence requirements and normalization is performed. This dynamic and selective knowledge matching mechanism avoids the failure of fixed rules due to environmental changes (such as light, equipment, humidity, etc.). At the same time, the integration of conflict evidence penalty and strong support evidence enhancement mechanism in the discrimination process further suppresses the unstable output caused by cross-domain distribution differences. In addition, the closed-loop update step of this invention can feed back misidentified samples to the image recognition model for incremental training, or solidify the correction experience under new working conditions into rules and cases in the knowledge graph, so that the system has the ability to continuously adapt to the evolution of new scenarios, thereby effectively solving the problem of insufficient robustness across working conditions.

[0021] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0022] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0023] Figure 1 This is a flowchart of a lithology identification method based on local reasoning-based knowledge matching in Embodiment 1 of the present invention.

[0024] Figure 2 This is a flowchart of constructing a geological knowledge map in Embodiment 1 of the present invention.

[0025] Figure 3 This is a schematic diagram of the lithology identification model in Embodiment 1 of the present invention.

[0026] Figure 4 This is an architecture diagram of a lithology identification system based on local reasoning-based knowledge matching in Embodiment 2 of the present invention. Detailed Implementation

[0027] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0028] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.

[0029] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0030] Example 1 This embodiment discloses a lithology identification method based on local reasoning-based knowledge matching.

[0031] like Figure 1 As shown, a lithology identification method based on local reasoning-based knowledge matching includes: Step S1: Obtain rock image data of the rock sample to be identified and preprocess it into a standardized rock image; Step S2: Construct a geological knowledge graph with geological lithology entities as the core and multiple matching entities associated with it; Step S3: Obtain the candidate lithology set and the corresponding initial prediction probability from the standardized rock image using a pre-constructed lithology image recognition model; Step S4: Using the candidate lithology set as the retrieval entry point, merge the local subgraphs that are dynamically associated with each candidate lithology in the geological knowledge graph into a candidate local inference subgraph; perform knowledge matching within the candidate local inference subgraph to obtain the knowledge matching result for each candidate lithology; the knowledge matching includes feature consistency matching, environmental constraint matching, rule matching, and case matching; Step S5: The initial prediction probability output by the lithology image recognition model is fused and judged with the knowledge matching result to output the lithology recognition result.

[0032] Based on the above process, this invention can adaptively determine the size of the candidate lithology set according to the candidate lithology category and the semantic features of the image appearance, and significantly improve the accuracy of identifying different lithologies, especially similar lithologies, by constructing candidate local reasoning subgraphs for selective knowledge matching. To facilitate understanding of the technical solution of this invention, the specific implementation methods of this invention will be further explained and described below.

[0033] In step S1, rock image data of the rock sample to be identified is acquired and preprocessed into a standardized rock image.

[0034] Obtain rock image data of the rock sample to be identified. The rock image data is preferably a core photograph, a rock sample photograph, or a rock surface photograph. At the same time, it should be ensured that the rock image data can be used to characterize the rock characteristics such as color, texture, and surface features of the rock sample.

[0035] The acquired rock image data is preprocessed to obtain standardized rock image samples. Specifically: First, the original image is cropped to remove background panels, rulers, labels, and irrelevant edge areas. Then, threshold segmentation, edge detection, or region masking is used to extract the effective area to avoid background noise interfering with subsequent recognition results. Next, the image is scaled to a uniform size, with the effective area image scaled to a preset size of 256×256 pixels. Bilinear interpolation or bicubic interpolation is used for scaling to preserve as much detail as possible in the rock surface texture. To avoid severe distortion of the image aspect ratio during scaling, the image is first scaled to its original aspect ratio so that its long or short side reaches the preset scale, and then any insufficient parts are padded to a uniform size using edge padding or mirror padding. Color correction is performed on the image to reduce color shifts caused by differences in acquisition devices, lighting intensity, and white balance. Then, median filtering, Gaussian filtering, or image denoising enhancement are applied to suppress random noise and preserve rock texture boundaries. Finally, histogram equalization, contrast stretching, or brightness normalization methods are used to improve the local details and overall recognizability of the image, making the color differences, texture coarseness, particle distribution, and structural features of the rock surface more obvious.

[0036] In step S2, a geological knowledge graph is constructed with geological lithology entities as the core and multiple matching entities associated with them.

[0037] like Figure 2 As shown, firstly, multi-source knowledge data for constructing a geological knowledge map is collected, including public literature, industry standards, technical specifications, exploration reports, core logging data, rock sample description data, rock thin section identification data, experimental test data, manual judgment records, and expert experience rules.

[0038] Subsequently, regular expression text cleaning measures were used to preprocess the above data, specifically including removing headers and footers, deleting duplicate paragraphs, standardizing units of measurement, standardizing terminology, and retaining source tags. Then, the above data was further cleaned, duplicate content was removed, terminology was standardized, units were standardized, formats were standardized, and source tags were retained to form a standardized knowledge input set.

[0039] Based on this, attribute graph modeling is used to design the graph pattern. Specifically, Neo4j Desktop is used to complete the graph pattern design and subsequent visualization management. Taking lithological entities as the core, image appearance feature entities, attribute entities, environment entities, rule entities, and case entities are set up, and relationship types such as lithology-has-image appearance features, lithology-has-attributes, lithology-occurs in-environment, lithology-restricted by-rules, case-belongs to-lithology, rule-distinguishes-lithology pairs, and case-supports-rules are defined.

[0040] For structured data such as experimental test tables, statistical tables, and manually compiled tables, field mapping technology is used for knowledge extraction, mapping lithology, mineral composition, structure, grain size, and environmental information into entities and relationships in the atlas; Excel and Python Pandas are used to implement field reading, standardization, and mapping transformation.

[0041] For unstructured texts such as literature, reports, rock sample descriptions, and expert experience, named entity recognition technology is used for knowledge extraction, and HanLP is used for Chinese word segmentation, part-of-speech tagging, and named entity recognition. Lithological names, image feature terms, environmental terms, and empirical criteria are identified from the text and converted into entities and relationships in the atlas.

[0042] During the map construction process, image knowledge modeling was further performed on historical rock photograph samples. Specifically, a rule-based mapping-based semantic representation technique for appearance features was adopted. First, color, texture, grain, and structural features were extracted from rock photographs with known lithology labels. Then, continuous visual features were mapped into discrete, interpretable image appearance semantic entities. Color distribution, texture information, grain boundaries, and structural features in the rock photographs were extracted using OpenCV. The extracted results were then converted into appearance semantic entities such as "light gray," "dark gray," "yellowish brown," "uniform texture," "coarse texture," "fine texture," "fine grain," "medium grain," "coarse grain," "distinct grains," "distinct bedding," "dense surface," and "fragmented edges" using a Python rule mapping script. Subsequently, the image appearance semantic entities were written into the geological knowledge map and a "lithology-possess-image appearance feature" relationship was established with the corresponding lithology entities. At the same time, associations were established with rule entities and case entities, thereby transforming the low-level visual features in the rock photographs into map knowledge units that can be directly called upon for subsequent knowledge matching and reasoning correction.

[0043] After multi-source knowledge extraction is completed, all entities are standardized. Specifically, a unified terminology standard table is established, and synonymous or near-synonymous lithological names, image feature expressions, environmental terms, and rule names from different sources are uniformly coded, and duplicate entities are merged. Then, semantically consistent relationships from different sources are fused, and relationships with discrepancies are weighted according to source credibility, frequency of occurrence, case support, and expert confirmation results. If different relationships are applicable to different environmental conditions, conditional relationships are retained and assigned an applicability attribute.

[0044] After multi-source knowledge extraction and semanticization of image appearance features, edit distance matching technology is used to perform entity alignment, unified encoding, and merging of duplicate entities for synonymous or near-synonymous lithological names, image feature expressions, environmental terms, and rule names from different sources, and to complete relation fusion.

[0045] Finally, the geological knowledge graph undergoes quality verification and is then stored in the database. Neo4j graph database technology is preferred for storing the geological knowledge graph. Before storage, the graph is subjected to duplicate entity detection, isolated node detection, erroneous relationship detection, rule conflict detection, low-confidence relationship detection, and attribute integrity checks. For detected abnormal nodes or relationships, corrections are made through source tracing, sample comparison, and expert review. After verification, the geological knowledge graph is written into the Neo4j graph database, and lithology indexes, image feature indexes, environment indexes, rule indexes, and case indexes are established. This ultimately forms a lithology-oriented geological knowledge graph capable of serving rock image recognition result verification, candidate lithology reordering, and secondary inference correction of low-confidence samples.

[0046] In step S3, a set of candidate lithologies and their corresponding initial prediction probabilities are obtained from the standardized rock image using a pre-constructed lithology image recognition model.

[0047] like Figure 3 As shown, the lithology image recognition model adopts a multi-branch visual recognition network structure that combines convolutional neural networks with attention mechanisms, specifically including: 1) Input layer: used to receive standardized rock image samples.

[0048] 2) Backbone Feature Extraction Network: Used to extract multi-level visual features of rock images, specifically including initial convolutional layer, normalization layer, activation layer, downsampling layer and multi-level residual block, forming a three-level feature representation of shallow features, middle features and high-level features.

[0049] 3) Image appearance feature prediction branch: Connected to the mid-to-high-level features of the backbone feature extraction network, it is used to output one or more image appearance semantic features from color category, texture coarseness, graininess, layering clarity, surface density, and edge morphology.

[0050] 4) Feature Fusion Layer: Used to jointly express the high-level visual features output by the backbone feature extraction network and the semantic features output by the image appearance feature prediction branch.

[0051] 5) Classification output layer: The classification output layer is connected to the feature fusion layer and is used to output candidate lithology categories and their corresponding predicted probabilities.

[0052] In the specific implementation process, the input image first passes through the input layer and the backbone feature extraction network in sequence to obtain multi-level image features. The mid-to-high-level features output by the backbone feature extraction network are sent to the image appearance feature prediction branch to obtain image appearance semantic features, and to the feature fusion layer. Subsequently, the feature fusion layer concatenates and fuses the visual features and image appearance semantic features, and sends the fusion result to the classification output layer to obtain candidate lithology categories and their predicted probabilities.

[0053] A lithology image recognition model is trained using historical rock image samples with lithology labels, resulting in a trained lithology image recognition model that outputs a set of candidate lithology categories, corresponding predicted probabilities, and image appearance semantic features. The candidate lithology category set and image appearance semantic features serve as inputs for constructing candidate local reasoning subgraphs and knowledge matching, while the candidate lithology predicted probabilities serve as inputs for fusion discrimination.

[0054] In step S4, the candidate lithology set is used as the retrieval entry point. Local subgraphs that are dynamically associated with each candidate lithology in the geological knowledge graph are merged into candidate local inference subgraphs. Knowledge matching is performed within the candidate local inference subgraphs to obtain the knowledge matching result for each candidate lithology.

[0055] The lithology identification model outputs the model with the highest probability. Each lithological category is used as a candidate lithology set. ,in, Indicates the first One candidate lithology; This represents the preset number of candidates, the specific value of which is determined based on the identification results of the lithology identification model. The model prediction probability corresponding to each candidate lithology is denoted as... ,in, Indicates the first Candidate lithology The initial predicted probability. The image appearance feature prediction branch outputs the set of appearance semantic features of the sample to be identified. ,in, Indicates the first The image appearance features include color category, texture coarseness, graininess, layering, surface density, and edge fragmentation.

[0056] It should be noted that, in specific implementation, this invention does not perform a global search of all lithological knowledge in the geological knowledge map, but rather performs sample-level knowledge retrieval for the current sample to be identified. Therefore, this invention uses a candidate lithology set. As a knowledge retrieval entry point, and combined with the image appearance semantic features and auxiliary geological information actually available for the current sample, the geological knowledge graph is dynamically cropped and reconstructed to form a candidate local reasoning subgraph for the current sample. Specifically, after obtaining the candidate lithology set, for each candidate lithology, image appearance feature nodes, attribute nodes, environment nodes, rule nodes, and case nodes that are directly related to it and have indirect constraints are extracted from the geological knowledge graph. The relationships between these nodes that are relevant to the current discrimination task are retained, and the first... Candidate lithology The corresponding candidate local inference subgraph for: ; in, To indicate the first Candidate lithology Related node set, This represents the set of relationships between nodes in a node set. The set of relationships retains the following relationship types: Lithology - Has - Image Appearance Features, Lithology - Has - Attributes, Lithology - Occurs in - Environment, Rule - Acts on - Lithology, Rule - Contains Conditions - Image Appearance Features, Rule - Applies to - Environment, Case - Belongs to - Lithology, Case - Has - Image Appearance Features, and Case - Supports - Rule.

[0057] The candidate local reasoning subgraph is not only used to narrow down the search scope, but also serves as a dedicated knowledge space for subsequent knowledge matching and reasoning judgment. Within this subgraph, image appearance feature consistency matching, environmental constraint matching, rule trigger judgment, and historical case support judgment are completed.

[0058] The construction of candidate local inference subgraphs and knowledge matching are not based on the complete availability of all types of information, but rather on the actual available information of the current sample to be identified. For example, for samples lacking auxiliary geological information, candidate local inference subgraphs are constructed only around candidate lithology, image appearance features, rule nodes, and case nodes, and image appearance feature matching, rule matching, and case matching are performed, without performing environment matching. For cases where some attributes in the image appearance features are missing or the prediction confidence is low, matching is performed only on the available attributes that meet the confidence requirements, and the corresponding matching results are normalized.

[0059] Furthermore, the first Candidate lithology Image appearance feature set in geological knowledge graph Represented as: ; in, Indicates the first Candidate lithology The first in the geological knowledge map Image appearance features.

[0060] No. Candidate lithology Feature consistency score is represented as : ; in, Indicates the first The importance weight of each image appearance feature; Represents the feature matching function; Indicates the number of image appearance features. Represents the first sample to be identified Each image appearance feature. The feature matching function can be defined as: ; in, This represents the matching coefficient. Specifically, it takes a value of 1 for a complete match, 0 for a complete mismatch, and 0 for a partial match. between.

[0061] If the sample to be identified contains auxiliary geological information, such as stratigraphy, burial depth range, well number, sedimentary environment, or tectonic background, then environmental matching is further performed in the local sub-map of the candidate lithology. The purpose of this step is to determine whether the geological environment of the current sample to be identified is consistent with the common occurrence environment of a candidate lithology, thereby avoiding the image model from drawing results that clearly conflict with the geological background based solely on apparent features. The scoring method for this step is similar to that for apparent feature node matching.

[0062] After completing the appearance feature matching and environment matching, the system further retrieves rule nodes related to each candidate lithology in the local sub-map of the candidate lithology and determines whether the current sample to be identified meets the triggering conditions of these rules. The rules include lithology discrimination rules, rules for distinguishing easily confused lithologies, environmental constraint rules, and anomaly identification rules.

[0063] Specifically, no. Candidate lithology The relevant set of rules is ;in, Indicates the first Candidate lithology The corresponding number Rule 1 Indicates the first Candidate lithology The number of rules. Each rule has a set of triggering conditions, a rule weight, and a rule confidence level. Define the rule triggering function. The rules support the following score: ; ; in, Indicates the first Candidate lithology The corresponding rules support the scoring; For rule weights, The confidence level of the rule.

[0064] Beyond rule-based matching, we further utilize historical identification cases from the geological knowledge graph for similarity comparison. We compare the current sample to be identified with historically verified correct cases and corrected incorrect cases to determine whether the current sample is similar to typical cases of a certain type of lithology or to a known misjudgment pattern, thus providing empirical support for subsequent re-scoring.

[0065] No. Candidate lithology The collection of historical cases is ;in, Indicates the first Candidate lithology The A historical case, Indicates the first Candidate lithology The total number of corresponding historical cases.

[0066] Let the feature vector of the sample to be identified be denoted as . Case The feature vector is Therefore, the similarity between the two can be expressed using cosine similarity: ; in, express and The cosine similarity of the corresponding feature vectors.

[0067] Select the sample most similar to the current sample For each case, the case support score can be defined as: ;in, Indicates in the case set The sample most similar to the one to be identified Case study.

[0068] After the above steps, a knowledge matching result for the current sample is output for each candidate lithology. The knowledge matching result includes: image appearance feature consistency score, environment adaptation score, rule support score, and case support score for the candidate lithology, as well as supporting evidence and conflicting evidence obtained during the matching process. In this embodiment, supporting evidence includes: image appearance features consistent with the candidate lithology, environmental conditions consistent with the geological background, triggered supporting rules, and historical correct cases similar to the current sample; conflicting evidence includes: image appearance features inconsistent with the candidate lithology, environmental conditions conflicting with the geological background, triggered negative rules, and historical misjudgment amendment cases similar to the current sample. If the output result does not directly provide a final lithology conclusion for a certain part of the information, it is used as input for the fusion and discrimination of the geological knowledge graph and machine learning model in step S5.

[0069] In step S5, the initial predicted probability output by the lithology image recognition model is fused and judged with the knowledge matching result to output the lithology recognition result. This can be achieved through the following steps: Step S5-1, Lithology identification.

[0070] After receiving the model's predicted probabilities and knowledge matching results, the various supporting information from the geological knowledge graph is first weighted and fused. Considering that the samples to be identified may lack auxiliary geological information, some image appearance semantic features may be missing, or the corresponding matching results may be unavailable in real-world scenarios, this invention does not require all knowledge items to participate in the fusion simultaneously. Instead, it only performs normalized weighting on the knowledge support results that are actually available in the current sample. Specifically, the availability indicator variables for feature consistency, environment adaptation, rule support, and case support are respectively... , , and The value is 1 when the corresponding knowledge item is available and 0 when it is not available.

[0071] Based on this, the first Candidate lithology The corresponding comprehensive knowledge support score is expressed as follows: ; in, , , and These represent the weight coefficients for feature consistency, environment adaptation, rule support, and case support, respectively. , , and These represent the scores for feature consistency, environment adaptation, rule support, and case support, respectively. This approach allows the system to generate effective knowledge integration support results based on the remaining available information, even if the current sample to be identified lacks environmental or partial feature information.

[0072] After obtaining the knowledge integration support score, it is jointly re-scored with the initial predicted probability output by the image recognition model. The preliminary fusion score of the candidate lithology is expressed as: ; in, This represents the initial predicted probability of the model; This represents the balance coefficient between model probability and knowledge support. The optimal value of this balance coefficient can be selected through the validation set, or it can be dynamically adjusted based on the model confidence and knowledge support strength of the current sample.

[0073] Based on the initial fusion score, further penalty adjustments are made according to the conflict evidence set and conflict intensity corresponding to the candidate lithology. The conflict penalty term for the candidate lithology is expressed as follows: ; in, Indicates the amount of conflicting evidence regarding the apparent features of an image. Indicates the amount of evidence of environmental conflict. Indicates the number of pieces of evidence indicating a rule conflict. Indicates the number of conflicting pieces of evidence in a case; , , and These represent the penalty weights for the corresponding conflict sources. The overall score after candidate lithology correction is expressed as follows: ,in, This represents the conflict penalty coefficient.

[0074] To avoid diluting high-quality supporting evidence during the aforementioned weighting process, a support enhancement correction should be applied to strongly supporting candidate lithologies. Specifically, the support enhancement term for candidate lithologies is expressed as follows: ; in, To enhance weight, Indicate candidate lithology The enhanced support items. The enhanced overall score is expressed as follows: .

[0075] After completing knowledge-support weighting, model probabilistic fusion, conflict penalty, and support enhancement, all candidate lithologies are re-ranked according to the final comprehensive score. The final comprehensive score function is: The reordering result can be represented as: ; ; in, express The score, This indicates the order of scores from highest to lowest. Individual lithology.

[0076] After reordering the candidate lithologies, the fusion discrimination result of the current sample to be identified is output. The fusion discrimination result includes: the candidate lithology with the highest comprehensive score, the candidate lithology reordering result, the comprehensive score of each candidate lithology, the main supporting evidence set, and the main conflicting evidence set.

[0077] After calculating and re-ranking the candidate lithologies, a confidence assessment is further performed on the current sample. The current sample is classified as a low-confidence sample if any of the following conditions are met: or or or ; In the formula, This indicates that the candidate lithology ranked first had a low final comprehensive score, which was below the low score threshold. This indicates that the score difference between the first candidate and the second candidate is too small, resulting in low discrimination. This indicates that the model's output probability distribution has high information entropy. This indicates significant conflicts with evidence found in the knowledge graph. Among these, , , and These represent the low score threshold, low discrimination threshold, high entropy threshold, and high conflict threshold, respectively. Represents the model output probability distribution The information entropy is used to characterize the uncertainty of the model's prediction result for the current sample. If none of the above four conditions are met, the sample is judged as a high-confidence sample, and the candidate lithology with the highest comprehensive score is directly output as the final lithology identification result; for low-confidence samples, the candidate re-ranking result and its supporting evidence and conflicting evidence are passed to step S5-2 to perform secondary inference correction.

[0078] Step S5-2: After identifying low-confidence samples, the candidate lithology set is not reselected, nor is the local subgraph reconstructed. Instead, based on the constructed candidate local reasoning subgraph, the rules for distinguishing easily confused lithologies, environmental constraint rules, and historical misjudgment amendments related to the ranked candidate lithologies are further invoked to perform a more granular re-comparison, re-scoring, and re-ranking of the candidate lithologies.

[0079] No. The distinction rule applies to the first The support function and the distinction rule correction term for each candidate lithology are expressed as follows: ; ; in, Indicates the first The weight of each distinguishing rule; Indicates the first The distinction rule applies to the first Candidate lithology Support functions, Indicates the first Candidate lithology The distinction rule modification item.

[0080] In the secondary inference process for low-confidence samples, in addition to the image appearance discrimination rules, a further environmental constraint re-verification is performed. The environmental re-verification correction term is expressed as: ; in, Indicates the first The intensity of environmental conflict for each candidate lithology; Indicates the environmental support gain coefficient. Indicates the environmental conflict penalty coefficient; Indicates the first Environmental re-verification correction item for candidate lithologies.

[0081] After rule-based reasoning and environmental constraint re-verification, the historical correct cases and misjudged amendment cases in the geological knowledge graph are further invoked to perform a case-driven cosine similarity correction on the low-confidence samples.

[0082] After completing the reasoning for easily confused rules, re-validation of environmental constraints, and correction for similarity in historical cases, a comprehensive re-scoring of each candidate lithology in the low-confidence samples is performed. The final reasoning score is expressed as: ; in, Indicates the first Candidate lithology The final inference score in the secondary inference correction stage for low-confidence samples. , and These represent the weight coefficients for the distinction rule correction item, the environment re-validation correction item, and the historical case similarity correction item, respectively.

[0083] After completing the comprehensive re-scoring, the candidate lithologies in the candidate inference set are reordered according to their final inference scores, and the candidate lithology with the highest score is taken as the final correction result for the current low-confidence sample. When outputting the final correction result, the following inference basis is also output simultaneously: the main easily confused distinguishing rules triggered, key supporting appearance features, key environmental constraints, the most similar historical cases, and the changes in candidate categories and scores before and after correction.

[0084] Step S5-3: Compare the lithology identification results with the manual verification results, expert judgment results, experimental test results, or subsequent reveal results, and collect all process information related to the sample.

[0085] After collecting and identifying feedback, all samples are further screened, and misidentified samples, low-confidence samples, samples that have undergone secondary correction, and samples with strong conflicting evidence are included in the error database.

[0086] After constructing the error database, an error source attribution analysis was performed on each error sample. The error sources were classified into the following categories: insufficient image feature extraction error, image appearance and semantic prediction deviation error, rule missing error, unreasonable rule weight error, missing or inaccurate environmental constraints error, insufficient historical cases error, and image distribution offset error.

[0087] When error attribution results indicate that the error mainly stems from insufficient image feature extraction, insufficient local structure recognition, apparent semantic prediction bias, or image distribution shift, the machine learning image recognition model is updated. This is achieved by adding new error samples, strengthening the weights of difficult samples, or performing incremental training, allowing the model to gradually adapt to complex rock images, boundary samples, and new scene data. When error attribution results indicate that the error mainly stems from missing rules, unreasonable rule weight settings, inaccurate environmental constraints, incomplete image appearance knowledge, or insufficient case support, the geological knowledge graph is updated. Newly acquired manual verification knowledge, misjudgment correction experience, and new cases are written back into the geological knowledge graph.

[0088] The historical case database is expanded, and frequently recurring error patterns are solidified into new discriminative knowledge, enabling the system to identify and trigger corresponding correction strategies earlier when it encounters similar samples in the future.

[0089] After completing model updates, atlas updates, and case library expansion, a collaborative closed-loop update is performed on the system, enabling the updated model and the updated geological knowledge graph to jointly form the next round of the recognition system. The results of the closed-loop update are output and recorded. The model version, geological knowledge graph version, rule adjustment records, case addition records, and error attribution statistics are saved to track the system's evolution and provide a basis for comparing recognition performance at different stages.

[0090] Example 2 This embodiment discloses a lithology identification system based on local reasoning-based knowledge matching.

[0091] like Figure 4 As shown, a lithology identification system based on local reasoning-based knowledge matching includes: The rock sample processing module is configured to: acquire rock image data of the rock sample to be identified and preprocess it into a standardized rock image; The knowledge graph construction module is configured to: construct a geological knowledge graph with geological lithology entities as the core and multiple matching entities associated with it; The model building module is configured to: obtain a set of candidate lithologies and their corresponding initial prediction probabilities from the standardized rock images using a pre-built lithology image recognition model; The local reasoning-based knowledge matching module is configured to: use the candidate lithology set as the retrieval entry point, merge the local subgraphs that are dynamically associated with each candidate lithology in the geological knowledge graph into a candidate local reasoning subgraph; perform knowledge matching within the candidate local reasoning subgraphs to obtain the knowledge matching result for each candidate lithology; the knowledge matching includes feature consistency matching, environmental constraint matching, rule matching, and case matching; The lithology identification module is configured to fuse and discriminate the initial prediction probability output by the lithology image identification model with the knowledge matching result to output the lithology identification result; The closed-loop update module is configured to: compare the output lithology identification results with the manual verification results, and identify misidentified samples and low-confidence samples; and perform error attribution analysis and error correction on the misidentified samples and low-confidence samples.

[0092] Example 3 The purpose of this embodiment is to provide a computer-readable storage medium.

[0093] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of a lithology identification method based on local reasoning-based knowledge matching as described in Embodiment 1 of this disclosure.

[0094] Example 4 The purpose of this embodiment is to provide an electronic device.

[0095] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in a lithology identification method based on local reasoning knowledge matching as described in Embodiment 1 of this disclosure.

[0096] The steps and methods involved in the apparatuses of Embodiments 2, 3, and 4 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.

[0097] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.

[0098] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A lithology identification method based on local reasoning-based knowledge matching, characterized in that, include: Obtain rock image data of the rock sample to be identified and preprocess it into a standardized rock image; Construct a geological knowledge graph with geological lithology entities as the core and multiple matching entities associated with them; A candidate lithology set and its corresponding initial prediction probability are obtained from the standardized rock image using a pre-constructed lithology image recognition model. Using the candidate lithology set as the retrieval entry point, the local subgraphs dynamically associated with each candidate lithology in the geological knowledge graph are merged into a candidate local inference subgraph. Specifically, after obtaining the candidate lithology set, image appearance feature nodes, attribute nodes, environment nodes, rule nodes, and case nodes that are directly related to and indirectly constrained by each candidate lithology are extracted in the geological knowledge graph around each candidate lithology, and the relationships between these nodes that are related to the current discrimination task are retained to construct the candidate local inference subgraph corresponding to the candidate lithology. Knowledge matching is performed within the candidate local inference subgraph to obtain the knowledge matching result for each candidate lithology. The knowledge matching includes feature consistency matching, environmental constraint matching, rule matching, and case matching. Specifically, for samples lacking auxiliary geological information, a candidate local inference subgraph is constructed only around the candidate lithology, image appearance features, rule nodes, and case nodes, and image appearance feature matching, rule matching, and case matching are performed, but environmental matching is not performed. If any attribute in the image appearance features is missing or the prediction confidence is lower than the preset confidence threshold, then matching is performed only on the available attributes that meet the confidence requirements, and the matching results are normalized. The initial predicted probability output by the lithology image recognition model is fused and judged with the knowledge matching result to output the lithology recognition result.

2. The lithology identification method based on local reasoning-based knowledge matching as described in claim 1, characterized in that, The construction of the geological knowledge graph includes: A semantic representation technique based on rule mapping is used to first extract color, texture, grain and structural features from rock photographs with known lithological labels, and then map continuous visual features into discrete, interpretable semantic entities.

3. The lithology identification method based on local reasoning-based knowledge matching as described in claim 1, characterized in that, The lithological image recognition model adopts a multi-branch visual recognition network structure, including: an input layer, a backbone feature extraction network, an image appearance feature prediction branch, a feature fusion layer, and a classification output layer; wherein, the image appearance feature prediction branch is used to output at least one image appearance semantic feature among color category, texture coarseness, grain visibility, stratification visibility, surface density, and edge morphology.

4. The lithology identification method based on local reasoning-based knowledge matching as described in claim 1, characterized in that, The rule matching includes lithology discrimination rule matching, easily confused lithology differentiation rule matching, environmental constraint rule matching, and anomaly identification rule matching; each rule has a set of triggering conditions, rule weight, and rule confidence.

5. The lithology identification method based on local reasoning-based knowledge matching as described in claim 1, characterized in that, It also includes a closed-loop update step, specifically: The output lithology identification results are compared with the manual verification results, and misidentified samples and low-confidence samples are identified. Error attribution analysis is performed on the misidentified samples and low-confidence samples. If the error is attributed to either insufficient image feature extraction or semantic prediction bias, the corresponding samples are used to perform incremental training and retraining of the lithology image identification model. If the error is attributed to either knowledge gaps or unreasonable relationships, the regular entities, case entities, and relationships between entities in the geological knowledge graph are updated.

6. A lithology identification system based on local reasoning-based knowledge matching, employing the lithology identification method as described in any one of claims 1-5, characterized in that, include: The rock sample processing module is configured to: acquire rock image data of the rock sample to be identified and preprocess it into a standardized rock image; The knowledge graph construction module is configured to: construct a geological knowledge graph with geological lithology entities as the core and multiple matching entities associated with it; The model building module is configured to: obtain a set of candidate lithologies and their corresponding initial prediction probabilities from the standardized rock images using a pre-built lithology image recognition model; The local reasoning-based knowledge matching module is configured to: use the candidate lithology set as the retrieval entry point, merge the local subgraphs that are dynamically associated with each candidate lithology in the geological knowledge graph into a candidate local reasoning subgraph; perform knowledge matching within the candidate local reasoning subgraphs to obtain the knowledge matching result for each candidate lithology; the knowledge matching includes feature consistency matching, environmental constraint matching, rule matching, and case matching; The lithology identification module is configured to fuse and discriminate the initial prediction probability output by the lithology image identification model with the knowledge matching result to output the lithology identification result; The closed-loop update module is configured to compare the output lithology identification results with the manual verification results and identify misidentified samples and low-confidence samples. Error attribution analysis and error correction are performed on the misidentified samples and low-confidence samples.

7. A computer-readable storage medium having a program stored thereon, characterized in that, When executed by the processor, the program implements the steps in the lithology identification method based on local reasoning knowledge matching as described in any one of claims 1-5.

8. An electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the lithology identification method based on local reasoning knowledge matching as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Rock mineral composition intelligent analysis method and system in combination with three-dimensional point cloud and knowledge graph

    CN121354078A

  • Intelligent question and answer method and system fusing rock knowledge graph

    CN122452791A