Quality abnormity tracing method and system based on interpretable machine learning

By using an interpretable machine learning approach, an industrial knowledge graph is constructed using the XGBoost model and SHAP values. Combined with cosine similarity and the KNN algorithm, the accuracy and efficiency issues of quality anomaly tracing in complex industrial systems are solved, achieving efficient quality anomaly tracing.

CN121117835APending Publication Date: 2025-12-12TONGLING UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511152442.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve efficient and accurate quality anomaly tracing in complex industrial systems, especially in multi-dimensional, strongly coupled, and time-varying industrial systems. Traditional methods suffer from high knowledge acquisition costs, lagging model updates, and poor adaptability.

Method used

We employ an interpretable machine learning approach, utilizing the XGBoost model for feature contribution analysis, and combining SHAP values ​​and cosine similarity algorithms to construct an industrial knowledge graph. We then use the KNN algorithm to locate process parameters for quality defects, thus achieving an organic integration of data-driven and knowledge-driven approaches.

Benefits of technology

It improves the accuracy and interpretability of quality anomaly tracing, provides a new paradigm for intelligent quality assurance of complex industrial systems, and enhances the efficiency and accuracy of tracing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121117835A_ABST
    Figure CN121117835A_ABST
Patent Text Reader

Abstract

The invention discloses a quality abnormity tracing method and system based on interpretable machine learning, and relates to the technical field of quality abnormity diagnosis, and the method comprises the steps: receiving the technological parameters of a to-be-detected product in an industrial production process, inputting the technological parameters of the to-be-detected product in the industrial production process into a pre-established XGBoost product quality prediction model, and obtaining the quality abnormity of the to-be-detected product in the industrial production process; performing feature contribution degree analysis based on a model interpretability technology of an SHAP value to obtain an industrial knowledge graph; based on a cosine similarity algorithm, extracting production information which is the same as or similar to the material information and the working condition information of the to-be-detected abnormal-quality product from the industrial knowledge graph to obtain a historical similar data set; and based on the historical similar data set, finding out a historical abnormal sample closest to the abnormal sample of the real-time production data on the production line through a KNN algorithm, carrying out statistics on influence factors which appear most frequently in the historical abnormal sample, determining process parameters which cause the quality defect of the to-be-detected sample, and realizing the quality defect tracing of the product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quality anomaly diagnosis technology, specifically to a quality anomaly tracing method and system based on interpretable machine learning. Background Technology

[0002] As the core pillar of modern industry, manufacturing's quality assurance capabilities directly impact a nation's industrial competitiveness and sustainable development potential. In the era of intelligent manufacturing, industrial systems exhibit multi-dimensional, strongly coupled, and time-varying complexities. This complexity stems not only from the precise integration of physical equipment but also from the multi-parameter, nonlinear, and cross-scale interactions within the production process. Even minor fluctuations in any link can trigger a chain reaction leading to final product performance failure. This nonlinear evolution mechanism from microscopic uncertainty to macroscopic quality defects renders traditional post-inspection and passive response models inadequate for meeting the strategic demands of modern industry for zero-defect manufacturing. Therefore, there is an urgent need to construct an intelligent quality assurance system with predictive, traceable, and adaptive capabilities.

[0003] As a cutting-edge direction in the field of quality control, the core of quality anomaly tracing lies in establishing a "phenomenon-mechanism-root cause" mapping model to achieve reverse analysis of quality fluctuations. From a systems engineering perspective, quality anomaly tracing needs to overcome three core challenges: accurate characterization of multidimensional anomaly features, dynamic reconstruction of complex propagation paths, and effective localization of deep root cause nodes. Existing research can be divided into three categories based on methodological differences: knowledge-driven methods based on mechanism models, data-driven methods based on data patterns, and hybrid-driven methods that integrate both. Knowledge-driven methods, with expert knowledge at their core, can clearly express fault propagation paths by constructing mechanism models such as Fault Tree (FT), Singed Directed Graph (SDG), and Petri Nets, but they suffer from inherent drawbacks such as high knowledge acquisition costs and lagging model updates. In knowledge-driven methods, Fault Trees construct tree structures using logic gate symbols, which can intuitively display fault propagation paths. However, the effectiveness of this method is highly dependent on the completeness of expert knowledge; for emerging processes or complex systems, knowledge acquisition becomes a bottleneck restricting its application. Singed-directed graphs represent the direct influence relationships between variables through directed edges between nodes, and can handle concurrent scenarios with multiple failures. However, their modeling process requires manual definition of node states and thresholds, resulting in poor adaptability under dynamic conditions. Petri nets simulate system state transitions through a token passing mechanism, and can handle concurrent and conflict events, but suffer from the state space explosion problem, limiting their application in large and complex systems. Summary of the Invention

[0004] To address the shortcomings mentioned in the background section, the present invention aims to provide a method and system for tracing the source of quality anomalies based on interpretable machine learning.

[0005] Firstly, the objective of this invention can be achieved through the following technical solution: a method for tracing the source of quality anomalies based on interpretable machine learning, the method comprising the following steps:

[0006] The system receives process parameters of the product to be tested in the industrial production process, inputs these parameters into a pre-established XGBoost product quality prediction model, performs feature contribution analysis based on the model interpretability technology of SHAP value, and outputs an industrial knowledge graph.

[0007] The industrial knowledge graph is extracted based on the cosine similarity algorithm to obtain the dataset to be tested. The dataset to be tested is constructed from historical production information with the same material information and working condition information of the product to be tested. The dataset to be tested is subjected to quality inspection to obtain historical abnormal samples. Based on the historical abnormal samples, the process parameters of the product to be tested with defects are determined.

[0008] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the process parameters of the product to be tested in the industrial production process are collected by a linear process chain consisting of multiple processes connected in sequence, including: the product to be tested first enters process 1 for processing, and then, according to the set process route requirements, it sequentially passes through subsequent process 2 and other processes until the product to be tested completes the final process n.

[0009] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the base model in the pre-established XGBoost product quality prediction model is a CART tree, and let the CART tree generated in the j-th generation be T. j After M rounds, the final XGBoost product quality prediction model for the input sample x i Predicted value for:

[0010]

[0011] Where C is a set of CART decision trees.

[0012] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the expression for the SHAP-based model interpretability technique is as follows:

[0013]

[0014] Each feature has a corresponding Shapley value, i.e., ω.k ω0 is a constant for explaining the model, and A is the total number of features.

[0015] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the Shapley value calculation formula for each feature is as follows:

[0016]

[0017] In the formula, {a1,a2,…,a A} is the set of all features, and P is the subset of features needed to calculate the Shapley value. The Shapley value analysis quantifies the influence of each process parameter on defect prediction.

[0018] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the triples of the industrial knowledge graph consist of Entity, Attribute, and Relation, in the form of entity, relation, entity or entity, attribute, attribute value.

[0019] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the cosine similarity calculation formula for extracting industrial knowledge graphs based on the cosine similarity algorithm is as follows.

[0020]

[0021] Where α is the vector representation of the material information and operating condition information of the product to be detected, β is the vector representation of the historical production information in the knowledge graph, and θ is the included angle.

[0022] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: using Euclidean distance to find the k historical anomalous samples with the highest similarity obtained from the quality inspection of the dataset to be inspected, and determining the process parameters that cause quality defects in real-time production data by statistically analyzing the most frequently occurring influencing factors among the k historical anomalous samples. The Euclidean distance calculation formula is as follows:

[0023]

[0024] Where A is the total number of features, x is Let x be the s-th dimension feature of the i-th real-time abnormal production data. js Let be the s-th dimension feature of the j-th historical abnormal production data.

[0025] Secondly, in order to achieve the above objectives, this invention discloses a quality anomaly tracing system based on interpretable machine learning, comprising:

[0026] The knowledge graph generation module receives process parameters of the product to be tested in the industrial production process, inputs these parameters into a pre-established XGBoost product quality prediction model, performs feature contribution analysis based on Shapley value model interpretability technology, and outputs an industrial knowledge graph.

[0027] The anomaly tracing module is used to extract information from the industrial knowledge graph based on the cosine similarity algorithm to obtain a historical similarity dataset. This historical similarity dataset is constructed by extracting production information that is the same as or similar to the material information and operating condition information of the product with quality defects to be detected. Based on the historical similarity dataset, the KNN algorithm is used to find the historical anomaly sample that is closest to the anomaly sample in the real-time production data on the production line. By statistically analyzing the most frequently occurring influencing factors in the historical anomaly samples, the process parameters that cause the quality defects of the sample to be detected are determined, thereby realizing the traceability of product quality defects.

[0028] In another aspect of the present invention, in order to achieve the above-mentioned objective, a terminal device is disclosed, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The memory stores the computer program capable of running on the processor, and when the processor loads and executes the computer program, it employs the quality anomaly tracing method based on interpretable machine learning as described above.

[0029] The beneficial effects of this invention are:

[0030] This invention enables the organic integration of data-driven discovery capabilities and knowledge-driven constraint capabilities, improving the accuracy and interpretability of traceability and providing a new paradigm for intelligent quality assurance in complex industrial systems. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0033] Figure 2 This is an abstract schematic diagram representing the industrial process of this invention;

[0034] Figure 3 This is a schematic diagram of the overall framework of the present invention;

[0035] Figure 4 This is a schematic diagram of the data structure of the quality analysis knowledge graph of this invention;

[0036] Figure 5 This is a schematic diagram of the process for tracing the source of quality anomalies in this invention;

[0037] Figure 6 This is a schematic diagram of the data distribution of the dataset of this invention;

[0038] Figure 7 This is a schematic diagram of the confusion matrix of the classification results in an embodiment of the present invention;

[0039] Figure 8 This is a schematic diagram of the force plot of a certain sample of the present invention;

[0040] Figure 9 This is the structure diagram of the knowledge graph for quality analysis of this invention;

[0041] Figure 10 This is a process parameter diagram of the abnormal product of this invention;

[0042] Figure 11 This is a schematic diagram of the system structure of the present invention. Detailed Implementation

[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] Example 1:

[0045] like Figure 1 As shown, a quality anomaly tracing method based on interpretable machine learning includes the following steps:

[0046] S101: Receives the process parameters of the product to be tested in the industrial production process, inputs the process parameters of the product to be tested in the industrial production process into the pre-established XGBoost product quality prediction model, performs feature contribution analysis based on the model interpretability technology of SHAP value, and outputs an industrial knowledge graph.

[0047] Specifically, the complex processing procedures of actual production lines are unified and refined into a universally applicable logical model, such as... Figure 2As shown in the diagram, the core of this model lies in viewing the production line as a linear process chain consisting of several sequentially linked processes. Specifically, the product to be processed first enters process 1 for handling, and then strictly follows the established process route requirements, passing through subsequent processes 2 and others in sequence. This process continues until the product completes the final process n. Each process represents an indivisible basic manufacturing activity, which is necessarily associated with specific process parameters and operating time. The product sequentially passes through each process, gradually accumulating value, and finally forms a finished product after completing the final process. This highly abstract and unified representation effectively strips away the process details differences of specific industry backgrounds or product types. Its value lies in focusing on the common key structural features and dynamic behavioral patterns in the production process, such as the sequential constraints between processes, the dependence on processing resources, and the gradual value-adding process. Thus, this model lays a general conceptual foundation for subsequent chapters to explore production line performance evaluation, modeling method applications, and optimization strategy formulation.

[0048] Currently, some manufacturing plants are pioneering the use of new technologies to help companies achieve digital transformation and realize the vision of "smart factories." By introducing artificial intelligence, end-to-end data interconnection, and the construction of the Industrial Internet of Things (IIoT), factory production efficiency has improved, and maintenance costs have significantly decreased. Some factories have embedded random forest or XGBoost algorithms as core computational models in their software systems. Intelligent prediction systems can integrate multiple influencing factors such as market demand, production scheduling, and weather conditions, and use time-series modeling methods to dynamically predict production line-level production plans and energy consumption demands for the next week, achieving high prediction accuracy. In industrial manufacturing, product quality characteristics are significantly correlated with the process control parameters of each production step. Each production batch can be represented as a data sample composed of a process parameter vector x and a corresponding quality index y. For the quality parameter y, this invention uses the XGBoost ensemble learning algorithm to construct a mapping relationship between process parameters and quality defects, achieving data-driven prediction of product quality problems. XGBoost is an ensemble learning model. By combining the prediction results of multiple single base models, prediction performance and stability can be effectively improved. The base model in XGBoost is the CART tree. Suppose that the CART tree (also called the residual tree) generated in the j-th generation is T. j After M rounds (meaning there are M trees in total), the final model for the input sample x... i Predicted value for:

[0049]

[0050] Where C is a set of CART decision trees.

[0051] Before SHAP was used, XGBoost was typically explained using 'feature importance' or 'partial dependence plot'. 'Feature importance' measures the importance of each feature in the dataset. Simply put, 'feature importance' can be represented as a metric for the contribution of each process parameter to improving the accuracy of the prediction model. 'Feature importance' can intuitively reflect the importance of features, showing which features have a greater impact on the final model, but it cannot determine the relationship between features and the final prediction result. Most importantly, these metrics cannot interpret the impact of each feature on the predicted value of each individual.

[0052] After predicting product quality defects, the SHAP method can be used to perform sample-level interpretability analysis on the model prediction results. Specifically, the contribution of each process parameter to the model prediction results is quantified through "feature attribution" technology, thereby identifying key process variables affecting quality fluctuations. The mathematical expression of this method is as follows:

[0053]

[0054] Each feature has a corresponding Shapley value, which is ω. k ω0 is the constant explaining the model, which is actually the predicted mean of all training samples. A is the total number of features.

[0055] The Shapley value for each feature is calculated using the following formula:

[0056]

[0057] In the formula, {a1,a2,…,a A} is the set of all features, and P is the subset of features needed to calculate the Shapley value. The Shapley value analysis quantifies the influence of each process parameter on defect prediction. After completing the feature set {a1, a2, ..., a...}, ... A After calculating the Shapley values ​​of all features in the graph, the two key features with the highest contribution are extracted and stored together with other relevant process information in the knowledge graph.

[0058] Based on the latent patterns inherent in long-term accumulated time-series production data from industrial sites, and addressing the fluctuations in raw material composition and operating parameters across multiple batches caused by market demand volatility, this invention employs SHAP-based model interpretability technology to analyze the feature contribution of the constructed XGBoost product quality prediction model. By quantifying the dynamic impact weights of process parameters on quality indicators, nonlinear mapping relationships between key variables are extracted, and these significantly correlated parameter combinations are solidified into the Neo4j graph database in a <entity, relation, entity> graph structure, ultimately forming a knowledge graph for quality optimization. The core of the knowledge graph is essentially the triple, composed of Entity, Attribute, and Relation, in the form of <entity, relation, entity> or <entity, attribute, attribute value>. Neo4j is an open-source graph database provided by Neo Technology. This invention uses the non-relational database Neo4j to store and query the graph data of the processing line. Choosing a knowledge graph as a storage tool for data mining results offers significant advantages. It can naturally express and store complex semantic relationships between data. Its graph structure uses entities as nodes and relationships as edges, overcoming the limitations of traditional databases in representing complex networks. This storage method directly supports efficient graph querying and reasoning, facilitates in-depth association analysis and knowledge discovery, and significantly enhances the utilization value of the mining results.

[0059] Based on the constructed knowledge graph system, causal reasoning techniques can be combined to achieve root cause diagnosis of product quality anomalies and correlation analysis of process parameters. Addressing the issue of changes in operating conditions and parameter configurations caused by differences in raw material composition, in the traceability of quality defects in specific batches, the knowledge graph is used to retrieve historical production sequences that match the current material properties and equipment operating modes. Furthermore, the K-nearest neighbor algorithm is employed to dynamically match process parameters across batches, accurately locating key process control variables that are strongly correlated with the current quality anomaly pattern.

[0060] Data models for knowledge graphs, such as Figure 4As shown, the required entity and relation types are defined. Entity attributes carry rich process data. Entity identifiers (IDs) record detailed core parameters for each production batch (including batch code, production line identifier, equipment number, etc.), which are structured to form a process feature set I. The entity "Process" contains information about important processes on the production line, constituting set W. The entity "Pass / Fail" contains product quality information, constituting set Q. The relation "First Cause" or "Second Cause" represents the causal relationship between key process variables and quality anomalies in a specific production stage, constituting set R. The entity "Material" contains information about different operating conditions and materials during production, constituting set M. Entity "Features" contain other process parameters for the batch of products. Providing multiple causes in quality defect tracing comprehensively covers various factors that may lead to anomalies. The causes of quality defects are diverse and often involve multiple production stages, encompassing multiple aspects of the anomaly. Providing multiple causes helps technicians comprehensively analyze the causes of anomalies, thereby taking effective maintenance and preventative measures and enhancing the robustness of quality defect tracing.

[0061] S102: Extracting industrial knowledge graphs based on cosine similarity algorithm to obtain historical similarity datasets, wherein the historical similarity datasets are constructed by extracting production information that is the same as or similar to the material information and working condition information of the product with quality defects to be detected; based on the historical similarity datasets, using the KNN algorithm to find the historical abnormal samples that are closest to the abnormal samples in the real-time production data on the production line, and by statistically analyzing the most frequently occurring influencing factors in the historical abnormal samples, determining the process parameters that cause the quality defects of the sample to be detected, thereby realizing the traceability of product quality defects.

[0062] The tracing of quality defects begins with extracting a subset of data from the knowledge graph using a cosine similarity algorithm. This subset is constructed from historical production information that is identical or similar to the material and operational information of the product to be detected. Cosine similarity is a commonly used method for measuring the similarity between two non-zero vectors, widely applied in text mining, recommender systems, and other fields. This algorithm uses the cosine of the angle between two vectors to measure their similarity. Theoretically, the closer the directions of two vectors are, the higher their cosine similarity, and the more similar they are. If the material and operational information of the product to be detected are represented by vector α, and the historical production information in the knowledge graph is represented by vector β, and their angle is θ, then the formula for calculating their cosine similarity is as follows.

[0063]

[0064] Then, the KNN algorithm is used to analyze the uncertain relationship between process parameters and quality parameters in production. This algorithm uses Euclidean distance to measure the proximity of an unknown sample to all known class samples. After selecting the k nearest neighbors, a majority voting mechanism is used to classify the unknown sample into the class with the highest frequency among the k nearest neighbors. This is its basic principle.

[0065] When tracing quality defects in abnormal samples of real-time production data on the production line, based on past production experience, abnormal samples with similar feature values ​​will also have similar causes for the abnormalities. Therefore, the feature information of the real-time abnormal production data is first used to find the k most similar historical abnormal samples through Euclidean distance (see formula (5)). Then, by statistically analyzing the top 3 most frequently occurring influencing factors among the k historical abnormal samples, the most likely process parameters causing quality defects in the real-time production data are determined.

[0066]

[0067] Where A is the total number of features, x is Let x be the s-th dimension feature of the i-th real-time abnormal production data. js Let be the s-th dimension feature of the j-th historical abnormal production data.

[0068] In production line quality prediction scenarios combining knowledge graphs with XGBoost and KNN, dynamic updates of the knowledge graph need to balance real-time performance with system overhead. Real-time updates can be achieved through a hybrid triggering mechanism. New production data is ingested in batches at fixed time intervals (e.g., hourly), while instant updates are triggered by key events (e.g., quality anomalies or batch switching). Updated content is kept consistent through data cleaning and pattern alignment to prevent outdated features from affecting the input.

[0069] Update frequency has a significant impact on KNN performance. KNN relies on similarity calculations to find nearest neighbors. If the knowledge graph is updated lagging (e.g., more than a day), dynamic changes in the production line will not be reflected in a timely manner, causing KNN to retrieve dissimilar samples and reducing prediction accuracy. Therefore, in production lines with rapidly changing data distribution, the knowledge graph update frequency needs to be increased to the hourly level to maintain the analogical effectiveness of KNN. This frequency can be moderately relaxed in stable scenarios. On the other hand, excessively high update frequencies (e.g., minutes) can overload server computing power and create performance bottlenecks.

[0070] The flowchart for tracing the source of quality anomalies is as follows: Figure 5 As shown.

[0071] Specifically, the present invention will be further illustrated below through embodiments:

[0072] The feasibility and efficiency of the proposed model were validated using the SECOM public dataset from UCI. Public datasets are generally released by research institutions, government departments, or enterprises. These datasets typically cover various fields, such as image recognition, natural language processing, and recommender systems. The advantage of public datasets is that they are available for free or at low cost, and are usually pre-processed and can be directly used for model training, which greatly facilitates researchers and developers. The SECOM semiconductor manufacturing dataset includes manufacturing operation data and semiconductor quality data. It contains 1567 observations obtained from the wafer manufacturing production line. Each sample consists of 590 sensor measurements plus a "pass" or "fail" label. The data distribution and statistics of the dataset are as follows. Figure 6 As shown in the figure. Where 0 represents "pass" and 1 represents "fail".

[0073] Real industrial production line data typically contains missing values, and the SECOM dataset is no exception. Therefore, the missing data is first filled with the mean of each feature column. In the XGBoost product quality prediction model constructed based on formula (1), as shown... Figure 5 The results show a clear imbalance in the class distribution. The significant difference in the number of positive and negative samples can weaken the model's ability to identify rare classes, thus affecting the reliability of the detection performance. The accuracy of the classification model will directly affect the accuracy of subsequent causal source analysis. To this end, this invention uses the SMOTE oversampling technique to optimize the data distribution. Its core principle is to generate synthetic samples by interpolating the feature space of minority class samples, thereby improving the balance of the dataset. The formula of the SMOTE algorithm is shown in (6).

[0074] xnew = x + r( x' – x ) (6)

[0075] Where x is the original minority class sample, x' is a sample randomly selected from the neighboring samples, and r is a random number with a value between [0, 1].

[0076] To address the model parameter optimization problem, a grid search strategy is implemented to globally optimize the hyperparameters of XGBoost. This method constructs a parameter combination space and uses a cross-validation mechanism to systematically evaluate the performance of each parameter combination on the validation set, ultimately selecting the optimal parameter configuration. The advantages of grid search are its simplicity and ease of use, and its applicability to various machine learning models and hyperparameter spaces. The three most important parameters of the XGBoost algorithm are: tree depth, number of trees, and learning rate. Specifically, during the search, the method exhaustively traverses all possible parameter combinations in the parameter grid. For each set of parameters, it rigorously performs 10-fold cross-validation. The training data is divided into 10 parts, and the model is trained using 9 of them sequentially, with the performance validated on the remaining part. Finally, the average performance score of the parameter combination over 10 validations is calculated. After evaluating all combinations, the algorithm selects the parameter combination with the highest average score in cross-validation as the optimal solution and returns the corresponding optimized model. Table 1 shows the results of the hyperparameter grid search. P, R, and F1 are used as evaluation metrics, with 70% of the dataset used as the training set and 30% as the test set. Under the hyperparameters given in Table 4, the confusion matrices for different classification results of the model are as follows: (Table 4 shows the confusion matrices for both unprocessed and oversampled data.) Figure 7 As shown in Table 2, the specific evaluation indicators for the non-conforming product identification results are presented in Table 2. Table 2 shows that, after oversampling preprocessing, the XGBoost algorithm exhibits good performance in identifying non-conforming products.

[0077] Table 1 Model hyperparameters

[0078]

[0079] Table 2 Results of Non-conforming Product Identification

[0080] Preprocessing P R F1 Unprocessed 0.50 0.04 0.07 Oversampling 0.98 0.99 0.98

[0081] Shapley values ​​are calculated for the sample features of the quality prediction model test set based on formula (3), and the results are used to analyze the causal relationship mechanism between process variables and quality indicators. First, an interpreter object is defined. Because this invention uses XGBoost, a tree-specific interpreter, TreeExplainer, is employed. Figure 7A "force plot" is provided for an outlier sample in the test set. A force plot interprets the predictions for a single sample. It visualizes shapley values ​​as "forces," each shapley value representing a force that increases or decreases the predicted value. Predictions begin with the "base value," a constant that explains the model and is the mean of the predictions across all training samples. Each shapley value is represented by an arrow, with red indicating a positive contribution and blue indicating a negative contribution. Positive values ​​increase the predicted value, and negative values ​​decrease it. For this sample, the model's output value is 2.63. Figure 8 This can be explained as follows: Feature F95 = 1.05 has the largest positive contribution, followed by F59 = 0.30, but F486 = -1.26 has the largest negative contribution. Under the combined influence of all features, the predicted value of the sample's quality parameter is 1, and the output value of the force plot is 2.63.

[0082] The two features contributing the most to the feature set were selected as the key process parameters leading to quality defects. Then, the data mining results from 75% of the test set samples were persisted to a knowledge graph, a portion of which is shown below. Figure 8 As shown in the figure, purple entities represent the ID of each production batch, orange entities represent quality parameters (0 for pass, 1 for fail), red and gray entities represent important processes affecting the quality of the batch, and blue entities store the values ​​of various characteristics of the batch. The relationships between important processes and quality parameters are established through edges between entities. For example, in the batch with ID 0, SHAP indicates that feature 419 is the primary cause of the product quality anomaly, and feature 511 is the secondary cause. Because the research objective of this invention is to trace the root causes of quality anomalies, the data mining results of the remaining 25% of the test set samples are used as a validation set to verify the feasibility and accuracy of the proposed method.

[0083] The following section presents a case study of an abnormal product from the verification set. See the attached table for the various process parameters. Figure 10The KNN method is used to predict the causes of quality defects, with hyperparameter K=5, meaning five most similar samples are extracted from the knowledge graph. Each sample has two causes of the anomaly. The frequency of each of the ten causes is counted. It is found that feature 95 appears four times, feature 59 appears three times, and the remaining features appear once each. Ultimately, this invention infers that the process parameter causing the anomaly in this sample is feature 95 or feature 59, which is consistent with the results obtained by directly mining XGBoost and calculating Shapley values. However, the latter requires a lot of computation time in the case of large datasets. The KNN method, on the other hand, only requires comparing a small amount of information about batches of products with similar material information in the graph, saving time and enabling real-time anomaly tracing.

[0084] This invention uses accuracy as an evaluation metric, and experiments were conducted throughout the validation set. The formula for accuracy is shown in (7).

[0085] Accuracy = SS / VS (7)

[0086] Where SS represents the number of samples that successfully traced the source of quality anomalies, and VS represents the number of samples in the validation set.

[0087] Because the knowledge graph stores relatively little data and lacks material and operational information, the entire knowledge graph data was used for quality tracing. In the experiment, the parameter k=5 for the KNN algorithm was determined through performance comparison. A series of candidate k values ​​were tried by dividing the training and validation sets. For each candidate k value, the model's evaluation metric was calculated on the validation set, and this process was repeated multiple times to reduce randomness. Comparison of these results showed that k=5 achieved optimal or near-optimal performance on this specific dataset and task. k=5 demonstrated a good balance in this experiment, exhibiting the highest and most stable prediction accuracy on the validation set, while maintaining moderate model complexity; therefore, it was selected as the final parameter. In the experiment, the KNN algorithm was used to obtain the five most similar samples, and then frequency statistics were used to obtain a list of the top three most frequent causes of anomalies. If any of the top two anomaly causes calculated using Shapley values ​​for the test sample were in this list, the model considered the quality anomaly tracing successful (represented as Case I). Considering that the causes of product quality abnormalities are quite complex in actual production environments, we present three of the most likely factors to increase the robustness and practicality of the anomaly tracing model.

[0088] Table 3 shows the calculated accuracy of the model under the given hyperparameters. For comparative analysis, the accuracy of the first two anomaly causes calculated using Shapley values ​​for the test sample being in the anomaly cause list obtained using the KNN algorithm (represented as Case II) and the accuracy of the first anomaly cause calculated using Shapley values ​​for the test sample being in the anomaly cause list obtained using the KNN algorithm (represented as Case III) are also given. Experimental data show that the quality traceability model achieves relatively accurate localization of key process variables causing product defects. Thus, when a new anomaly sample appears on the production line, the method proposed in this invention can yield three possible causes of the anomaly, essentially covering the true cause, eliminating the need for blindly searching through 590 factors and significantly improving the efficiency of anomaly traceability. In practical applications, the knowledge graph can be periodically updated with the latest data to train the KNN model and perform quality traceability on anomaly products, thereby achieving real-time quality monitoring on the production line.

[0089] Table 3. Anomaly Tracing Results

[0090] Evaluation indicators Ⅰ II Ⅲ Accuracy 95% 64% 93%

[0091] Example 2: To achieve the above objective, such as Figure 11 As shown, based on Embodiment 1, this invention discloses a quality anomaly tracing system based on interpretable machine learning, comprising:

[0092] The knowledge graph generation module 11 is used to receive the process parameters of the product to be tested in the industrial production process, input the process parameters of the product to be tested in the industrial production process into the pre-established XGBoost product quality prediction model, perform feature contribution analysis based on the model interpretability technology of SHAP value, and output the industrial knowledge graph.

[0093] The anomaly tracing module 12 is used to extract information from the industrial knowledge graph based on the cosine similarity algorithm to obtain a historical similarity dataset. The historical similarity dataset is constructed by extracting production information that is the same as or similar to the material information and working condition information of the product with quality defects to be detected. Based on the historical similarity dataset, the KNN algorithm is used to find the historical anomaly sample that is closest to the anomaly sample in the real-time production data on the production line. By statistically analyzing the most frequently occurring influencing factors in the historical anomaly samples, the process parameters that cause the quality defects of the sample to be detected are determined, thereby realizing the traceability of product quality defects.

[0094] Based on the same inventive concept, this invention also provides a computer device, comprising: one or more processors, and a memory for storing one or more computer programs; the programs include program instructions, and the processor executes the program instructions stored in the memory. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, used to implement one or more instructions, specifically for loading and executing one or more instructions stored in a computer storage medium to implement the above-described method.

[0095] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, performs the above-described method. This storage medium can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0096] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0097] The foregoing has shown and described the basic principles, main features, and advantages of this disclosure. Those skilled in the art should understand that this disclosure is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of this disclosure. Various changes and modifications can be made to this disclosure without departing from its spirit and scope, and all such changes and modifications fall within the scope of this disclosure as claimed.

Claims

1. A method for tracing the source of quality anomalies based on interpretable machine learning, characterized in that, The method includes the following steps: The system receives process parameters of the product to be tested in the industrial production process, inputs these parameters into a pre-established XGBoost product quality prediction model, performs feature contribution analysis based on the model interpretability technology of SHAP value, and outputs an industrial knowledge graph. The industrial knowledge graph is extracted using the cosine similarity algorithm to obtain a historical similarity dataset. This dataset is constructed by extracting production information that is the same as or similar to the material and operating information of the product with quality defects to be detected. Based on the historical similarity dataset, the KNN algorithm is used to find the historical abnormal samples that are closest to the abnormal samples in the real-time production data on the production line. By statistically analyzing the most frequently occurring influencing factors in the historical abnormal samples, the process parameters that cause the quality defects of the sample to be detected are determined, thus enabling the traceability of product quality defects.

2. The quality anomaly tracing method based on interpretable machine learning according to claim 1, characterized in that, The process parameters of the product to be tested in the industrial production process are collected by a linear process chain consisting of multiple processes connected in sequence. The process includes: the product to be tested first enters process 1 for processing, and then, according to the set process route requirements, it goes through subsequent processes 2 and other processes in sequence until the product to be tested completes the final process n.

3. The quality anomaly tracing method based on interpretable machine learning according to claim 1, characterized in that, The base model in the pre-established XGBoost product quality prediction model is a CART tree, and let the CART tree generated in the j-th generation be T. j After M rounds, the final XGBoost product quality prediction model for the input sample x i The predicted value y i for: Where C is a set of CART decision trees.

4. The quality anomaly tracing method based on interpretable machine learning according to claim 1, characterized in that, The expression for the SHAP-based model interpretability technique is as follows: Each feature has a corresponding Shapley value, i.e., ω. k ω0 is a constant for explaining the model, and A is the total number of features.

5. The quality anomaly tracing method based on interpretable machine learning according to claim 4, characterized in that, The Shapley value for each feature is calculated using the following formula: In the formula, {a1,a2,…,a A } is the set of all features, and P is the subset of features needed to calculate the Shapley value. The Shapley value analysis quantifies the influence of each process parameter on defect prediction.

6. The method for tracing the source of quality anomalies based on interpretable machine learning according to claim 1, characterized in that, The triples of the industrial knowledge graph consist of Entity, Attribute, and Relation, and take the form of entity, relation, entity or entity, attribute, attribute value.

7. The method for tracing the source of quality anomalies based on interpretable machine learning according to claim 1, characterized in that, The cosine similarity calculation formula for extracting industrial knowledge graphs based on the cosine similarity algorithm is as follows: Where α is the vector representation of the material information and operating condition information of the product to be detected, β is the vector representation of the historical production information in the knowledge graph, and θ is the included angle.

8. The method for tracing the source of quality anomalies based on interpretable machine learning according to claim 1, characterized in that, The historical anomaly samples obtained from the quality inspection of the dataset to be inspected are used to identify the k most similar historical anomaly samples using Euclidean distance. By statistically analyzing the most frequently occurring influencing factors among the k historical anomaly samples, the process parameters causing quality defects in real-time production data are determined. The Euclidean distance calculation formula is as follows: Where A is the total number of features, x is Let x be the s-th dimension feature of the i-th real-time abnormal production data. js Let be the s-th dimension feature of the j-th historical abnormal production data.

9. A quality anomaly tracing system based on interpretable machine learning, employing the quality anomaly tracing method based on interpretable machine learning as described in any one of claims 1 to 8, characterized in that, include: The knowledge graph generation module receives process parameters of the product to be tested in the industrial production process, inputs these parameters into a pre-established XGBoost product quality prediction model, performs feature contribution analysis based on Shapley value model interpretability technology, and outputs an industrial knowledge graph. The anomaly tracing module is used to extract information from the industrial knowledge graph based on the cosine similarity algorithm to obtain a historical similarity dataset. This historical similarity dataset is constructed by extracting production information that is the same as or similar to the material information and operating condition information of the product with quality defects to be detected. Based on the historical similarity dataset, the KNN algorithm is used to find the historical anomaly sample that is closest to the anomaly sample in the real-time production data on the production line. By statistically analyzing the most frequently occurring influencing factors in the historical anomaly samples, the process parameters that cause the quality defects of the sample to be detected are determined, thereby realizing the traceability of product quality defects.

10. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, The memory stores a computer program that can run on a processor. When the processor loads and executes the computer program, it employs the quality anomaly tracing method based on interpretable machine learning as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Method and system for generating simulation workflow across physics fields for process defect tracing

    CN121615525A

  • Method and system for cross-physical-field generation of simulation workflows for process defect traceability

    CN121615525B