An industrial defect intelligent decision-making method based on a knowledge graph and double reasoning

By constructing a knowledge graph and using a dual-reasoning method, combined with fuzzy reasoning and symbolic reasoning, the problems of low accuracy and low efficiency in defect detection in existing technologies are solved, and efficient and accurate defect identification and judgment of complex workpieces are achieved.

CN122491440APending Publication Date: 2026-07-31ZHEJIANG SCI-TECH UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG SCI-TECH UNIV
Filing Date
2026-07-06
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies have low accuracy and efficiency in defect detection when dealing with workpieces of different product types and process conditions. They are unable to fully cover the defect types and distribution characteristics of different workpieces, resulting in low detection efficiency.

Method used

A knowledge graph is constructed, and case-based reasoning and symbolic reasoning are combined. Through fuzzy reasoning and dual-reasoning intelligent decision-making methods, an appropriate defect detection algorithm is selected. When the detection results conflict, a secondary inference process is triggered, including switching algorithms for re-inspection or adjusting image acquisition parameters to improve detection accuracy and robustness.

Benefits of technology

It improves the ability to identify rare defects, enhances the robustness and interpretability of the system, forms a tightly coupled closed-loop decision-making system, and significantly improves the accuracy and fault tolerance of judgment under complex working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491440A_ABST
    Figure CN122491440A_ABST
Patent Text Reader

Abstract

This invention provides an intelligent decision-making method for industrial defects based on knowledge graphs and dual reasoning. The method constructs a knowledge graph and trains an image encoding model to associate expert knowledge with visual features. Similar case retrieval is performed based on the aligned image encoding model and the knowledge graph embedding model; candidate defect detection algorithms are scored, and the optimal detection algorithm is adaptively selected to obtain the defect detection result; a defect severity score is obtained through symbolic reasoning, and a secondary inference loop is triggered when the symbolic reasoning and the defect detection result conflict. This method, employing a knowledge graph, symbolic reasoning, and secondary inference loop model, improves the accuracy, robustness, and intelligence of defect detection, enhances the ability to identify and reason about rare defects, and achieves interpretable intelligent decision-making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of defect detection technology, specifically relating to an intelligent decision-making method for industrial defects based on knowledge graphs and dual reasoning. Background Technology

[0002] Workpiece defect detection technology has evolved from traditional manual inspection to modern automated inspection. Currently, deep learning technology is the mainstream approach for automated workpiece inspection. This process integrates multiple technologies such as high-speed cameras, X-ray scanning, and ultrasonic detection, using convolutional neural networks and target detection algorithms to achieve end-to-end defect identification. This enables seamless collaboration between inspection and production, and the accuracy rate far exceeds that of manual inspection.

[0003] However, existing technologies face challenges when dealing with workpieces of different product types and process conditions, whose defect types and distribution characteristics vary greatly. A single detection method cannot fully cover all of them, resulting in low accuracy when performing defect detection on different workpieces. Instead, corresponding defect detection algorithms can be set up specifically for defect detection. Although this improves the accuracy of defect detection, it also leads to low efficiency. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides an intelligent decision-making method for industrial defects based on knowledge graphs and dual reasoning. This method utilizes knowledge graphs, case-based reasoning, and symbolic reasoning to automatically analyze and make decisions regarding visual defects in industrial products, overcoming the limitations of existing technologies in intelligent decision-making for industrial visual defects and improving the system's accuracy, robustness, and interpretability.

[0005] The technical solution includes the following steps: S1. Knowledge graph construction: Construct a knowledge graph containing historical product defect cases and their related information; S2. Defect Detection Algorithm Selection: Retrieve the Top-most similar algorithms from the knowledge graph. k A historical product defect case; based on k The target defect detection algorithm is selected from a set of pre-defined candidate defect detection algorithms for each historical product defect case. S3. Defect Detection: The target defect detection algorithm is used to identify the image and obtain defect detection results including detection confidence. S4, Dual-Reason Intelligent Decision Making: Fuzzy reasoning: Symbolic reasoning is performed on the defect detection results based on the symbol rule base, and then fuzzy reasoning is used to obtain the defect severity score; Secondary inference closed loop: Based on a preset threshold, determine whether there is a conflict between the defect severity score mentioned in S4 and the detection confidence; if no conflict is found, directly output the defect severity score; if a conflict is found, initiate the secondary inference process for re-examination to obtain an updated defect detection result; re-input the updated defect detection result into the symbolic inference module for fuzzy inference to obtain and output the corrected defect severity score; the re-examination includes switching the algorithm for re-examination and / or adjusting the image acquisition parameters for re-examination.

[0006] Preferably, the candidate defect detection algorithm score value Score The formula for calculating (a) is: ; in, s c (a) represents the candidate defect detection algorithm a and the set of similar cases. C Case studies of product defects in China c The matching degree; Δ represents the matching degree. s c (a) is the difference between the maximum and second largest values; This represents the set of uncertainty weights for all candidate algorithms; Represents a set of similar cases C Each historical product defect case c The weights; The uncertainty weight coefficient is obtained by estimating the uncertainty of the historical F1 performance index distribution of candidate defect detection algorithm a, and is used to characterize the confidence level of the algorithm's historical performance. This represents the expected value of the historical F1 performance index of candidate defect detection algorithm a after temperature calibration. Indicated based on Δ and The weighting coefficients are calculated from the statistics and are monotonically determined in the range [0,1]. The weighting coefficients Calculated using the Sigmoid function, and based on the matching difference Δ and the set of uncertainty weights. Dynamic adjustment; An uncertainty estimation mechanism is introduced for the historical F1 performance metrics of candidate algorithms: the historical F1 value of each algorithm is treated as a random variable, and its confidence interval or variance is obtained through temperature calibration or Beta distribution modeling, and the uncertainty weighting coefficient is calculated accordingly. ; Preferably, selecting a target defect detection algorithm based on the candidate defect detection algorithm score includes: calculating the difference between the maximum and second-largest candidate defect detection algorithm score, and selecting a target defect detection algorithm mode and algorithm based on the comparison result of the difference with a preset threshold; when the difference is greater than or equal to the preset threshold, a single algorithm mode is selected, and the algorithm with the highest score is selected as the target defect detection algorithm; when the difference is less than the preset threshold, a parallel algorithm mode is selected, and the two algorithms with the highest scores are selected as the target defect detection algorithms. Preferably, in parallel algorithm mode, the defect detection results of the top two candidate defect detection algorithms are fused to obtain a fused defect detection result; Preferably, the fusion process includes deduplication and filtering of overlapping defects; it also includes calculating the consistency ratio between the output results of different algorithms and adjusting the detection confidence based on the consistency ratio; the consistency ratio is the proportion of the number of common defect targets with the same category and an intersection-union ratio not less than a threshold among the defect targets detected by the two algorithms to the total number of the union of defect targets detected by the two algorithms. Preferably, in the single algorithm mode, the switching algorithm re-examination calls the candidate defect detection algorithm with the second highest score among the candidate defect detection algorithms to re-detect the same defect image; in the parallel algorithm mode, a score is introduced to call the algorithm with the third highest score among the candidate defect detection algorithms to re-detect the same defect image. Preferably, in the re-examination of adjusted acquisition parameters, the acquisition parameters include camera exposure time, sensor gain, and / or acquisition frame rate; Preferably, the method further includes fusing the new defect detection results obtained from the secondary inference process re-examination with the defect detection results obtained in step S3 to obtain updated defect detection results; Preferably, it also includes step S5, an alarm step, where an alarm signal is triggered when the defect severity score output in step S4 reaches a preset alarm value. Preferably, rule conflicts that occur in symbolic reasoning are resolved through a two-level strategy of rule priority and weighted evidence fusion. The output of each rule is used as a piece of evidence and is assigned a weight according to its priority or support to participate in the fusion. Preferably, the historical product defect cases include multiple entities and edges representing the relationships between different entities; the entities include product type, process conditions, defect type, defect detection algorithm, and historical defect images; Preferably, there are edges representing relationships between the product type and the defect type, between the process conditions and the defect type, and between the defect type and the defect detection algorithm; Preferably, step S1 further includes a model building and training step: building and training an image coding model and a knowledge graph embedding model to extract image feature vectors and entity embedding vectors respectively, and performing feature alignment training on the image coding model and the knowledge graph embedding model; The image encoding model is used to process historical defect images in historical product defect cases to obtain image feature vectors corresponding to the historical defect images; the knowledge graph embedding model is used to map entities and relationships in historical product defect cases into low-dimensional vectors to obtain entity embedding vectors for the historical product defect cases. Preferably, the image encoding model adopts a visual Transformer model or a convolutional neural network model; Preferably, the knowledge graph embedding model adaptively selects TransE, RotatE, or ComplEx model according to the knowledge graph relation type: when the knowledge graph contains rotation relations or complex relation patterns, RotatE or ComplEx model is selected; otherwise, TransE model is selected. The feature alignment training is based on different historical product defect cases to align and train the image coding model and the knowledge graph embedding model. Preferably, InfoNCE contrastive learning loss is used; Preferably, the Top- k Size of the set of similar cases k The initial setting is 5, and it can be configured within the range of 3 to 10; Preferably, the top-ranked search terms with the highest similarity in the knowledge graph are selected. k A collection of historical product defect cases forms a set of similar cases. C And calculate the set of similar cases. C Weighting of each historical product defect case ; Preferably, for a set of similar cases C Each historical product defect case c The similarity was normalized. Preferred, based on k The selection of a target defect detection algorithm from a set of historical product defect cases involves combining the aforementioned similar case set with the selected target defect detection algorithm. C The weights of each historical product defect case, the matching degree between the candidate defect detection algorithm and each historical product defect case, and the historical F1 performance index of the candidate defect detection algorithm on each historical product defect case are used to calculate the score of each candidate defect detection algorithm. Score (a); and select the target defect detection algorithm based on the candidate defect detection algorithm score; The The calculation process is as follows: Collect the historical F1 performance metrics of algorithm a on similar cases to obtain {F1 a,1 F1 a,2 ,…,F1 a,n We perform probabilistic modeling on the F1 distribution, treating historical F1 performance metrics as parameters of the Beta distribution:

[0007] Then its expectation is:

[0008] Preferably, the defect detection results include: defect category, defect location, defect area or size, edge features, and detection confidence level; Preferably, the deduplication process employs Soft Nonmaximum Suppression (Soft-NMS). Preferably, based on the consistency ratio The defect severity score obtained from subsequent symbolic reasoning is used to monotonically recalibrate the original detection confidence score, resulting in the adjusted detection confidence score. Preferably, the fuzzy inference adopts a Mamdani-type fuzzy inference mechanism; Preferably, the centroid method is used to perform defuzzification on the fuzzy inference results to obtain the defect severity score S; Preferably, the symbol rule base supports online updates and includes an expert intervention interface to receive newly added or modified rules ΔR. New rules must undergo offline verification and A / B shadow release testing before being applied to the online system to assess their security and effectiveness. After approval, they are assigned a version number. V Upgrade to an online reasoning module and record the updated version information of the rule base to facilitate the traceability and management of defect judgment strategies.

[0009] The beneficial effects of this invention are as follows: (1) This invention constructs a domain knowledge graph containing multi-dimensional entities such as product type, process conditions, defect type, detection algorithm and historical cases, and uses contrastive learning to achieve cross-modal alignment between the image coding model and the knowledge graph embedding model. This effectively integrates visual features and expert domain knowledge, improves the model's ability to identify rare defects (such as zero-sample or small-sample defects), and solves the problem of poor generalization performance of traditional deep learning methods in data-scarce scenarios.

[0010] (2) Based on the aligned semantic space, the present invention performs similar case retrieval and combines an uncertainty estimation mechanism to achieve adaptive optimization of candidate detection algorithms, thereby enhancing the robustness and interpretability of the system while ensuring detection accuracy.

[0011] (3) This invention introduces a symbol rule base and a Mamdani-type fuzzy reasoning mechanism, integrates multiple input variables such as defect category, area, edge entropy, location and consistency ratio of detection algorithm results, to quantitatively evaluate the severity of defects, and improves the reliability of reasoning through rule conflict resolution strategy.

[0012] (4) The present invention adopts dual-reasoning intelligent decision-making. When the symbolic reasoning result and the defect detection result conflict significantly, the present invention triggers a closed-loop secondary inference process, including switching the suboptimal algorithm for re-inspection or adjusting the image acquisition parameters for re-imaging, forming a tightly coupled closed-loop decision-making system of "perception-reasoning-feedback", which significantly improves the accuracy of judgment and the fault tolerance of the system under complex working conditions. Attached Figure Description

[0013] Figure 1 This is an overall flowchart of the present invention; Figure 2 This is a network architecture diagram for knowledge graph embedding and feature alignment training in this invention. Detailed Implementation

[0014] This invention proposes an intelligent decision-making method for industrial defects based on knowledge graphs and dual reasoning. The method includes steps such as constructing a knowledge graph, model building and training, similar case retrieval and weight calculation, selecting a defect detection algorithm, defect detection, symbolic reasoning and severity assessment, and conflict detection and secondary inference loop closure. The following detailed description of each step, along with specific implementation methods, is as follows: Figures 1 to 2 As shown.

[0015] An intelligent decision-making method for industrial defects based on knowledge graphs and dual reasoning includes the following steps: S1. Knowledge Graph Construction For the production line of the workpiece under test, a knowledge graph is constructed containing historical product defect cases and their associated information. Historical product defect cases include multiple entities and edges representing the relationships between different entities. Entities include product type, process conditions, defect type, defect detection algorithm, and historical defect images. Edges representing relationships exist between product type and defect type, between process conditions and defect type, and between defect type and defect detection algorithm.

[0016] In this embodiment, the knowledge graph records historical cases of "surface scratches" defects that occurred in product type A under the process condition of "high-speed polishing." Each case entity is associated with information such as the corresponding defect type, occurrence conditions, detection algorithm used, and performance indicators. Through the aforementioned knowledge graph, the semantic relationships of historical defect cases are fully expressed, providing a data foundation for subsequent intelligent reasoning.

[0017] An image encoding model and a knowledge graph embedding model are constructed. The image encoding model is used to process historical defect images in historical product defect cases to obtain the image feature vector corresponding to the historical defect image; the knowledge graph embedding model is used to map the entities and relations in historical product defect cases into low-dimensional vectors to obtain the entity embedding vector of the historical product defect case.

[0018] In this embodiment, since the knowledge graph mainly contains general relationships, TransE is used for the embedding representation of entities and relationships. The knowledge graph embedding dimension is set to 128, consistent with the visual feature space. The boundary margin parameter γ of the TransE model is set to 1.0 (which can be adjusted within the range of 0.5 to 2.0) to balance the constraints of positive and negative examples.

[0019] In this embodiment, the image encoding model employs a convolutional neural network model. It includes a camera consisting of two fully connected neural network layers. After the hidden layers, LayerNorm or BatchNorm is used for normalization. The output layer maps the image feature vectors to 128 dimensions and performs L2 normalization on the output image feature vectors to align them to the 128-dimensional space where the knowledge graph entities are embedded.

[0020] Based on different historical product defect cases, the image encoding model and knowledge graph embedding model are aligned and trained. During training, InfoNCE contrastive learning loss is used to increase the cosine similarity between the image feature vector obtained by the image encoding model and the corresponding entity embedding vector in the same 128-dimensional space for each historical defect image to a preset high threshold. The cosine similarity between the embedding vectors of non-corresponding entities is reduced to a preset low threshold. The following steps are performed using the trained knowledge graph embedding model to obtain the entity embedding vector for each historical product defect case.

[0021] In this embodiment, the image of each historical defect case and its corresponding knowledge graph case entity are used as positive sample pairs. Simultaneously, five negative samples are randomly sampled from other unrelated case entities. The learning rate is set to 0.001, and the training batch size is set to 128. An initial similarity threshold is set. =0.6 (adjustable within the range of 0.5 to 0.8). After training convergence, the cosine similarity of matched samples is no less than 0.6, while the similarity of randomly mismatched samples is no higher than 0.6, thus completing the training of the cross-modal alignment model. The image coding model trained in this way can map new defective images to a semantic vector space consistent with the knowledge graph embedding, providing support for subsequent similar case retrieval, weight calculation, and selection of defect detection algorithms.

[0022] Using the trained image coding model, features are extracted from the surface image of product type A under the process condition of "high-speed polishing," resulting in a 128-dimensional image feature vector. The cosine similarity of this image feature vector with the entity embedding vector of each historical product defect case in the knowledge graph is calculated to assess the similarity between the current defect and each historical product defect case.

[0023] S2. Defect Detection Algorithm Selection Based on the similarity results, the Top-ranked database with the highest similarity in the knowledge graph is selected. k These cases constitute a set of similar cases, Top- k The value can be adjusted according to requirements. In this embodiment, Top-5 is used as an example (it can be configured in the range of 3 to 10). After obtaining the set of similar cases, the similarity of each selected case is normalized so that the sum of the similarities of all cases is 1, thus obtaining the weight of each historical product defect case in the set of similar cases. .

[0024] For each algorithm a in the preset candidate defect detection algorithm set A, based on the set of similar cases... C Based on the relationships between case entities and algorithm entities in the knowledge graph, calculate the relationship between algorithm a and each historical product defect case. c Matching degree s c (a); in conjunction with the aforementioned set of similar cases C Weighting of each historical product defect case The matching degree between candidate defect detection algorithm a and each historical product defect case. s c (a) and the historical F1 performance index of candidate defect detection algorithm a on each historical product defect case, calculate the score of each candidate defect detection algorithm. Score (a):

[0025] in, s c (a) represents the candidate defect detection algorithm a and the set of similar cases. C Case studies of product defects in China c The matching degree; Δ represents the matching degree. s c (a) is the difference between the maximum and second largest values; This represents the set of uncertainty weights for all candidate algorithms; Represents a set of similar cases C Each historical product defect case c The weights; The uncertainty weight coefficient is obtained by estimating the uncertainty of the historical F1 performance index distribution of candidate defect detection algorithm a, and is used to characterize the confidence level of the algorithm's historical performance. This represents the expected value of the historical F1 performance index of candidate defect detection algorithm a after temperature calibration. Indicated based on Δ and The weighting coefficients are calculated from the statistics and are monotonically determined in the range [0,1].

[0026] The calculation formula is:

[0027] The Sigmoid function maps any real number to the interval (0,1) and satisfies the monotonicity requirement; k1,k2>0 ensures that as Δ increases or As α increases, it monotonically increases.

[0028] Specifically, the historical F1 performance metrics of algorithm a on similar cases are collected to obtain {F1a,1,F1a,2,…,F1a,n}. Probabilistic modeling of the F1 distribution is then performed, and the historical F1 performance metrics can be considered as parameters of the Beta distribution.

[0029] Then its expectation is:

[0030] Compare the scores of all candidate defect detection algorithms Score (a) and calculate the score difference of the candidate algorithms. When the candidate algorithm score difference ( When the threshold is preset, select the single algorithm mode and execute the algorithm with the highest score as the target algorithm; when... When selecting the parallel algorithm mode, the top two algorithms in terms of score are executed; the score difference between the candidate algorithms is... The difference between the maximum and second-largest scores of all candidate algorithms.

[0031] In this embodiment, the preset threshold is 0.1. Algorithm A scores 0.80, and Algorithm B scores 0.75. The difference between the two is Δ=0.05, which is lower than the preset threshold. Therefore, the system considers the scores of the two algorithms to be close and there is no obviously superior algorithm. At this time, the parallel algorithm mode is selected, and Algorithm A and Algorithm B, which rank first and second in score, are used as the target algorithms for detection. Through the above-mentioned case-based reasoning algorithm scoring and selection mechanism, adaptive algorithm optimization for the current defect is realized, making full use of historical case knowledge to improve the scientificity and credibility of detection decisions.

[0032] S3, Defect Detection Based on the selection result in step S2, the parallel algorithm mode is selected, and the top two ranked algorithms A and B are executed to identify defects in the images of product type A that have "surface scratches" under the process condition of "high-speed polishing". The defect detection results are obtained, including defect category, defect location, defect area or size, edge features and detection confidence.

[0033] When two algorithms are executed in parallel, the defect detection results output by the two algorithms are fused: Soft nonmaximum suppression (Soft-NMS) is used to filter out defect targets in overlapping areas according to a set intersection-union ratio (IU) threshold θ to eliminate duplicate defect markers; the consistency ratio of the detection results of the two algorithms is calculated. The consistency ratio is defined as the ratio of the number of defective targets detected by the two algorithms that are of the same category and The proportion of common defect targets with a value not less than θ to the total number of defect targets detected by both algorithms; based on the consistency ratio The defect severity score obtained through subsequent symbolic reasoning is used to monotonically recalibrate the original detection confidence level p, resulting in the adjusted confidence level. ,

[0034]

[0035] Where α>0, β>0 are adjustable hyperparameters. This is used to limit the results to [0,1] so that the adjusted confidence level more accurately reflects the reliability of the defect judgment results, and obtains the fused comprehensive defect detection result set.

[0036] S4, Dual-Reason Intelligent Decision Making The defect detection results obtained in step S3 are input into a pre-established symbolic rule base for symbolic reasoning. A Mamdani-type fuzzy reasoning mechanism is used to assess the severity of the defects. The input variables for fuzzy reasoning include: defect category, defect area, defect edge entropy value, defect location, and consistency ratio of the detection algorithm results. and the adjusted detection confidence level The defect edge entropy value is obtained by calculating the Shannon entropy from the gradient magnitude histogram of the defect region; For rule conflicts arising in symbolic reasoning, a two-level strategy of rule priority and weighted evidence fusion is employed to resolve them. The output of each rule is treated as a piece of evidence and weighted according to its priority or support before participating in the fusion. The centroid method is used to defuzzify the fuzzy reasoning results to obtain the defect severity score S. 。

[0037] The severity score S obtained from symbolic reasoning is compared with the detection confidence p output by the defect detection algorithm in step S3. Make a judgment: (1) When or If no conflict is found, the result is output directly. (2) When or If a conflict occurs, a secondary inference process is initiated to improve the accuracy of the judgment result.

[0038] In this embodiment, the preset conflict threshold is 0.5. The visual detection confidence of a "surface scratch" defect in product A under the process condition of "high-speed polishing" is 0.95 (indicating that the detection model is extremely confident in the existence of the defect), while the symbolic inference severity score is only 0.4 (indicating a minor defect). The difference between the two, 0.55, exceeds the conflict threshold, and the result should be judged as conflicting. The system will issue an alarm and execute a secondary inference process. Conversely, the opposite situation (low detection confidence but high inference severity) can also be considered a conflict.

[0039] The secondary inference process includes at least one of the following: (a) Algorithm re-examination: The candidate defect detection algorithm with the second highest ranking in the original algorithm score list is called to re-examine the same defect image. In this embodiment, if there is still a conflict after parallel detection by algorithms A and B with the first and second highest scores in the previous steps, algorithm C with the third highest score can be introduced to independently re-examine the image to obtain new detection results; different detection models may be complementary in certain defect types, and multi-algorithm re-examination can improve the comprehensiveness of defect detection.

[0040] (b) Adjusting Acquisition Parameters for Re-inspection: The system automatically adjusts the parameters of the image acquisition device to obtain additional image information to aid in the judgment. For example, the camera exposure time can be increased or the sensor gain can be improved to obtain a clearer image; or the acquisition frame rate can be increased to obtain multiple frames of images of the defective area, from which the frame with the best quality is selected for re-inspection. In this embodiment, if the original image is not sufficiently illuminated, making it difficult for symbolic reasoning to accurately evaluate edge features, the system can extend the exposure time to obtain a brighter image, thereby re-performing defect detection and analysis.

[0041] Through the aforementioned secondary inference process, supplementary information and new detection results regarding the defects can be obtained. The results from the secondary inference are then fused with the original detection results, similar to the multi-algorithm fusion method described earlier, to update the defect labels and confidence assessments. After fusion, the updated defect data is input again into the symbolic inference module for a new fuzzy inference assessment, yielding a revised defect severity score. A new judgment is then made based on the new severity score and the predetermined alarm threshold.

[0042] S5, Alarm When the severity score S is greater than or equal to the preset alarm threshold When a critical defect is identified as requiring an alarm, an alarm signal is output. Simultaneously, a hysteresis strategy is used to control the alarm signal. The alarm signal is triggered when the severity score first reaches the alarm threshold. After an alarm is triggered, it will only be deactivated when the severity drops below the threshold. The alarm was only deactivated at that time. h is the preset hysteresis amplitude.

[0043] In this embodiment, the alarm threshold is set to 0.8 (the range can be adjusted from 0.7 to 0.9). To prevent the alarm signal from fluctuating near the severity score threshold, this embodiment sets the hysteresis amplitude h to 0.1, thus releasing the threshold. The severity score is set to 0.7. An alarm is triggered only when the severity score first reaches 0.8, and is subsequently deactivated only when the severity score drops below 0.7. This method does not immediately deactivate the alarm even if the severity score fluctuates around 0.8, for example, dropping from 0.82 to 0.78, but only deactivates it when the score falls below 0.7, thereby improving system stability.

[0044] In this embodiment, before the second inference, the severity score of the "surface scratch" defect in product A under the process condition of "high-speed polishing" is 0.4. After the second inference and re-reasoning, the score increases to 0.75, and the system does not need to alarm. It should be noted that before the release threshold of 0.7 is reached, any triggered alarm signals will remain active to ensure that vigilance is maintained for potential serious defects before the final conclusion is determined.

[0045] In summary, this implementation method forms a closed-loop intelligent decision-making process for industrial visual defects by closely combining knowledge graph-driven symbolic reasoning with a secondary inference loop. This process utilizes domain knowledge to guide detection decisions, improving the accuracy and robustness of defect detection; symbolic reasoning enhances the interpretability of the decisions; and the closed-loop secondary inference process improves the system's ability to handle abnormal situations and its reliability.

[0046] The above-described specific embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An intelligent decision-making method for industrial defects based on knowledge graphs and dual reasoning, characterized in that, Includes the following steps: S1. Knowledge graph construction: Construct a knowledge graph containing historical product defect cases and their related information; S2. Defect Detection Algorithm Selection: Retrieve the Top-most similar algorithms from the knowledge graph. k A historical product defect case; based on k The target defect detection algorithm is selected from a set of pre-defined candidate defect detection algorithms for each historical product defect case. S3. Defect Detection: The target defect detection algorithm is used to identify the image and obtain defect detection results including detection confidence. S4, Dual-Reason Intelligent Decision Making: Fuzzy reasoning: Symbolic reasoning is performed on the defect detection results based on the symbol rule base, and then fuzzy reasoning is used to obtain the defect severity score; Secondary inference closed loop: Based on a preset threshold, determine whether there is a conflict between the defect severity score mentioned in S4 and the detection confidence level; If no conflict is found, the severity score of the defect is directly output. If a conflict is found, a second inference process is initiated for re-examination to obtain updated defect detection results; The updated defect detection results are re-input into the symbolic reasoning module for fuzzy reasoning to obtain and output the corrected defect severity score; the re-inspection includes re-inspection by switching algorithms and / or re-inspection by adjusting image acquisition parameters.

2. The method according to claim 1, characterized in that, In step S2, a target defect detection algorithm is selected based on the candidate defect detection algorithm score; the candidate defect detection algorithm score... Score The formula for calculating (a) is: ; in, C Top- with the highest similarity k Historical product defect cases c The set of similar cases constituted s c (a) represents the candidate defect detection algorithm a and the set of similar cases. C Case studies of product defects in China c The matching degree; Δ represents the matching degree. s c (a) is the difference between the maximum and second largest values; This represents the set of uncertainty weights for all candidate algorithms; Represents a set of similar cases C Each historical product defect case c The weights; The uncertainty weight coefficient is obtained by estimating the uncertainty of the historical F1 performance index distribution of candidate defect detection algorithm a, and is used to characterize the confidence level of the algorithm's historical performance. This represents the expected value of the historical F1 performance index of candidate defect detection algorithm a after temperature calibration. Indicated based on Δ and The weighting coefficients are calculated from the statistics and are monotonically determined in the range [0,1]. The weighting coefficients Calculated using the Sigmoid function, and based on the matching difference Δ and the set of uncertainty weights. Dynamic adjustment; The uncertainty weighting coefficient The historical F1 performance index value of candidate defect detection algorithm a is determined by treating it as a random variable and obtaining its confidence interval or variance through temperature calibration or Beta distribution modeling.

3. The method according to claim 1, characterized in that, The selection of a target defect detection algorithm based on the candidate defect detection algorithm score includes: calculating the difference between the maximum and the second largest candidate defect detection algorithm score, and selecting a target defect detection algorithm mode and algorithm based on the comparison result of the difference with a preset threshold; when the difference is greater than or equal to the preset threshold, a single algorithm mode is selected, and the algorithm with the highest score is selected as the target defect detection algorithm; when the difference is less than the preset threshold, a parallel algorithm mode is selected, and the two algorithms with the highest scores are selected as the target defect detection algorithms.

4. The method according to claim 3, characterized in that, In parallel algorithm mode, the defect detection results of the two algorithms with the highest scores in the candidate defect detection algorithm are fused to obtain the fused defect detection result.

5. The method according to claim 4, characterized in that, The fusion process includes deduplication to filter out overlapping defect targets; calculating the consistency ratio between the detection results output by different algorithms; and adjusting the detection confidence level based on the consistency ratio.

6. The method according to claim 3, characterized in that, In single algorithm mode, the switching algorithm re-examines the same defect image by calling the second-highest ranked candidate defect detection algorithm in the candidate defect detection algorithm score; in parallel algorithm mode, a score is introduced to call the third-ranked candidate defect detection algorithm to re-examine the same defect image.

7. The method according to claim 1, characterized in that, In the re-examination of adjusted image acquisition parameters, the acquisition parameters include camera exposure time, sensor gain, and / or acquisition frame rate.

8. The method according to claim 1, characterized in that, It also includes fusing the new defect detection results obtained from the secondary inference process re-examination with the defect detection results obtained in step S3 to obtain updated defect detection results.

9. The method according to claim 1, characterized in that, It also includes the S5 alarm step, which triggers an alarm signal when the defect severity score output in step S4 reaches the preset alarm threshold.

10. The method according to claim 1, characterized in that, For rule conflicts that arise in symbolic reasoning, a two-level strategy of rule priority and weighted evidence fusion is used to resolve them. The output of each rule is used as a piece of evidence and is weighted according to its priority or support to participate in the fusion.