Chemical knowledge graph outlier detection method based on counterfactual consistency check

By constructing a counterfactual consistency test method for chemical engineering knowledge graphs, the problem of difficulty in identifying and attributing hidden anomalies in chemical engineering knowledge graphs is solved, achieving efficient anomaly detection and attribution, and improving the credibility of chemical engineering knowledge graphs.

CN123031007APending Publication Date: 2026-11-03DOCUMENT & INFORMATION CENT OF CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611528754.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing technologies lack a holistic utilization of the context and literature association of chemical engineering knowledge graphs, making it difficult to identify and attribute hidden anomalies such as attribute values ​​that are reasonable in themselves but incorrectly assigned, thus affecting the credibility of chemical engineering knowledge graphs.

Method used

By acquiring the knowledge to be tested from the chemical knowledge graph, a relevant graph environment is constructed, entity attributes, adjacency relationships and similar knowledge are extracted, counterfactual knowledge examples are constructed, and counterfactual consistency is calculated. When the counterfactual consistency is better than the original consistency, it is marked as a suspected anomaly and output for manual review.

Benefits of technology

Accurately identify and attribute hidden anomalies, improve the accuracy and efficiency of automated quality inspection of chemical knowledge graphs, reduce the risk of false positives and false negatives, enhance the ability to utilize entity attributes and the contextual relationship of documents, and improve credibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123031007A_ABST
    Figure CN123031007A_ABST
Patent Text Reader

Abstract

The application provides a chemical engineering knowledge graph anomaly value detection method based on counterfactual consistency verification, and relates to the technical field of knowledge graphs. The method comprises: obtaining a chemical engineering knowledge graph and determining knowledge to be detected; constructing a related graph environment; calculating the original consistency of the knowledge to be detected and the related knowledge graph, and triggering a counterfactual verification process when the original consistency is lower than a preset threshold; constructing counterfactual knowledge samples; judging abnormalities by the consistency change before and after the counterfactual, and marking as suspected abnormalities; outputting the knowledge to be detected, the counterfactual knowledge samples and the consistency change information for manual review. Through the application, the technical problem that hidden abnormalities such as reasonable attribute values but incorrect attribution are difficult to be identified and attributed due to the lack of overall use of the context and literature association on the graph in the prior art can be solved. The anomaly source is located based on counterfactual consistency comparison, and hidden errors can be accurately identified without external standard answers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph technology, and more specifically to a method for detecting outliers in chemical engineering knowledge graphs based on counterfactual consistency testing. Background Technology

[0002] With the development of natural language processing and large language modeling technologies, automatically extracting knowledge from scientific and technological literature and constructing knowledge graphs has become an important technical means for chemical engineering knowledge organization, knowledge discovery, and intelligent services. Automatic extraction systems can identify entities such as substances, catalysts, reactions, processes, and experimental samples from papers, patents, and books, and extract the relationships between entities and their attribute values, thereby forming a large-scale chemical engineering knowledge graph. Chemical engineering scientific and technological literature typically describes multiple materials, catalyst samples, experimental conditions, and performance indicators simultaneously. Related knowledge may be distributed across the main text, tables, images, figures, and supplementary materials, and cross-sentence, cross-paragraph, and cross-modal relationships exist. When processing the above content, large language models or information extraction models are prone to problems such as incorrect identification of referential objects, incorrect table row and column correspondence, confusion between different experimental groups, and incorrect attribute value assignment. These errors are highly concealed; a conversion rate or selectivity value may be within a reasonable range, but it actually belongs to another catalyst sample in the literature. Because this value does not appear to be obviously abnormal in terms of common sense and numerical range, it is difficult to detect using conventional methods. At the same time, many experimental results in the chemical industry are scientifically novel, but lack directly comparable external standard answers, which makes traditional quality inspection methods face the dilemma of insufficient information.

[0003] Existing methods for quality assurance of knowledge graphs mainly employ rule validation, statistical anomaly detection, knowledge graph representation learning, or manual review. Rule validation and statistical detection are well-suited for identifying explicit problems, but struggle to determine whether a reasonable value has been incorrectly associated. While knowledge graph completion models can evaluate the reasonableness of triples, they typically lack utilization of the original document structure and counterfactual changes, making it difficult to pinpoint which value or entity caused the anomaly. Manual review, though accurate, is inefficient and cannot meet the quality assurance requirements of large-scale knowledge graphs.

[0004] In summary, existing technologies suffer from a lack of holistic utilization of the context of the knowledge graph and its association with literature. This leads to the difficulty in identifying and attributing hidden anomalies, such as attribute values ​​that are reasonable in themselves but incorrectly assigned, thus forming anomalous knowledge and further affecting the credibility of chemical engineering knowledge graphs. Summary of the Invention

[0005] This application provides an outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing. This method addresses the technical problem in existing technologies where the lack of holistic utilization of the graph context and literature association leads to the difficulty in identifying and attributing hidden anomalies, such as attribute values ​​that are reasonable in themselves but incorrectly assigned, thus forming anomalous knowledge and further affecting the credibility of chemical engineering knowledge graphs.

[0006] In view of the above problems, this application provides a method for outlier detection in chemical engineering knowledge graphs based on counterfactual consistency testing. The method includes: acquiring a chemical engineering knowledge graph and identifying the knowledge to be tested, wherein the knowledge to be tested is a knowledge triple containing original attribute values ​​or original tail entities; using the knowledge to be tested as an anchor point, extracting relevant entity attributes, adjacency relationships, and similar knowledge from the chemical engineering knowledge graph to construct a relevant graph environment; placing the knowledge to be tested in the relevant graph environment to obtain original consistency; and determining the outlier when the original consistency is lower than a preset threshold. A counterfactual verification process is triggered when a threshold is reached. Based on the counterfactual verification process, candidate content is extracted from the chemical knowledge graph, and the original attribute value, the original tail entity, or the entity to which the original attribute value belongs is replaced with the candidate content to construct a counterfactual knowledge example. The counterfactual consistency between the counterfactual knowledge example and the relevant graph environment is calculated. When the counterfactual consistency is better than the original consistency, the knowledge to be tested is marked as a suspected anomaly. Based on the suspected anomaly label, the knowledge to be tested, the counterfactual knowledge example, and consistency change information are output for manual review.

[0007] Optionally, taking the entity corresponding to the knowledge to be examined as the central node, an adjacency subgraph of the central node is extracted from the chemical engineering knowledge graph. The adjacency subgraph includes one-hop entities and relationships directly connected to the central node, as well as multi-hop entities and relationships indirectly associated with the central node. At the same time, co-occurring knowledge groups belonging to the same chemical engineering scientific literature as the central node are extracted. The co-occurring knowledge groups include all entities and attribute values ​​appearing in the same paragraph, the same table row, or the same experiment number, so that the relevant graph environment simultaneously contains association information at the graph topology level and experimental association information at the literature context level.

[0008] Optionally, the structural consistency, attribute combination consistency, and experimental condition consistency of the knowledge to be tested in the relevant graph environment are calculated respectively; the structural consistency, attribute combination consistency, and experimental condition consistency are weighted and fused to obtain a comprehensive consistency score, and the comprehensive consistency score is recorded as the original consistency; wherein, the structural consistency is used to measure the rationality of the topological structure of the knowledge triple in the relevant graph environment, the attribute combination consistency is used to measure the degree of matching between the attribute value and the statistical distribution of the same type of entity in the same attribute dimension, and the experimental condition consistency is used to measure the degree of logical matching between the attribute value or tail entity and the experimental condition knowledge in the relevant graph environment.

[0009] Optionally, the accuracy of anomaly detection is used as a feedback signal, and the weight values ​​corresponding to structural consistency, attribute combination consistency, and experimental condition consistency are gradually adjusted according to the direction of change of the accuracy, so that the accuracy increases with the weight adjustment, until the accuracy reaches a preset stable state and the final weight value is determined.

[0010] Optionally, when the original consistency is not lower than the preset threshold, the knowledge to be inspected is determined to be normal and the inspection process is terminated.

[0011] Optionally, candidate attribute values ​​or candidate entities are obtained from other samples or other experimental groups in similar literature as first candidates; candidate attribute values ​​or candidate entities are obtained from similar entities in the chemical engineering knowledge graph as second candidates; candidate content is obtained from the knowledge corresponding to similar local knowledge structures as third candidates; candidate content is obtained from the knowledge graph prediction results as fourth candidates; and the candidate content is obtained based on the first candidate, the second candidate, the third candidate, or the fourth candidate.

[0012] Optionally, the first construction scheme is obtained by keeping the belonging entity unchanged and replacing the original attribute value with the candidate attribute value; the second construction scheme is obtained by keeping the head entity and relationship unchanged and replacing the original tail entity with the candidate entity; the third construction scheme is obtained by keeping the attribute value unchanged and replacing the belonging entity of the original attribute value with the candidate belonging entity; the counterfactual knowledge example is constructed based on the first construction scheme, the second construction scheme, or the third construction scheme.

[0013] Optionally, a predetermined substitution constraint is satisfied, which means that when constructing a counterfactual knowledge example by replacing the original attribute value with its owning entity, the selected candidate owning entity must have an existing attribute value corresponding to the same attribute predicate definition as the original attribute value, and the existing attribute value matches the original attribute value in terms of numerical magnitude and unit type; furthermore, the candidate owning entity and the owning entity of the original attribute value have the same entity type label and the same attribute predicate definition in the chemical engineering knowledge graph, to ensure that the candidate owning entity and the original attribute value are comparable. The knowledge graph is used as a basis; if the candidate attributed entity does not have the existing attribute value, or the existing attribute value does not match the original attribute value in terms of numerical magnitude or unit type, the candidate attributed entity is excluded to ensure that the candidate attributed entity has a comparable knowledge graph basis through the existing attribute value and the original attribute value; when constructing counterfactual knowledge examples by replacing the original attribute value, the source entity of the selected candidate attribute value and the attributed entity of the original attribute value have a preset degree of similarity in reaction system or experimental conditions to ensure that the counterfactual knowledge examples are reasonable in the sense of chemical engineering.

[0014] Optionally, the counterfactual knowledge example is used to replace the knowledge to be tested, and the structural consistency, attribute combination consistency, and experimental condition consistency in the relevant graph environment are calculated; the structural consistency, attribute combination consistency, and experimental condition consistency are weighted and fused to obtain a comprehensive consistency score, and the comprehensive consistency score is recorded as the counterfactual consistency.

[0015] Optionally, when the counterfactual consistency of one or more counterfactual knowledge examples is stable and significantly better than the original consistency, it is determined that the replaced original attribute value, the original tail entity, or the entity to which the original attribute value belongs is a key factor causing the knowledge under test to exhibit anomalousness in the relevant graph environment, and the knowledge under test is marked as suspected anomaly; wherein, stable and significantly better than satisfies the following quantitative criteria: significantly better than means that the difference between the counterfactual consistency and the original consistency is greater than a preset minimum improvement threshold, or the improvement ratio of the counterfactual consistency relative to the original consistency is greater than a preset ratio threshold; stable better than means that among the constructed counterfactual knowledge examples, the proportion of the number of counterfactual knowledge examples that satisfy the above significantly better condition to the total number of constructed counterfactual knowledge examples is not less than a preset number ratio threshold, and the dispersion of the consistency improvement magnitude among each counterfactual knowledge example that satisfies the significantly better condition is less than a preset fluctuation threshold; or, stable better than means that counterfactual knowledge examples are repeatedly constructed for the same knowledge under test, and the counterfactual consistency obtained each time satisfies the above significantly better condition.

[0016] One or more technical solutions provided in this application have at least the following beneficial effects: By acquiring a chemical engineering knowledge graph and identifying the knowledge to be tested, which is a knowledge triple containing original attribute values ​​or original tail entities; using the knowledge to be tested as an anchor point, relevant entity attributes, adjacency relationships, and similar knowledge are extracted from the chemical engineering knowledge graph to construct a relevant graph environment; the knowledge to be tested is placed in the relevant graph environment to obtain original consistency, and a counterfactual verification process is triggered when the original consistency is lower than a preset threshold; based on the counterfactual verification process, candidate content is extracted from the chemical engineering knowledge graph, and the original attribute values, original tail entities, or the entities to which the original attribute values ​​belong are replaced with the candidate content to construct counterfactual knowledge examples; the counterfactual consistency between the counterfactual knowledge examples and the relevant graph environment is calculated, and when the counterfactual consistency is better than the original consistency, the knowledge to be tested is marked as a suspected anomaly; based on the suspected anomaly label, the knowledge to be tested, the counterfactual knowledge examples, and consistency change information are output for manual review. In other words, by utilizing entity attributes, relational structures, literature sources, and similar knowledge patterns in chemical engineering knowledge graphs, counterfactual knowledge examples are constructed. The consistency changes between original knowledge and counterfactual knowledge within the graph are compared, thereby identifying potentially erroneous attribute values ​​or relational entities. This provides a technical means for automated quality inspection of chemical engineering knowledge graphs, accurately identifying and attributing hidden anomalies even without external standard answers. It improves the detection accuracy and attribution stability of hidden anomalies with incorrect attribute value attribution, enhances the comprehensive utilization of chemical entity attributes, experimental conditions, and literature context, reduces the risk of false positives and false negatives, improves the accuracy and efficiency of automated quality inspection of large-scale chemical engineering knowledge graphs, outputs interpretable evidence chains for manual review, avoids error correction risks, and enhances the credibility of chemical engineering knowledge graphs. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the outlier detection method for chemical knowledge graphs based on counterfactual consistency testing proposed in this application.

[0019] Figure 2 This is a flowchart illustrating the process of extracting candidate content in the outlier detection method for chemical knowledge graphs based on counterfactual consistency testing, as described in this application.

[0020] Figure 3 This is a flowchart illustrating the process of calculating counterfactual consistency in the outlier detection method for chemical knowledge graphs based on counterfactual consistency testing in this application. Detailed Implementation

[0021] This application provides an outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing. This addresses the technical problem in existing technologies where the lack of holistic utilization of the graph's context and literature connections leads to the difficulty in identifying and attributing hidden anomalies, such as attribute values ​​that are reasonable but incorrectly attributed. This results in anomalous knowledge and further impacts the credibility of chemical engineering knowledge graphs. By utilizing entity attributes, relational structures, literature sources, and similar knowledge patterns within the chemical engineering knowledge graph, counterfactual knowledge examples are constructed. The consistency changes between the original knowledge and counterfactual knowledge in the graph are compared, thereby identifying potentially erroneous attribute values ​​or relational entities. This provides a technical means for automated quality inspection of chemical engineering knowledge graphs, accurately identifying and attributing hidden anomalies even without external standard answers, outputting interpretable evidence chains for manual review, avoiding the risk of error correction, and improving the credibility of chemical engineering knowledge graphs.

[0022] Examples, such as Figure 1 As shown, this application provides a method for detecting outliers in a chemical engineering knowledge graph based on counterfactual consistency testing. The method specifically includes the following steps: Obtain a chemical engineering knowledge graph and identify the knowledge to be tested, wherein the knowledge to be tested is a knowledge triple containing original attribute values ​​or original tail entities.

[0023] Specifically, the chemical engineering knowledge graph is a structured knowledge network built using substances, catalysts, materials, reactions, processes, equipment, and experimental samples in the chemical field as entities, and entity relationships and attributes as its main content. It receives the output results of automatic processing of chemical engineering scientific and technological literature by a large language model or a dedicated information extraction model. This output is stored in a structured form, forming a chemical engineering knowledge graph containing three types of data units: entities, relationships, and attribute values. Each entity node is assigned a globally unique identifier and an entity type label, each relationship edge is labeled with its relationship type, and each attribute value is bound to the corresponding entity node in key-value pairs, recording its data source location.

[0024] The selection strategy for the knowledge to be inspected is determined based on actual quality inspection needs. This could involve systematically inspecting all attribute-type triples in the chemical engineering knowledge graph, or locating one or more specific knowledge triples based on a manually specified or upstream system-marked risk warning list. The complete content of the selected knowledge triple is then read from the chemical engineering knowledge graph, including the head entity identifier and its type, relation type, tail entity or attribute value content, and the source literature information for the selected knowledge triple. If the object of the selected knowledge triple is a specific attribute value, the knowledge is classified as attribute-type knowledge to be inspected, with the original attribute value being the object; if the object of the selected knowledge triple is another entity identifier, the knowledge is classified as relation-type knowledge to be inspected, with the original tail entity being the object. During the reading process, the entity type labels and attribute predicate definitions of the entities involved in the knowledge triple are simultaneously recorded.

[0025] The knowledge to be tested refers to a single knowledge unit in the chemical engineering knowledge graph whose correctness needs to be verified, as well as knowledge triples containing original attribute values ​​or original tail entities. Attribute values ​​are specific data or text content describing the characteristics of an entity, such as the composition, loading, specific surface area, conversion rate, and selectivity of a catalyst sample. Tail entities are entities located after the relation in the knowledge graph triples. For example, in the reaction R—using catalyst—catalyst A, catalyst A is a tail entity. While extracting the knowledge to be tested, information such as the associated attributes of the entity, entity type labels, and literature source location are simultaneously collected to form a structured data package for testing.

[0026] Using the knowledge to be tested as anchor points, relevant entity attributes, adjacency relationships, and similar knowledge are extracted from the chemical knowledge graph to construct a relevant graph environment.

[0027] Furthermore, this application also includes the following steps: taking the entity corresponding to the knowledge to be examined as the central node, extracting the adjacency subgraph of the central node from the chemical engineering knowledge graph, the adjacency subgraph including one-hop entities and relationships directly connected to the central node, and multi-hop entities and relationships indirectly associated with the central node; simultaneously, extracting co-occurring knowledge groups belonging to the same chemical engineering scientific literature as the central node, the co-occurring knowledge groups including all entities and attribute values ​​appearing in the same paragraph, the same table row, or the same experiment number, so that the relevant graph environment simultaneously contains association information at the graph topology level and experimental association information at the literature context level.

[0028] Specifically, using the entity corresponding to the knowledge to be examined as the central node, two types of related information are extracted from the chemical engineering knowledge graph and the original literature annotation information, respectively, to jointly constitute the relevant graph environment. A globally unique identifier and entity type label are determined for the central node. The adjacency subgraph of the central node is extracted from the chemical engineering knowledge graph, including one-hop entities and relationships directly connected to the central node, and multi-hop entities and relationships indirectly connected to the central node. One-hop entities and relationships are entities and their corresponding relationship types directly connected to the central node in the knowledge graph via an edge; one-hop entities are the direct neighbors of the central node. Multi-hop entities and relationships are indirectly connected entities in the knowledge graph via two or more paths to the central node.

[0029] The first-hop part requires returning all directly related triples with the central node as the head or tail entity. Specifically, this includes all outgoing edge triples with the central node as the head entity, all incoming edge triples with the central node as the tail entity, and the adjacent entities and their additional attributes involved in these triples. The multi-hop part of the query requires expanding outwards to the second and third hops from the first-hop adjacent entity as the intermediate node, but expansion constraints must be set to control the subgraph size: The first type of constraint is relation type filtering, which only allows the expansion of edges belonging to the preset relation whitelist, such as only retaining common chemical engineering relations such as specific surface area, pore volume, used for reaction, product generation, and under certain conditions, ignoring relations of literature metadata such as literature source and cited; the second type of constraint is entity type filtering, which only allows the expansion of nodes with entity types of substance, catalyst, reaction, process, equipment, and experimental sample, ignoring literature type nodes and author type nodes; the third type of constraint is the upper limit of the number of hops, which defaults to expanding to two hops, and can be relaxed to three hops for regions with low graph connectivity, but the timed query duration must be limited. After extracting the adjacency subgraph, record the hop count as 1 hop, 2 hops, and 3 hops respectively, and label each adjacency relationship with its hop count.

[0030] Simultaneously, the system extracts a set of all entities, relationships, and attribute values ​​belonging to the same chemical engineering literature source as the central node and appearing in the same paragraph, table row, or experiment number. It reads the unique identifier of the literature and the location description information within the literature from the source record of the knowledge to be examined. If the location description explicitly indicates the table number and row number, it retrieves all entities and attribute values ​​appearing in the same row of that table within the entire spectrum. Simultaneously, using the table number as the expansion key, it retrieves all attribute values ​​of the same type of sample entities appearing in other rows of that table. If the location description indicates a paragraph number, it extracts all entity identifiers and corresponding attribute triples appearing in that paragraph. If the location description indicates an experiment number, it uses that number as the grouping key to extract all entities and attribute values ​​also marked with that experiment number. During the extraction of co-occurrence knowledge groups, there are no restrictions on entity types; any substance, catalyst, reaction, experimental sample, and corresponding attribute value appearing in the same literature location are included in the co-occurrence knowledge group. The association information at the graph topology level reflects structural features based on the connections between entity nodes in the knowledge graph. This includes direct connections (one-hop), indirect connections (multi-hop), path length, connectivity, and local subgraph morphology. Using the graph structure as the primary carrier, it reflects the semantic relevance and structural tightness between entities. The experimental association information at the literature context level reflects experimental relevance based on the original organization and expression structure of chemical engineering literature. This includes control group relationships between multiple values ​​within the same table row, experimental sharing relationships between multiple entities in the same paragraph, and the affiliation relationships of multiple data points under the same experiment number. Indexed by the source location of the literature, it reflects the experimental context binding relationships between knowledge units in the original literature and may not completely overlap with the graph topology.

[0031] The adjacency subgraph and co-occurrence knowledge groups are merged. For entities or attribute values ​​that appear in both sets at the same time, deduplication and merging are performed. Two sets of association type labels, namely graph topological association and literature context association, are retained, and finally a structured related graph environment is formed.

[0032] The knowledge to be tested is placed in the relevant graph environment to obtain original consistency. When the original consistency is lower than a preset threshold, the counterfactual test process is triggered.

[0033] Furthermore, this application also includes the following steps: calculating the structural consistency, attribute combination consistency, and experimental condition consistency of the knowledge to be tested in the relevant graph environment respectively; weighting and fusing the structural consistency, attribute combination consistency, and experimental condition consistency to obtain a comprehensive consistency score, and recording the comprehensive consistency score as the original consistency; wherein, the structural consistency is used to measure the rationality of the topological structure of the knowledge triple in the relevant graph environment, the attribute combination consistency is used to measure the degree of matching between the attribute value and the statistical distribution of the same type of entity in the same attribute dimension, and the experimental condition consistency is used to measure the degree of logical matching between the attribute value or tail entity and the experimental condition knowledge in the relevant graph environment.

[0034] Furthermore, this application also includes the following steps: using the accuracy of anomaly detection as a feedback signal, gradually adjusting the weight values ​​corresponding to the structural consistency, attribute combination consistency, and experimental condition consistency according to the direction of change of the accuracy, so that the accuracy increases with the weight adjustment, until the accuracy reaches a preset stable state and the final weight value is determined.

[0035] Furthermore, this application also includes the following steps: when the original consistency is not lower than the preset threshold, the knowledge to be inspected is determined to be normal and the inspection process is terminated.

[0036] Specifically, the system reads the triplet of knowledge to be inspected and the adjacent subgraph containing the entity to be inspected from the relevant graph environment data package. For attribute-type knowledge to be inspected, a local adjacent subgraph is constructed with the head entity as the center, containing one-hop and two-hop adjacency relationships and nodes. At the same time, statistical information of all entities of the same type as the central node and their adjacent subgraphs are extracted from the global chemical knowledge graph using entity type labels as grouping keys, and a set of reference subgraphs is constructed. The local adjacent subgraphs are structurally compared with each reference subgraph, and the similarity between the two in relation type distribution and node degree distribution is statistically analyzed: the overlap between the entity to be inspected and the reference relation type is calculated based on the typical outbound relation type distribution of the entity to be inspected in the global graph, which is used as the relation type overlap; the standardized deviation of the degree of the entity to be inspected relative to the mean is calculated based on the mean and standard deviation of the node degree of the entity to be inspected in the global graph, and mapped to the degree matching degree; the relation type overlap and degree matching degree are weighted and fused according to preset weights and mapped to the interval of 0 to 1 to obtain the structural consistency score. The core idea of ​​structural consistency is that if the connection pattern of a knowledge triple with its surrounding entities and relations in the knowledge graph matches the typical connection pattern of that type of entity in the overall graph, then the structural consistency is high; conversely, if the connection pattern between the head entity, relation, and tail entity of the knowledge to be examined is rarely seen among entities of the same type, then the structural consistency is low.

[0037] If the object of the knowledge to be examined is a tail entity, then the co-occurrence frequency and path connectivity pattern of this two-node subgraph formed by the head and tail entities are examined as the center. The existence of a direct edge between the head and tail entities in the reference subgraph is counted, and if so, whether its relation type distribution matches that of the tail entity is determined. The final structural consistency score is obtained, ranging from 0 to 1, with higher values ​​indicating stronger topological rationality. The core idea of ​​structural consistency is: if the connection pattern of a knowledge triple with surrounding entities and relations in the knowledge graph matches the typical connection pattern of that type of entity in the overall graph, then the structural consistency is high; conversely, if the connection patterns between the head entity, relation, and tail entity of the knowledge to be examined are rarely seen among entities of the same type, then the structural consistency is low.

[0038] The system reads all attribute values ​​of entities of the same type under the same attribute predicate from the data packets of the relevant graph environment. This includes attribute values ​​of entities of the same type extracted from the adjacency subgraph and entities of the same document sample extracted from the co-occurrence knowledge group. A kernel density estimation method is used to fit the distribution of all attribute value sets, with a Gaussian kernel function selected and bandwidth determined according to statistical empirical rules. After fitting, the original attribute values ​​of the knowledge to be tested are input into the Gaussian kernel function to calculate their probability density values ​​on the fitted distribution. This probability density value is then normalized by dividing it by the maximum probability density value of the reference distribution, yielding the normalized density ratio. The normalized density ratio ranges from 0 to 1; a higher value indicates that the test value is closer to the dense region of the reference distribution. The arithmetic mean and standard deviation of the reference attribute value set are calculated, and the standard score of the test attribute value is calculated. The standard score is equal to the test value minus the mean, divided by the standard deviation. The standard score is mapped to the center proximity score using the following method: Center Proximity Score = 1 - min(|x - μ| / (3σ), 1), where x is the value of the attribute to be tested, μ is the mean of the reference distribution, σ is the standard deviation of the reference distribution, and 3σ is the upper limit of normal deviation under the three sigma principle. The center proximity score is 1 when the value of the attribute to be tested equals the mean, 0 when the value of the attribute to be tested deviates from the mean by 3σ, and truncated to 0 when the deviation exceeds 3σ. The normalized density ratio and the center proximity score are weighted and fused according to preset weights to obtain the attribute combination consistency score, i.e., attribute combination consistency = w1 × normalized density ratio + w2 × center proximity score, where w1 + w2 = 1; in one specific implementation, w1 = 0.5, w2 = 0.5, that is, the arithmetic mean of the normalized density ratio and the center proximity score is taken. If the knowledge to be tested is relational knowledge, i.e., the object is a tail entity, then the calculation method for attribute combination consistency is adjusted accordingly: Statistically distribute the frequency of occurrence of the entity type to which all tail entities belong under the same type of relation within each tail entity, and use the proportion of the tail entity's type to which it belongs in the historical frequency as the attribute combination consistency score for the relational knowledge. The final attribute combination consistency score is recorded as the attribute score, ranging from 0 to 1. Attribute combination consistency is a quantitative indicator used to measure the degree of matching between the attribute values ​​or tail entities in the knowledge to be tested and entities of the same type in the same attribute dimension. A specific attribute value of a certain entity type exhibits a certain statistical distribution pattern among all members of that type of entity. If the attribute values ​​of the knowledge to be tested significantly deviate from this distribution, then the attribute combination consistency is low.

[0039] The experimental condition parameters corresponding to the source location of the knowledge to be tested are read from the relevant spectral environment data package. These parameters include, but are not limited to, reaction temperature and its unit, reaction pressure and its unit, space velocity and its unit, and the proportion of each component in the feed gas. Simultaneously, the set of performance parameters of other samples belonging to the same experimental group or the same literature as the entity to be tested, under the same or similar reaction conditions, is read from the relevant spectral environment. The specific calculation of experimental condition consistency uses the conditional vector distance metric: each set of experimental condition-performance data is considered a multi-dimensional vector, with each dimension corresponding to conditional parameters such as temperature, pressure, space velocity, and feed ratio, as well as the corresponding selectivity or conversion performance values. The standardized Euclidean distance between the conditional vector of the knowledge to be tested and each similar knowledge vector with similar conditions in the relevant spectral environment is calculated. For example, the temperature deviation should not exceed 20℃, the pressure deviation should not exceed 0.5 MPa, and the proportion deviation should not exceed 0.5. The smaller the Euclidean distance, the more consistent the performance value is with existing knowledge under similar experimental conditions, and the higher the experimental condition consistency. Hard constraint checks are performed using empirical rules from the chemical engineering field: if the tested condition-performance combination significantly violates basic physicochemical laws or phase equilibrium principles, the rule violation is directly deducted from the score as a penalty factor. The final experimental condition consistency score is recorded as the condition score, ranging from 0 to 1. Experimental condition consistency is a quantitative indicator used to measure the degree of logical matching between attribute values ​​or tail entities and experimental condition knowledge in the relevant spectral environment. In the chemical engineering field, the catalytic performance values ​​of catalysts are only meaningful under specific reaction conditions (temperature, pressure, space velocity, feed ratio, etc.), and the performance of the same catalyst under different reaction conditions exhibits a clear functional dependence or empirical range constraint. If there is a significant mismatch between the selectivity value in the tested knowledge and the reaction conditions experienced by the catalyst recorded in the spectral environment, such as ultra-high conversion rates at low temperatures or selectivity at a specific temperature that deviates significantly from the normal performance of the same type of catalyst under those reaction conditions, then the experimental condition consistency is low. Using reaction condition entities (temperature, pressure, raw material ratio, etc.) in the relevant spectral environment as a reference benchmark, a matching score is given by comparing the experimental conditions marked at the knowledge source location under test with the actual recorded condition parameters in the spectral environment, and whether the condition-performance mapping conforms to the general laws of chemical thermodynamics or kinetics.

[0040] Initialize weight coefficients α0, β0, and γ0 for the three consistency dimensions respectively, with default initial values ​​set to α0=0.40, β0=0.35, and γ0=0.25, ensuring their sum is 1. Based on the current weight configuration, run the complete anomaly detection process and compare the detection results with historical records reviewed manually to calculate the current anomaly detection accuracy. Each time, while maintaining the constraint α+β+γ=1, fine-tune the weights along the gradient ascent direction, with a fine-tuning step size set to 0.02. The specific adjustment strategy is as follows: calculate the estimated rate of change in accuracy when the weights of each of the three dimensions are individually increased by 0.02, obtained through testing on a small batch of historical samples. Select the dimension with the largest expected improvement in accuracy and increase its weight, while equally reducing the weight of the dimension with the smallest expected contribution to accuracy to maintain a sum of 1. After adjustment, rerun the detection process and obtain the new accuracy. If the new accuracy is greater than the current anomaly detection accuracy, accept the adjustment and update the weights; otherwise, revert the weights and reduce the step size to 0.01 to retry. This cycle continues until the accuracy fluctuation range does not exceed 0.5 percentage points in 10 consecutive iterations, at which point a preset stable state is reached. The weight combination α1, β1, and γ1 at this point is determined as the final weight value. After weight learning is completed, the three consistency scores of the current knowledge to be tested are linearly weighted and fused according to the final weights, i.e., original consistency = α1 × structural consistency score + β1 × attribute combination consistency score + γ1 × experimental condition consistency score.

[0041] For example, the knowledge to be tested is (Cat012, target product selectivity, 85.3%), with a source location of 3 rows and 2 columns. The corresponding reaction conditions are a temperature of 320℃, a pressure of 2MPa, and an H2 / CO ratio of 2. The relevant spectral environment has been constructed. Using Cat012 as the central node, its local adjacency subgraph 1 is extracted, containing 7 one-hop adjacency nodes and 4 two-hop adjacency nodes. From the global spectrum, 314 entities with the entity type label "catalyst" are extracted, and the typical distribution of outgoing edge relationships for this type of entity is statistically analyzed. Typical relationship types with an occurrence rate exceeding 50% are selected by frequency from high to low, resulting in 7 categories. All 7 categories of typical outgoing edges exist, and the relationship type overlap is 1. Among the 314 catalyst entities, the node degree (i.e., the total number of one-hop adjacency relationships) of each entity has a mean degree of 5.8 and a standard deviation of 1.9. The degree of Cat012 is 7, with an absolute deviation of 1.2 from the mean degree and a standardized deviation of 0.63 standard deviations. The Three Sigma principle takes 3 times the standard deviation as the maximum allowable range for normal deviation. Cat012's standardized deviation of 0.63 is within this range, with a deviation ratio of 0.21. Multiplying the deviation ratio by the maximum penalty coefficient of 0.2 and subtracting it from 1 yields a degree matching degree of 0.958. Taking the arithmetic mean of relation type overlap (contribution ratio of 50%) and degree matching degree (contribution ratio of 50%) yields a structural consistency of 0.979. The calculation process for attribute combination consistency is as follows: the normalized density ratio is calculated to be 0.8, and the center proximity is 0.951. Taking the arithmetic mean of the normalized density ratio and the center proximity yields an attribute combination consistency of 0.8755. The reaction conditions corresponding to the source location of the knowledge to be tested were extracted from the spectral environment: temperature 320℃, pressure 2MPa, and H2 / CO ratio 2. Performance data of other catalysts of the same type as Cat012 under similar reaction conditions were retrieved from the spectral environment. Eight records with similar conditions were found. Normalized Euclidean distances (temperature normalization factor 100℃, pressure normalization factor 1MPa, ratio normalization factor 2) were calculated between the condition vector of the knowledge to be tested, Cat012, and the condition vectors of the above eight records. The distance values ​​were all less than 0.05, indicating a high degree of matching between the condition vectors themselves, and no distance penalty was required. The selectivity of the eight records under the same temperature conditions in the relevant spectral environment was 81.3% with a standard deviation of 1.35%. The deviation of the tested value, 85.3, from the mean was 2.96 standard deviations, corresponding to a one-sided probability of 0.15%, which significantly deviated from the mean of similar conditions. After standardization of the deviation, the experimental condition consistency score was 0.012.

[0042] The initial weighting coefficients were α0=0.40, β0=0.35, and γ0=0.25. The historical verification sample database contained 120 annotated manually reviewed records, of which 42 were confirmed as abnormal and 78 as normal. The data source was a specialized knowledge base for coal chemical and petrochemical knowledge graphs, built based on SCI (Science Citation Index) journal articles after collection, cleaning, compilation, classification, deconstruction, and reorganization, for the Chinese Academy of Sciences' pilot pre-research project "Construction of Chemical Engineering Knowledge Base and Research on Key Technologies," totaling over 31,700 data entries. Running the complete detection process on the aforementioned 120 samples with the initial weights yielded an accuracy rate (A) of 76.7%. In the first round, α was increased by 0.02 (to 0.42), while β and γ were reduced by the same amount to 0.34 and 0.24, respectively. On the validation set, this resulted in an accuracy of 77.2% (+0.5%), representing the largest improvement. Continuing with iterations 8 to 17, the accuracy fluctuated between 89.0% and 89.3%, with a standard deviation of 0.12 percentage points. The accuracy fluctuation was less than 0.5 percentage points, indicating a stable state had been reached. The final weights were determined as α1=0.52, β1=0.22, and γ1=0.26. The three consistency scores of the current Cat012 knowledge to be tested were then weighted and fused according to the final weights, resulting in a comprehensive consistency score of 0.705. The preset threshold was optimized and determined to be 0.75 during cross-validation. Since the current comprehensive consistency score of 0.705 < 0.75, which is below the preset threshold, a counterfactual test was triggered.

[0043] The original consistency score is compared with a preset threshold. If it falls below the preset threshold, a subsequent counterfactual testing process is triggered. The preset threshold is a pre-defined critical value for the consistency score, used to determine whether the knowledge to be tested is worthy of entering the counterfactual testing process. When the original consistency is lower than the preset threshold, the counterfactual test is triggered; when the original consistency is not lower than the preset threshold, the knowledge to be tested is deemed normal and the test is terminated. The preset threshold can be set by taking the quantiles of the original consistency distribution of anomalous knowledge in historical test samples, manually setting it based on the experience of domain experts, or optimizing it on historical samples through cross-validation. For example, the original consistency scores of all labeled samples and their corresponding anomalous / normal labels are extracted from the existing manual review history. A grid search strategy is used to traverse each candidate threshold in the range of 0.50 to 0.90 with a step size of 0.01. The accuracy and recall of classifying historical samples under each candidate threshold are calculated, and the threshold that maximizes both accuracy and recall (i.e., maximizes the F1 score) is selected as the current preset threshold.

[0044] If the original consistency score is greater than or equal to a preset threshold, the knowledge to be inspected is marked as normal and written to the inspection status log, including the unique identifier of the knowledge to be inspected, the original consistency score, the judgment result, the judgment timestamp, and the threshold version number used. Then, the computing resources occupied by the knowledge to be inspected are released, the graph environment cache data corresponding to the knowledge is cleared, and the status of the knowledge to be inspected is updated from "under inspection" to "inspection completed, normal". The process then proceeds to the next knowledge to be inspected. During this process, no candidate content extraction, counterfactual example construction, or consistency recalculation operations are performed, thus enabling the rapid release of normal knowledge.

[0045] If the original consistency score is significantly lower than a preset threshold, the knowledge to be tested is deemed anomalous and worthy of in-depth testing. Instead of marking the knowledge as anomalous, its status is updated to "triggered counterfactual testing," and the triggering reason, i.e., the original consistency score and threshold comparison information, is recorded in the log. Then, the program control flow jumps to the counterfactual testing module to begin extracting candidate content and constructing counterfactual knowledge examples. If the knowledge to be tested is attribute-based, the counterfactual testing constructs examples for different attribute value substitution methods (replacement value, replacement of the belonging entity); if it is relation-based, examples are constructed for the replacement of the tail entity. The entire process remains transparent to both upstream and downstream modules: the upstream module only needs to provide the original consistency score, and the downstream module only needs to receive the trigger status and the data packet of the knowledge to be tested to run independently.

[0046] Based on the counterfactual verification process, candidate content is extracted from the chemical knowledge graph, and the original attribute value, the original tail entity, or the entity to which the original attribute value belongs is replaced with the candidate content to construct counterfactual knowledge examples.

[0047] Further details are attached. Figure 2 As shown, this application further includes the following steps: obtaining candidate attribute values ​​or candidate entities from other samples or other experimental groups in similar literature as first candidates; obtaining candidate attribute values ​​or candidate entities from similar entities in the chemical engineering knowledge graph as second candidates; obtaining candidate content from the knowledge corresponding to similar local knowledge structures as third candidates; obtaining candidate content from the knowledge graph prediction results as fourth candidates; and obtaining the candidate content based on the first candidate, the second candidate, the third candidate, or the fourth candidate.

[0048] Specifically, the unique identifier of the document is retrieved from the source record of the knowledge to be tested. If the identifier exists, it is used as the search key to query other samples or experimental groups in the same category of documents that are also marked with the document identifier. Further filtering is performed to identify sample entities and their corresponding attribute values ​​that belong to the same table number but not the same row number as the knowledge to be tested. If the source location of the knowledge to be tested is marked with a paragraph number instead of a table number, the same type of entities appearing in that paragraph and their corresponding predicate attribute values ​​are extracted. If an experiment number is marked, the corresponding attribute values ​​of other samples under the same experiment number are extracted using that experiment number as the grouping key. For relational knowledge to be tested, the object is the tail entity, and the extraction method for other samples or experimental groups in the same category of documents is adjusted accordingly: other tail entities in the same document that have the same head entity type and relation type as the triplet to be tested are extracted, such as the reaction entities R002 and R003 corresponding to the catalyst entities Cat1 and Cat5 in the same document, respectively, used in the reaction relationship.

[0049] An embedding vector training model is used to train the embedding vectors of all entities in the chemical engineering knowledge graph, obtaining the coordinate vector of each entity in a low-dimensional vector space. Using the embedding vector of the entity to which the knowledge belongs in the test is the query vector, cosine similarity is calculated across all entity vectors, and they are sorted from highest to lowest similarity. Entities with the same type as the test entity and ranking in the top K similarity positions are selected as the second candidate set, where K is a positive integer, with a default value of 10, which can be adjusted based on the density of similar entities in the actual graph. For attribute-type test knowledge, the attribute values ​​of these similar entities under the same attribute predicate are extracted as second candidate attribute values; for relation-type test knowledge, the tail entities connected to these similar entities under the same relation type are extracted as second candidate tail entities. To ensure the chemical rationality of the candidate content, a minimum acceptance threshold of 0.85 for cosine similarity is set; entities with similarity below this threshold are not included in the second candidate set.

[0050] The local adjacency subgraph structure of the entity to be examined is extracted from the relevant graph environment. This subgraph, with the entity as the central node, includes the type and direction sequences of all nodes and relation edges within its one-hop and two-hop range. The local adjacency subgraph is transformed into a structural fingerprint, i.e., a fixed-length numerical vector, where each dimension represents whether a certain node type, a certain relation type, and a certain path length pattern appear in the subgraph. Using the structural fingerprint as the query key, the structural fingerprints of all other local subgraphs are retrieved from the graph database and sorted from closest to furthest according to Hamming distance. The central entities corresponding to the top K local subgraphs with the highest structural similarity are selected as the third candidate entity set. For attribute-type knowledge to be examined, the attribute values ​​of these candidate entities under the same attribute predicate are extracted as the third candidate attribute values; for relation-type knowledge to be examined, the tail entities connected to the candidate entities under the same relation type are extracted as the third candidate tail entities. The difference between the third candidate path and the second candidate path is that the former is based on the overall similarity of the subgraph structure rather than the similarity of single node embedding vectors, which can supplement more structurally similar entities when there are insufficient candidates with similar embedding vectors. Knowledge graph prediction results are generated by a knowledge graph completion model to identify missing or unverified objects (attribute values ​​or tail entities) in the knowledge being examined. The knowledge graph completion model infers based on existing association patterns in the graph, outputting several most likely missing candidate values ​​and their confidence scores. When the actual knowledge graph data lacks sufficient similar or related entities due to a limited number of documents, the prediction results can serve as a valuable supplement.

[0051] A knowledge graph completion model is used to predict links in the missing or suspicious parts of the knowledge to be examined. For attribute-type knowledge, the input format is constructed as (belonging entity ID, attribute predicate, candidate value), where the object to be predicted is the attribute value, and the model outputs each candidate attribute value and its confidence score. For relation-type knowledge, the input format is constructed as (belonging entity ID, relation type, candidate value), where the object to be predicted is the tail entity, and the model outputs each candidate tail entity and its confidence score. The top K prediction results with the highest confidence scores are selected as the fourth candidate set, and the confidence score of each candidate is recorded. The fourth candidate path is only used when the entity density in the graph region where the knowledge to be examined is low, and it is impossible to obtain a sufficient number of candidates from the first, second, and third paths, serving as a supplementary candidate source.

[0052] The candidate content obtained from each path is merged into a candidate pool, and the source tag of each candidate content is recorded, indicating whether it comes from the first, second, third, or fourth candidate. If duplicate content appears in the candidate pool, a deduplication operation is performed, and the union of all source tags is retained.

[0053] Furthermore, this application also includes the following steps: keeping the belonging entity unchanged and replacing the original attribute value with a candidate attribute value to obtain a first construction scheme; keeping the head entity and relation unchanged and replacing the original tail entity with a candidate entity to obtain a second construction scheme; keeping the attribute value unchanged and replacing the belonging entity of the original attribute value with a candidate belonging entity to obtain a third construction scheme; and constructing the counterfactual knowledge example based on the first construction scheme, the second construction scheme, or the third construction scheme.

[0054] Specifically, the type of knowledge to be checked is determined. If the object of the knowledge to be checked is an attribute value, a first construction scheme (attribute value replacement) counterfactual example is generated by default: keeping the belonging entity and relation of the knowledge to be checked unchanged, each candidate attribute value is selected sequentially from the candidate pool, and the original attribute value is replaced one by one, generating an independent counterfactual knowledge example for each replacement. At the same time, a third construction scheme (belonging entity replacement) counterfactual example is generated: keeping the original attribute value and relation unchanged, a candidate entity of the same type as the current belonging entity is selected from the candidate pool as the new belonging entity, and the original belonging entity is replaced one by one, generating an independent counterfactual knowledge example for each replacement. If the object of the knowledge to be checked is a tail entity, i.e., a relational triple, a second construction scheme (tail entity replacement) counterfactual example is generated: keeping the head entity and relation unchanged, a candidate entity of the same type as the original tail entity is selected from the candidate pool as the new tail entity, and the original tail entity is replaced one by one, generating an independent counterfactual knowledge example for each replacement. When performing multi-scheme construction, the single variable principle of replacing only one element at a time is followed to ensure that subsequent consistent changes can be uniquely attributed.

[0055] For each counterfactual example to be generated, a complete counterfactual knowledge triple is constructed. Taking the first construction scheme as an example, if there are 12 candidate attribute values ​​in the candidate pool, 12 counterfactual examples are generated. Each example uses the same attributing entity and relation as the subject, and places different candidate attribute values ​​in the object position. Each counterfactual example independently carries an original source tag, indicating the specific source path of the candidate value. All generated counterfactual examples are grouped and stored according to the construction scheme, and a temporary identifier is assigned to each counterfactual example in the format CF-original task number-scheme code-serial number, such as CF-TASK-0047-S1-001, which represents the first counterfactual example generated by the first construction scheme of task 0047. After construction, all other attributes, adjacency relations, and source literature information of the attributing entity or head entity involved in the knowledge to be examined are kept unchanged, that is, the counterfactual example and the knowledge to be examined differ only in the single element that is replaced.

[0056] Building upon the standard construction process, several enhancement strategies are implemented to improve the quality and coverage of counterfactual examples. Instead of limiting to a single document, other entities with similarities to the currently attributed entity in terms of constituent elements, element ratios, preparation methods, and carrier types are retrieved from the global chemical engineering knowledge graph. Their corresponding attribute values ​​are then included in the candidate pool. This process significantly increases the number of candidates when the graph is large. When the number of candidate values ​​in the existing graph is insufficient to support effective counterfactual testing (e.g., fewer than 5 candidates in the candidate pool), a pre-trained conditional generation model (such as a variational autoencoder) is loaded. Using the compositional characteristics, preparation conditions, and reaction conditions of the entity to be tested as input, a theoretically reasonable probability distribution of attribute values ​​under these conditions is generated. Three to five synthetic candidate values ​​are sampled from this distribution and added to the candidate pool as a supplement to the fourth candidate path. All candidate values ​​are categorized into three levels based on their deviation from the original values: conservative (absolute deviation not exceeding ±5% of the original value), moderate (absolute deviation between ±5% and ±20% of the original value), and aggressive (absolute deviation exceeding ±20% of the original value). When constructing counterfactual examples, at least one candidate value is selected from each level to cover two different causes: magnitude deviation anomalies and slight deviation anomalies. Before using any candidate value to construct a counterfactual example, it is substituted into the chemical engineering ontology knowledge base to check whether it satisfies physicochemical laws such as thermodynamic equilibrium constraints, side reaction competition, and upper limits of reaction path selectivity. If a candidate value violates any preset mechanism constraint, it is removed from the candidate pool. After completing all the above enhancement strategies and constraint filtering, the final set of counterfactual examples used for consistency calculations is determined.

[0057] Based on the extraction of candidate content, a systematic and controllable permutation is implemented to generate counterfactual knowledge examples for consistency comparison. Simultaneously, two-way construction operations are performed to form a bidirectional verification framework, upon which a global optimization problem is built. Bidirectional reloading involves performing two directions of attribution permutation operations simultaneously during the counterfactual testing process. The first direction is value-for-attribution, where the attribute value remains unchanged and is assigned to different candidate samples to examine whether the attribute value is more suitable for the spectral environment of other samples. The second direction is attribution-for-value, where the attributing entity remains unchanged and is assigned different candidate attribute values ​​to examine whether the attributing entity is more suitable for other attribute values. These two directions are mirror images of each other, jointly revealing the true causes of anomalies.

[0058] Multiple candidate selectivity values ​​are obtained from the candidate pool. While maintaining all other attributes, adjacency relationships, and source literature information of the entity to which the knowledge to be tested belongs, the original attribute values ​​are sequentially replaced with the candidate selectivity values. Each replacement generates an independent counterfactual knowledge example. For example, selecting a knowledge attribute to be tested, such as catalyst sample Cat-A, target product selectivity, 41%, extracts relevant knowledge about Cat-A, including its composition, preparation conditions, reaction conditions, conversion rate, and products. Knowledge of other samples such as Cat-B and Cat-C from similar literature is also extracted to form a relevant spectral environment. The degree of consistency between (Cat-A, target product selectivity, 41%) and other attributes of Cat-A, reaction conditions, experimental group relationships, and knowledge of similar samples is analyzed to obtain the original consistency result. If the candidate pool contains three candidate selectivity values ​​(candidate value 1, candidate value 2, and candidate value 3), the triplet forms are (Cat-A, target product selectivity, candidate value 1), (Cat-A, target product selectivity, candidate value 2), and (Cat-A, target product selectivity, candidate value 3), respectively. These are used to examine whether the original attribute value of 41% is the key factor causing the inconsistency between Cat-A and the spectral environment. If the consistency significantly improves after replacing the attribute value with the candidate value, it indicates that the original attribute value itself may contain errors, such as numerical identification errors or unit misreadings. Multiple candidate samples belonging to the same literature, table, or experimental system as Cat-A are obtained from the candidate pool. While keeping the original attribute value of 41% and the relationship unchanged, the belonging entity is sequentially replaced with each candidate sample. Each replacement generates an independent counterfactual knowledge example. If there are two candidate samples, Cat-B and Cat-C, two counterfactual examples are generated, with triples in the form of (Cat-B, target product selectivity, 41%) and (Cat-C, target product selectivity, 41%), respectively. These are specifically used to test whether the original attribute value 41% has been incorrectly attributed to Cat-A. If attaching 41% to Cat-B or Cat-C significantly improves consistency, it indicates that 41% itself is a correct value, but should belong to other samples rather than Cat-A. These two construction operations together constitute a bidirectional reattachment verification framework. It not only tests whether 41% belongs to Cat-A, but also simultaneously tests whether the true selectivity of Cat-A might be the value of other samples. This expands the scope of the test from a single piece of knowledge to an entity-attribute value association group. Starting with the entity to be examined, Cat-A, all sample entities (Cat-A, Cat-B, Cat-C, Cat-D, etc.) in the same literature, table, or experimental group, and their respective currently attached attribute values ​​(value 1, value 2, value 3, value 4, etc.), are extracted to construct a bipartite graph. The left nodes of the bipartite graph represent all sample entities, and the right nodes represent all attribute values. The existing attachment relationships constitute the initial edge set in the graph.For each possible attachment combination (i.e., which attribute value each entity is assigned), calculate the sum or average of the original consistency of all entities under that combination, which serves as the global consistency score for that attachment scheme. Search among all possible combinations for the attachment scheme that maximizes the global consistency score; this is the globally optimal attribute-entity attachment scheme. If, in the globally optimal scheme, Cat-A is assigned an attribute value different from 41% (e.g., candidate value 2), while 41% is assigned to Cat-B, it indicates that at least one attribution error exists in the original knowledge. The 41% currently attached to Cat-A is marked as a suspected anomaly, and the optimal matching result is recorded as evidence output.

[0059] Furthermore, this application also includes the following steps: satisfying predetermined substitution constraints, wherein the predetermined substitution constraints refer to the following: when constructing a counterfactual knowledge example by replacing the original attribute value with the belonging entity, the selected candidate belonging entity must have an existing attribute value corresponding to the same attribute predicate definition as the original attribute value, and the existing attribute value matches the original attribute value in terms of numerical magnitude and unit type; and the candidate belonging entity and the belonging entity of the original attribute value have the same entity type label and the same attribute predicate definition in the chemical knowledge graph, to ensure that the candidate belonging entity and the original attribute value are consistent. There is a comparable knowledge graph basis between them; if the candidate attribution entity does not have the existing attribute value, or the existing attribute value does not match the original attribute value in terms of numerical magnitude or unit type, then the candidate attribution entity is excluded to ensure that the candidate attribution entity has a comparable knowledge graph basis between the existing attribute value and the original attribute value; when constructing counterfactual knowledge examples by replacing the original attribute value, the source entity of the selected candidate attribute value and the attribution entity of the original attribute value have a preset degree of similarity in reaction system or experimental conditions to ensure that the counterfactual knowledge examples are reasonable in the sense of chemical engineering.

[0060] Specifically, before constructing counterfactual knowledge examples, the rationality verification of candidate content for attribute value replacement direction and attribution entity replacement direction is performed according to two different types of constraint rules. Only candidate content that passes the verification can enter the subsequent counterfactual example construction process. The pre-defined substitution constraints are a series of screening rules and restrictions that must be met in advance before constructing counterfactual knowledge examples. They are used to ensure that all examples entering the counterfactual verification process are reasonable and interpretable at both the semantic and chemical engineering levels of the knowledge graph, avoiding distortion of consistency comparison results due to the use of unfounded or unreasonable candidate content.

[0061] Regarding the constraint execution for replacing the attribution entity, when preparing to generate counterfactual examples using the third construction scheme, the attribute predicate definition corresponding to the original attribute value is obtained from the knowledge graph ontology layer, including the expected data type, unit of measurement, and legal value range of the predicate. Subsequently, the type label of the candidate attribution entity is read and compared with the type label of the original attribution entity; the two must be completely identical for the process to continue. If the type labels are different, the candidate attribution entity is directly filtered out and not allowed to proceed to the next construction stage. After the type labels are consistent, it is checked whether there is an existing attribute value corresponding to the attribute predicate definition with the same attribute value as the original attribute value under the candidate entity. For example, if the target product selectivity is not present, if the entity has no historical record of the predicate, the candidate entity does not have a comparable knowledge graph basis and is also filtered. If the entity has a historical record of the same attribute predicate, the value and unit of the historical record are extracted and compared with the original attribute value in terms of numerical magnitude and unit type. If the unit types are different, it is directly filtered. If the numerical magnitudes differ by more than one order of magnitude, such as the original value being 41% and the candidate entity's historical record being 0.41%, which is two orders of magnitude different, it is determined that the two are not comparable and the candidate entity is filtered. Only when the candidate entity and the original entity have the same entity type label, the candidate entity has an existing attribute value corresponding to the attribute predicate definition with the same attribute value as the original attribute value, and the existing attribute value and the original attribute value have the same unit of measurement and the numerical magnitudes differ by no more than one order of magnitude, can the candidate entity pass the constraint check and formally enter the counterfactual example construction process. If a candidate entity does not have existing attribute values, or if the existing attribute values ​​do not match the original attribute values ​​in terms of numerical magnitude or unit type, the candidate entity is excluded to ensure that the candidate entity has a comparable knowledge graph basis between the existing attribute values ​​and the original attribute values.

[0062] Regarding the constraint execution for attribute value replacement direction, when preparing to generate counterfactual examples using the first construction scheme, the original entity from which the candidate attribute value originates and its corresponding reaction system information are extracted, including the catalyst composition information and experimental condition information of the source entity. Simultaneously, the corresponding information of the entity to be examined is read, and the two are compared item by item across all dimensions of the reaction system. The absolute deviation of continuous numerical parameters is calculated and compared with a preset threshold, and consistency matching is performed on categorical parameters. Only after all comparisons pass can the constraint check be passed. If any item exceeds the preset deviation range or the categorical parameters do not match, the candidate attribute value is deemed unreasonable in a chemical engineering sense and cannot be used to construct counterfactual examples. After completing all checks of the above two types of constraints, all verified candidate contents are marked as qualified and submitted to the counterfactual example construction module for actual replacement and generation operations. The pre-defined degree of similarity is a set of quantitative indicators and corresponding acceptance thresholds used to measure whether two reaction systems or experimental conditions are sufficiently similar to support cross-entity substitution of candidate attribute values. These indicators include, but are not limited to, deviations in reaction temperature, reaction pressure, feed gas composition ratio, consistency of catalyst support type, and similarity or class of active components. When the deviations of each indicator do not exceed their respective pre-defined thresholds, the two reaction systems are deemed to have a pre-defined degree of similarity, and the candidate attribute values ​​can be accepted for cross-entity counterfactual case construction.

[0063] Calculate the counterfactual consistency between the counterfactual knowledge example and the relevant graph environment. When the counterfactual consistency is better than the original consistency, mark the knowledge to be tested as a suspected anomaly.

[0064] Further details are attached. Figure 3 As shown, this application further includes the following steps: replacing the knowledge to be tested with the counterfactual knowledge example, calculating the structural consistency, attribute combination consistency, and experimental condition consistency in the relevant graph environment; weighting and fusing the structural consistency, attribute combination consistency, and experimental condition consistency to obtain a comprehensive consistency score, and recording the comprehensive consistency score as the counterfactual consistency.

[0065] Specifically, the type attribute of the counterfactual example is determined. If it is constructed by replacing the original attribute value (first construction scheme), then its head entity is the original belonging entity, the relation is the original attribute predicate, and the object is the new candidate attribute value. If it is constructed by replacing the belonging entity, then its head entity is the new candidate belonging entity, the relation remains unchanged, and the object is the original attribute value. If it is constructed by replacing the tail entity, then its head entity and relation remain unchanged, and the tail entity is the new candidate entity.

[0066] After determining the type, the structural consistency calculation module is invoked, taking the triples of the counterfactual examples as input and placing them in the same relevant graph environment as the original consistency calculation, including the same adjacency subgraph and the same co-occurrence knowledge set, to calculate the structural consistency score of the counterfactual examples on the graph topology. The attribute combination consistency calculation module is then invoked, taking the object values ​​(attribute values ​​or tail entity types) of the counterfactual examples as input, using the same set of reference attribute values ​​and the same kernel density estimation model parameters as the original consistency calculation, to calculate the attribute combination consistency score of the counterfactual examples on the statistical distribution.

[0067] The experimental condition consistency calculation module is invoked, using the experimental condition parameters corresponding to the counterfactual sample as input. If the counterfactual sample replaces the attributing entity, the reaction condition parameters corresponding to the new attributing entity at the source location are used. If the attribute value is replaced but the attributing entity remains unchanged, the original reaction condition parameters are kept unchanged. The same experimental condition reference set and empirical rule constraints as in the original consistency calculation are used to calculate the experimental condition consistency score of the counterfactual sample in experimental logic. The above three consistency calculation processes are repeated for each counterfactual sample in the candidate pool until all counterfactual samples have been calculated.

[0068] Read the determined final weight coefficients, namely the final weights for structural consistency, attribute combination consistency, and experimental condition consistency. For each counterfactual example, linearly weight and fuse its consistency scores across the three dimensions according to the final weights, in the same manner as calculating the original consistency. The fused result is the counterfactual consistency score for that counterfactual example. Link and store the construction scheme identifier, candidate value source label, and corresponding counterfactual consistency score for each counterfactual example to form a counterfactual consistency result list.

[0069] Furthermore, this application also includes the following steps: when the counterfactual consistency of one or more counterfactual knowledge examples is stable and significantly better than the original consistency, it is determined that the replaced original attribute value, the original tail entity, or the entity to which the original attribute value belongs is a key factor causing the knowledge to be tested to exhibit anomalous behavior in the relevant graph environment, and the knowledge to be tested is marked as suspected anomaly; wherein, stable and significantly better than satisfies the following quantitative criteria: significantly better than means that the difference between the counterfactual consistency and the original consistency is greater than a preset minimum improvement threshold, or the improvement ratio of the counterfactual consistency relative to the original consistency is greater than a preset ratio threshold; stable better than means that among the constructed counterfactual knowledge examples, the proportion of the number of counterfactual knowledge examples that satisfy the above significantly better condition to the total number of constructed counterfactual knowledge examples is not less than a preset number ratio threshold, and the dispersion of the consistency improvement magnitude among each counterfactual knowledge example that satisfies the significantly better condition is less than a preset fluctuation threshold; or, stable better than means that counterfactual knowledge examples are repeatedly constructed for the same knowledge to be tested, and the counterfactual consistency obtained each time satisfies the above significantly better condition.

[0070] Specifically, the original consistency score is compared with the consistency score list of all counterfactual knowledge examples. The difference between the consistency score of each counterfactual knowledge example and the original consistency score, as well as the improvement percentage relative to the original consistency, are calculated. Two configuration parameters are read: a preset minimum improvement threshold and a preset percentage threshold. The preset minimum improvement threshold is a critical value used to determine whether the absolute difference between counterfactual consistency and original consistency reaches a significant level. It is a pre-set positive real number, usually determined based on the upper bound of the natural fluctuation distribution of consistency of normal knowledge in counterfactual testing in historical test samples. For example, if the standard deviation of the natural fluctuation range of consistency of normal knowledge in counterfactual testing is 0.03, the minimum improvement threshold can be set to 0.08 to exclude accidental improvements caused by natural fluctuations. When the difference between counterfactual consistency and original consistency is greater than or equal to the preset minimum improvement threshold, it is considered significantly better. The preset percentage threshold is a critical value used to determine whether the improvement percentage of counterfactual consistency relative to original consistency reaches a significant level. It is also a pre-set positive real number, such as 5%, and complements the preset minimum improvement threshold. If the absolute difference of a counterfactual example is greater than or equal to a preset minimum improvement threshold, or if the improvement ratio of the example is greater than or equal to a preset ratio threshold, then the example is deemed to meet the significantly better condition, is marked as a significantly improved example, and is included in the significantly improved example set. If neither condition is met, the example is excluded from subsequent stability determination.

[0071] The proportion of significantly improved examples to the total number of counterfactual examples is calculated, and this proportion is compared with a preset threshold. The preset threshold is a statistical indicator used to determine the stability of consistent counterfactual improvements; it represents the minimum proportion of examples that should meet the condition of being significantly better than the original among all constructed counterfactual knowledge examples. The preset threshold is set to exclude cases where only a few candidate values ​​improve incidentally while most candidate values ​​do not, ensuring that consistent improvements are collective rather than isolated. For example, the preset threshold is 60%. If the proportion reaches or exceeds the preset threshold, the dispersion of the consistency differences among all significantly improved examples is calculated. First, the arithmetic mean of the differences among all significantly improved examples is calculated. Then, the average of the squares of the differences between each difference and the arithmetic mean is calculated, and the square root is taken to obtain the standard deviation. The standard deviation is compared with a preset fluctuation threshold. If the standard deviation is less than or equal to the preset fluctuation threshold, stability is considered satisfied. A preset fluctuation threshold is a statistical indicator used to determine whether the improvement magnitude among counterfactual examples that meet the significantly better condition is stable. It indicates that the dispersion of the consistency difference among significantly improved examples should be lower than this threshold, used to exclude cases where the improvement magnitude fluctuates wildly and is extremely unstable, ensuring consistent improvement. For example, the preset fluctuation threshold is 0.02. Stability verification requires not only a sufficient number of improved examples, but also that the improvement magnitudes of each example are close to each other, without significant differences in improvement magnitude. Alternatively, for the same knowledge to be tested, by randomly sampling different candidate subsets, randomly selecting different candidate paths, or randomly switching different permutation schemes, the counterfactual example construction and consistency calculation are repeated multiple times, such as 5 times. If the counterfactual consistency of all counterfactual examples obtained in each repetition meets the significantly better condition, then stability is considered satisfied.

[0072] The results of the significance and stability assessments are combined. If both the significance and stability assessments pass, the replaced original attribute value, original tail entity, or the entity to which the original attribute value belongs is determined to be a key factor causing the anomalous behavior of the knowledge under test in the relevant graph environment, and the knowledge under test is marked as a suspected anomaly. If either the significance or stability assessment fails, the evidence is deemed insufficient, no anomaly is marked, and the status of the knowledge under test is updated to "Test Completed: No Anomalies Found." If marked as a suspected anomaly, the replaced original element (attribute value / tail entity / attached entity) is marked as the source of the anomaly and stored in association with the assessment record for subsequent output and manual review.

[0073] Based on the suspected abnormal tags, the knowledge to be inspected, the counterfactual knowledge examples, and consistency change information are output for manual review.

[0074] Specifically, the system reads the task number, original triplet content, original consistency score, consistency score list of all counterfactual examples, sample selection results that meet the stable and significantly better criteria, the source of the anomaly determination, and the rule version number on which the determination is based for all knowledge items marked as potentially anomaly. An independent determination report is generated for each piece of knowledge item suspected of being anomaly, prominently displaying the determination conclusion of "suspected anomaly" and the source of the anomaly, and listing the basic information of the knowledge item to be inspected in sequence.

[0075] Retrieve one or more counterfactual examples with the largest discrepancies from the counterfactual example cache. Extract and sort their complete triple content, candidate value source tags, source path types, counterfactual consistency scores, and discrepancies. Select the top 3 to 5 examples from the discrepancy ranking as core supporting evidence and include them in the report. Retrieve relevant graph knowledge that directly conflicts with the knowledge under test from the relevant graph environment. In the adjacency subgraph of the knowledge under test, calculate the semantic distance or reconciliation score between each adjacent knowledge and the knowledge under test. Select the 3 to 5 adjacent knowledge with the lowest reconciliation scores, i.e., the knowledge that is most incompatible with the knowledge under test, and include them as conflicting knowledge in the report. For each conflicting knowledge, extract its source literature and specific source location description, and annotate them in the report.

[0076] The above information is organized according to the configured preset output format. If configured as JSON format, all information is serialized according to a predefined field structure to generate a complete data package containing three layers: conclusion, evidence chain, and source information. If configured as PDF report format, a report generation template is called, and the information is filled into preset tables and text paragraphs to generate a printable review report. The structured data package or report is stored in the specified output directory or database table, and a review task notification is sent to the human reviewers through preset notification channels. The notification includes the number of suspected anomalies, a list of task numbers, and a report access link.

[0077] Update the status of all output suspected anomalous knowledge from "triggered counterfactual testing" to "output pending review," and record the output timestamp and report number. After completing the above output, explicitly do not perform any modification, deletion, or replacement operations on the original knowledge triples in the chemical engineering knowledge graph. The original triples remain unchanged in the knowledge graph. The only graph change is to attach a removable review status marker, such as "output pending review," to the metadata layer of the knowledge triple to be checked, and write the evidence report number into the extended attribute of the knowledge, so that reviewers can retrieve the report through the graph management interface. The attached marker does not involve any change to the knowledge content itself and can be removed after review. After manually reviewing the suspected anomalous knowledge based on the output report, the reviewers decide whether to modify the graph. If an anomaly is confirmed, the knowledge content is manually corrected and the pending review marker is removed; if it is determined to be a false alarm, only the pending review marker is removed without modifying any knowledge content.

[0078] In summary, the outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing provided in this application has the following beneficial effects: By acquiring a chemical engineering knowledge graph and determining the knowledge to be tested, the knowledge to be tested is a knowledge triple containing original attribute values ​​or original tail entities; using the knowledge to be tested as an anchor point, relevant entity attributes, adjacency relationships, and similar knowledge are extracted from the chemical engineering knowledge graph to construct a relevant graph environment; the knowledge to be tested is placed in the relevant graph environment to obtain original consistency, and a counterfactual testing process is triggered when the original consistency is lower than a preset threshold; based on the counterfactual testing process, candidate content is extracted from the chemical engineering knowledge graph, and the original attribute values, original tail entities, or the entities to which the original attribute values ​​belong are replaced with the candidate content to construct counterfactual knowledge examples; the counterfactual consistency between the counterfactual knowledge examples and the relevant graph environment is calculated, and when the counterfactual consistency is better than the original consistency, the knowledge to be tested is marked as a suspected anomaly; based on the suspected anomaly label, the knowledge to be tested, the counterfactual knowledge examples, and consistency change information are output for manual review. In other words, by utilizing entity attributes, relational structures, literature sources, and similar knowledge patterns in chemical engineering knowledge graphs, counterfactual knowledge examples are constructed. By comparing the consistency changes between original knowledge and counterfactual knowledge in the graph, potential attribute values ​​or relational entities that may be extracted incorrectly can be identified. This provides a technical means for automated quality inspection of chemical engineering knowledge graphs, accurately identifying and attributing hidden anomalies in the absence of external standard answers, outputting interpretable evidence chains for manual review, avoiding the risk of error correction, and improving the credibility of chemical engineering knowledge graphs.

[0079] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0080] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for detecting outliers in chemical engineering knowledge graphs based on counterfactual consistency testing, characterized in that, include: Acquire a chemical engineering knowledge graph and identify the knowledge to be inspected, wherein the knowledge to be inspected is a knowledge triple containing original attribute values ​​or original tail entities; Using the knowledge to be tested as anchor points, relevant entity attributes, adjacency relationships, and similar knowledge are extracted from the chemical knowledge graph to construct a relevant graph environment; The knowledge to be tested is placed in the relevant graph environment to obtain original consistency. When the original consistency is lower than a preset threshold, the counterfactual testing process is triggered. Based on the counterfactual verification process, candidate content is extracted from the chemical knowledge graph, and the original attribute value, the original tail entity, or the entity to which the original attribute value belongs is replaced with the candidate content to construct counterfactual knowledge examples. Calculate the counterfactual consistency between the counterfactual knowledge example and the relevant graph environment. When the counterfactual consistency is better than the original consistency, mark the knowledge to be tested as a suspected anomaly. Based on the suspected abnormal tags, the knowledge to be inspected, the counterfactual knowledge examples, and consistency change information are output for manual review.

2. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 1, characterized in that, Using the knowledge to be examined as anchor points, relevant entity attributes, adjacency relationships, and similar knowledge are extracted from the chemical engineering knowledge graph to construct a relevant graph environment, including: Using the entity corresponding to the knowledge to be inspected as the central node, an adjacency subgraph of the central node is extracted from the chemical knowledge graph. The adjacency subgraph includes one-hop entities and relationships directly connected to the central node, as well as multi-hop entities and relationships indirectly associated with the central node. Simultaneously, co-occurring knowledge groups belonging to the same chemical engineering and scientific literature as the central node are extracted. These co-occurring knowledge groups include all entities and attribute values ​​appearing in the same paragraph, the same table row, or under the same experiment number. This ensures that the relevant graph environment simultaneously contains association information at the graph topology level and experimental association information at the literature context level.

3. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 2, characterized in that, To obtain original consistency by placing the knowledge to be inspected within the relevant map environment, the following steps are taken: Calculate the structural consistency, attribute combination consistency, and experimental condition consistency of the knowledge to be tested in the relevant map environment; The structural consistency, attribute combination consistency, and experimental condition consistency are weighted and fused to obtain a comprehensive consistency score, which is then recorded as the original consistency. Wherein, the structural consistency is used to measure the rationality of the topological structure of the knowledge triple in the relevant graph environment, the attribute combination consistency is used to measure the degree of matching between the attribute value and the statistical distribution of the same type of entity in the same attribute dimension, and the experimental condition consistency is used to measure the degree of logical matching between the attribute value or tail entity and the experimental condition knowledge in the relevant graph environment.

4. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 3, characterized in that, The structural consistency, attribute combination consistency, and experimental condition consistency are weighted and fused, which includes the following: Using the accuracy of anomaly detection as a feedback signal, the weight values ​​corresponding to structural consistency, attribute combination consistency, and experimental condition consistency are gradually adjusted according to the direction of change of the accuracy, so that the accuracy increases with the weight adjustment, until the accuracy reaches a preset stable state and the final weight value is determined.

5. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 3, characterized in that, When the original consistency is not lower than the preset threshold, the knowledge to be inspected is determined to be normal and the inspection process is terminated.

6. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 1, characterized in that, Based on the counterfactual testing process, candidate content is extracted from the chemical engineering knowledge graph, including: Candidate attribute values ​​or candidate entities are obtained from other samples or experimental groups in similar literature and used as first candidates; Candidate attribute values ​​or candidate entities are obtained from similar entities in the chemical knowledge graph and used as second candidates. Candidate content is obtained from the knowledge corresponding to similar local knowledge structures and used as the third candidate; Candidate content is obtained from the knowledge graph prediction results and used as the fourth candidate; The candidate content is obtained based on the first candidate, the second candidate, the third candidate, or the fourth candidate.

7. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 6, characterized in that, Replacing the original attribute value, the original tail entity, or the entity to which the original attribute value belongs with the candidate content, constructing a counterfactual knowledge example, including: By keeping the belonging entity unchanged and replacing the original attribute values ​​with candidate attribute values, a first construction scheme is obtained; By keeping the head entity and relationships unchanged and replacing the original tail entity with a candidate entity, a second construction scheme is obtained; By keeping the attribute values ​​unchanged and replacing the original attribute value's belonging entity with the candidate belonging entity, a third construction scheme is obtained. The counterfactual knowledge example is constructed based on the first construction scheme, the second construction scheme, or the third construction scheme.

8. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 3, characterized in that, Calculating the counterfactual consistency between the counterfactual knowledge examples and the relevant graph environment includes: The counterfactual knowledge example is used to replace the knowledge to be tested, and the structural consistency, attribute combination consistency, and experimental condition consistency in the relevant graph environment are calculated. The structural consistency, attribute combination consistency, and experimental condition consistency are weighted and fused to obtain a comprehensive consistency score, which is then recorded as the counterfactual consistency.

9. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 7, characterized in that, Constructing the counterfactual knowledge example further includes: The predetermined permutation constraint condition is satisfied, wherein the predetermined permutation constraint condition refers to: When constructing counterfactual knowledge examples by replacing the original attribute value with the belonging entity, the selected candidate belonging entity must have an existing attribute value corresponding to the same attribute predicate definition as the original attribute value, and the existing attribute value must match the original attribute value in terms of numerical magnitude and unit type. Furthermore, the candidate attribution entity and the attribution entity of the original attribute value have the same entity type label and the same attribute predicate definition in the chemical knowledge graph, to ensure that there is a comparable knowledge graph basis between the candidate attribution entity and the original attribute value; If the candidate entity does not have the existing attribute value, or the existing attribute value does not match the original attribute value in terms of numerical magnitude or unit type, then the candidate entity is excluded to ensure that the candidate entity has a comparable knowledge graph basis through the existing attribute value and the original attribute value. When constructing counterfactual knowledge examples by replacing the original attribute values, the source entity of the selected candidate attribute value and the entity to which the original attribute value belongs have a predetermined degree of similarity in the reaction system or experimental conditions, so as to ensure that the counterfactual knowledge examples are reasonable in the sense of chemical engineering.

10. The outlier detection method for chemical engineering knowledge graphs based on counterfactual consistency testing according to claim 1, characterized in that, When the counterfactual consistency is superior to the original consistency, the knowledge to be inspected is marked as potentially abnormal, including: When the counterfactual consistency of one or more counterfactual knowledge examples is stable and significantly better than the original consistency, it is determined that the replaced original attribute value, the original tail entity, or the entity to which the original attribute value belongs is a key factor causing the knowledge to be tested to exhibit anomalous behavior in the relevant graph environment, and the knowledge to be tested is marked as a suspected anomaly. Among them, it is stable and significantly better than satisfying the following quantitative criteria: Significantly better than means that the difference between the counterfactual consistency and the original consistency is greater than a preset minimum improvement threshold, or that the improvement ratio of the counterfactual consistency relative to the original consistency is greater than a preset ratio threshold; "Stable superiority" means that, among the multiple counterfactual knowledge examples constructed, the proportion of the number of counterfactual knowledge examples that meet the above-mentioned significantly superiority condition to the total number of constructed counterfactual knowledge examples is not less than a preset number proportion threshold, and the dispersion of the consistency improvement magnitude among the counterfactual knowledge examples that meet the significantly superiority condition is less than a preset fluctuation threshold. Alternatively, "stable superiority" means that when counterfactual knowledge examples are repeatedly constructed for the same knowledge to be tested, the consistency of the counterfactual knowledge obtained each time satisfies the above-mentioned "significant superiority" condition.