Fault key factor extraction method based on multi-granularity causal perception attention
By constructing a multi-granularity causal perception attention method, a multi-granularity feature representation space is built and causal-attention bidirectional coupling optimization is performed, which solves the problems of high computational complexity in existing methods in distinguishing causal relationships, and improves the accuracy and comprehensiveness of fault diagnosis of industrial equipment.
Patent Information
- Application Number
- CN202610098999.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-15
AI Technical Summary
Existing methods for extracting critical fault factors cannot distinguish between causal relationships and spurious correlations, resulting in a lack of intervention and interpretability of the identified critical factors. Furthermore, they are computationally complex, making it difficult to effectively integrate the advantages of causal inference and deep learning, and thus failing to fully capture the hierarchical structural information of industrial data.
We employ a multi-granularity causal perception attention method, which constructs fine-grained, medium-grained, and coarse-grained feature representation spaces. By combining causal discovery and attention mechanisms, we optimize the bidirectional coupling of causal graphs and attention weights to obtain cross-granularity consistency constraints and causal contribution, thereby achieving a deep integration of causal inference and deep learning.
It effectively distinguishes between causal relationships and spurious correlations, improves the interventionability and interpretability of key fault factors, enhances the accuracy and comprehensiveness of fault diagnosis, simplifies computational complexity, and is applicable to fault diagnosis of various industrial equipment.
Smart Images

Figure CN122045763A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial equipment fault diagnosis technology, and more specifically, relates to a method for extracting key fault factors based on multi-granularity causal perception attention. Background Technology
[0002] In recent years, with the rapid development of industry and intelligent manufacturing, the complexity and automation level of industrial equipment have been continuously increasing. Large rotating machinery (such as wind turbines, gas turbines, and compressors), CNC machine tools, and industrial robots generate massive amounts of multi-dimensional sensor data during operation, including vibration signals, temperature, pressure, current, speed, and flow rate. Accurately identifying the key factors causing equipment failure from this multi-dimensional data is crucial for achieving predictive maintenance, optimizing equipment operation strategies, and reducing unplanned downtime losses.
[0003] Existing methods for extracting critical fault factors mainly include the following: The first is based on statistical correlation, such as Pearson correlation coefficient and mutual information, which identifies critical factors by calculating the statistical correlation between feature variables and fault labels. The second is based on model importance, such as Gini importance in random forests and feature importance in gradient boosting trees, which determines importance ranking by evaluating the contribution of features to model prediction performance. The third is based on Shapley values (SHAP), which quantifies feature importance by calculating the marginal contribution of each feature to the prediction result, and is attracting attention due to its fairness and consistency. The fourth is based on causal discovery, such as PC algorithm and FCI algorithm, which attempts to learn the causal structure between variables from data. The fifth is based on deep learning attention mechanisms, which automatically learns the importance weights of features through neural networks.
[0004] However, the aforementioned existing methods for extracting critical fault factors all have some significant drawbacks: First, the methods based on statistical correlation and model importance mentioned above can only capture statistical dependencies and cannot distinguish between causal relationships and spurious correlations. The "key factors" identified based on spurious correlations are often not actionable, resulting in a lack of interpretability and practical guidance in fault diagnosis results. Second, although the above-mentioned Shapley value-based method has fairness and consistency, the SHAP value measures statistical contribution rather than causal contribution. When there is a strong correlation between features, it is easily affected by redundancy. Moreover, the standard SHAP calculation assumes that the features are independent, which often does not hold true in actual industrial data. Third, the aforementioned methods based on causal discovery and attention mechanisms suffer from high computational complexity and susceptibility to spurious correlations, making it difficult to effectively integrate the advantages of causal inference and deep learning. Fourth, the aforementioned existing methods typically perform feature analysis only at a single granularity, ignoring the hierarchical structure of features in industrial data. The same sensor may exhibit different importance patterns at different granularities, and single-granularity analysis may miss important information and fail to comprehensively and accurately identify key fault factors. Summary of the Invention
[0005] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a method for extracting critical fault factors based on multi-granularity causal perception attention. Its purpose is to solve the technical problems of existing critical fault factor extraction methods based on statistical correlation and model importance, which fail to distinguish between causal relationships and spurious correlations, resulting in a lack of intervenerability and interpretability of the identified critical factors; to solve the technical problems of existing Shapley value-based methods, which measure statistical contributions rather than causal contributions and assume feature independence, leading to insufficient accuracy in industrial data; to solve the technical problems of existing methods based on causal discovery and attention mechanisms, which suffer from high computational complexity and susceptibility to spurious correlations, respectively, making it difficult to effectively integrate the advantages of causal inference and deep learning; and to solve the technical problems of the aforementioned existing methods, which perform feature analysis only at a single granularity, failing to comprehensively capture the hierarchical structure information of industrial data.
[0006] To achieve the above objectives, according to one aspect of the present invention, a method for extracting critical fault factors based on multi-granularity causal perception attention is provided, comprising the following steps: (1) Obtain the measurement value matrix and the corresponding fault label of the estimation task from the industrial equipment to be diagnosed. Construct a multi-granularity feature representation space based on the measurement value matrix, and obtain the loss of cross-granularity consistency constraint based on the multi-granularity feature representation space. The multi-granularity feature representation space includes fine-grained feature matrix, medium-grained feature matrix and coarse-grained feature matrix. (2) Perform causal discovery processing based on continuous optimization on the medium-granularity feature matrix obtained in step (1) to obtain the initial causal graph; (3) Obtain the causal soft mask matrix based on the initial causal graph obtained in step (2), and perform attention calculation on the causal soft mask matrix to obtain the causal constraint attention weight matrix. ; (4) Perform causal path identification processing on the initial causal graph obtained in step (2) to obtain the set of causal paths from each sensor group to the target variable node in the initial causal graph, and obtain the causal contribution of each fine-grained feature in the causal constraint attention weight matrix based on the obtained causal path set and the causal constraint attention weight matrix obtained in step (3). (5) Perform causal-attention bidirectional coupling optimization on the initial causal graph obtained in step (2) and the causal constraint attention weight matrix obtained in step (3) to obtain the optimized causal graph; (6) Based on the optimized causal graph obtained in step (5), the causal contribution obtained in step (4), and the causal constraint attention weight matrix obtained in step (3), obtain the key factor score of each fine-grained feature in the fine-grained feature matrix obtained in step (1). Sort the fault key factor scores of all the fine-grained features in descending order to obtain the fault key factor ranking list. Output the fault key factor ranking list to the maintenance personnel of the industrial equipment to be diagnosed.
[0007] Preferably, step (1) includes the following sub-steps: (1-1) Obtain the measurement values of the industrial equipment to be diagnosed from multiple sensors at different sampling times, and the fault label corresponding to the estimation task of the industrial equipment to be diagnosed. The measurement values of the industrial equipment to be diagnosed, measured by all sensors at all sampling times, constitute a measurement value matrix. The measurement value matrix contains the first... Line number Column elements Indicates the first The sampling time of the first sampling moment The measured values of the industrial equipment to be diagnosed by a single sensor. , , Represents the real number field. This represents the total number of sampling times. This represents the total number of sensors; where, if the estimation task for the industrial equipment to be diagnosed is a classification task, then its corresponding fault label... ,in This represents the number of fault categories; if the estimation task for the industrial equipment to be diagnosed is a regression task, then its corresponding fault label... This indicates the health index or remaining service life of the industrial equipment to be diagnosed. (1-2) The measurement matrix obtained in step (1-1) Nonlinear transformation is performed to obtain a fine-grained feature matrix. : ; in The weight matrix is initialized using the Xavier uniform distribution initialization method, specifically from a uniform distribution... Random sampling in the middle, It is the bias vector; for A dimensional vector of all 1s; The activation function for the Gaussian error linear unit; (1-3) The fine-grained feature matrix obtained in step (1-2) Aggregation processing is performed to obtain a medium-granularity feature matrix. ; (1-4) Apply the domain knowledge mapping relationship to the medium-granularity feature matrix obtained in step (1-3). Aggregation processing is performed to obtain a coarse-grained feature matrix. ; (1-5) Based on the fine-grained feature matrix obtained in step (1-2) The medium-grained feature matrix obtained in steps (1-3) and the coarse-grained feature matrix obtained in steps (1-4) Obtain the loss for cross-granularity consistency constraints.
[0008] Preferably, step (1-3) specifically involves first calculating the fine-grained feature matrix. The Pearson correlation coefficients between every two columns are represented by the Pearson correlation coefficient matrix. Pearson correlation coefficient matrix The Middle Line number Column elements Indicates the first Column and number Pearson correlation coefficient between columns: ; in , Represents the fine-grained feature matrix The Middle Line number Column elements; Represents the fine-grained feature matrix. The mean of all elements in the column; Then, the obtained Pearson correlation coefficient matrix Hierarchical clustering is performed to obtain a sensor set consisting of multiple sensor groups. ,in This indicates the first sensor group. The total number of sensor groups in the sensor set, where each sensor group contains one or more sensors; for the first... A fine-grained feature, using This indicates the sensor group to which it belongs, i.e., satisfying Sensor group; Subsequently, the obtained sensor set was... and fine-grained feature matrix Perform within-group mean aggregation to obtain the sensor group set. The Middle Sensor group Medium-granularity feature vectors: ; in, , Indicates the first The number of sensors contained in a sensor group Represents the first element in the fine-grained feature matrix. The column vector corresponding to the column; Finally, the medium-granularity feature vectors of all sensor groups are concatenated column-wise to obtain the medium-granularity feature matrix. .
[0009] Preferably, steps (1-4) specifically include: First, obtain the domain knowledge mapping relationship. ,in For the first The set of sensor group indexes included in each field. This represents the total number of industrial equipment belonging to the sector to be diagnosed. ∈[1, ]; Then, the acquired domain knowledge mapping relationship and the medium-grained feature matrix obtained in steps (1-3) Feature concatenation is performed to obtain a neighborhood concatenated feature vector. ,in Represents the matrix concatenation operator along the column direction; Finally, a multilayer perceptron nonlinear transformation is performed on all the obtained domain-concatenated feature vectors to obtain a coarse-grained feature matrix. ; among which, for the first In terms of splicing feature vectors across different domains, its coarse-grained features The calculation formula is: ; in It is a multilayer perceptron, which adopts a two-layer fully connected structure, with the hidden layer dimension being half of the concatenated input dimension, and the activation function being the rectified linear unit ReLU; The loss of the cross-granularity consistency constraint in steps (1-5) is: ; in, This represents the consistency loss from fine-grained to medium-grained, and is equal to: ; This represents the consistency loss from medium-grained to coarse-grained, and is equal to: ; in , Indicates the first The number of sensor groups included in each field, and the weighting coefficients. 0.1.
[0010] Preferably, step (2) includes the following sub-steps: (2-1) Based on the medium-grained feature matrix obtained in step (1-3) Construct the optimization objective function for causal discovery loss: ; in, Indicates loss of causal discovery. Let represent a causal adjacency matrix, and have Its initial value is obtained through the Xavier uniform distribution initialization method and is iteratively updated in subsequent optimization steps. Indicates the first Sensor group For sensor group The strength of the causal effect , Describing the Frobenius norm, Represents the L1 norm; The weights are acyclic and adaptively adjusted using the augmented Lagrangian method. Let represent the L1 sparsity regularization coefficient, and have To induce sparsity in the causal adjacency matrix; (2-2) Perform Taylor series expansion to approximate the acyclic constraint term in the causal discovery optimization objective function obtained in step (2-1) to obtain the acyclic constraint function. : ; in, Let represent the Taylor expansion order, and have . , Represents the trace operation of a matrix; Represents the Hadamard product; when the acyclic constraint function When this occurs, it indicates that the initial causal graph obtained is a directed acyclic graph, and when the acyclic constraint function... This indicates that a loop exists in the initial causal graph obtained; (2-3) The augmented Lagrangian method is used to optimize the causal discovery objective function obtained in step (2-1) until the acyclic constraint function is solved. Continue until convergence is achieved, to obtain the causal adjacency matrix. As the initial causal graph, it includes One sensor group node and one target variable node The target variable node corresponds to the fault label obtained in step (1-1). .
[0011] Preferably, step (3) includes the following sub-steps: (3-1) Calculate the causal distance between every two fine-grained features in the initial causal graph obtained in step (2), and the causal distances obtained constitute a causal distance matrix; (3-2) Perform a soft mask transformation on the causal distance matrix obtained in step (3-1) to obtain the causal soft mask matrix. The causal soft mask matrix The Middle Line number Column elements equal: ; in The attenuation coefficient is... It is a very small positive number; (3-3) Perform a linear transformation on the fine-grained feature matrix obtained in step (1-2) to obtain the query matrix. Key matrix Sum matrix : ; ; ; in, For a learnable projection matrix, This indicates the attention head dimension, and has The reason for choosing this parameter is as follows: Attention head dimension The dimensions of the query vector and key vector are determined, which affects the ability of the attention mechanism to capture the expressiveness of relationships between features; (3-4) Perform scaling dot product attention calculation on the query matrix Q and key matrix K obtained in step (3-3) to obtain the original attention score matrix. The causal soft mask matrix obtained in step (3-2) is then incorporated into the original attention score matrix to obtain the causal constraint attention weight matrix. : ; in This represents the Shapley interaction value matrix, where the element in the i-th row and j-th column is... This represents the joint contribution of the i-th and j-th fine-grained features to the model prediction. This indicates that a normalization operation is performed on each row of the matrix. This represents the Shapley interaction weight coefficient, and has .
[0012] Preferably, step (3-1) includes the following sub-steps: (3-1-1) Determine the first causal node in the initial causal graph. Sensor group corresponding to each fine-grained feature Is it equal to the first causal graph in the initial causal graph? Sensor group corresponding to each fine-grained feature If so, then set the causal distance between the two. Then the process ends; otherwise, proceed to step (3-1-2). (3-1-2) Determine whether there exists a sensor group to which the j-th fine-grained feature belongs in the initial causal graph obtained in step (2-3). The sensor group to which the i-th fine-grained feature belongs. If a causal edge is formed, then set the causal distance between the two. Then the process ends; otherwise, proceed to step (3-1-3). (3-1-3) Use a breadth-first search algorithm to search for the sensor group to which the i-th fine-grained feature belongs in the initial causal graph. The sensor group to which the j-th fine-grained feature belongs Find the shortest causal path and determine whether there exists a sensor group to which the i-th fine-grained feature belongs in the initial causal graph. The sensor group to which the j-th fine-grained feature belongs. If the causal path is correct, then set the causal distance between the two. Set the length of the causal path, then the process ends; otherwise, set the causal distance between the two. Then the process ends.
[0013] Preferably, step (4) includes the following sub-steps: (4-1) Use the depth-first search algorithm to obtain each sensor group from the initial causal graph obtained in step (2). To the target variable node obtained in step (2-3) The set of causal paths consisting of multiple causal paths ; (4-2) Obtain the path effect of each causal path in the causal path set obtained in step (4-1); where the first... Sensor group causal path set Each causal path Path effect equal: ; in Representing causal paths A directed causal edge on the top, and The starting and ending sensor groups corresponding to the directed causal edge are respectively located in the sensor group set. The index in, and ; This represents the causal adjacency matrix obtained in step (2-3). The Middle Line number The elements of the column, i.e., from the sensor group To the sensor group The weight of causal effects; Indicates sensor group and The average causal constraint attention weight between them is equal to: ; in For the first In the causal constraint attention weight matrix at the sampling time, the th Line number Column elements; (4-3) Based on the causal constraint attention weight matrix obtained in step (3) The fine-grained feature matrix obtained in step (1-2) is calculated. The relative importance weight of the i-th fine-grained feature in its respective sensor group : ; (4-4) The path effects of each causal path obtained in step (4-2) and the relative importance weights within the group obtained in step (4-3) are weighted and summed to obtain the causal contribution of the i-th fine-grained feature. ; in Let be the path weight, and equal to: ; in Representing causal paths The length.
[0014] Preferably, step (5) includes the following sub-steps: (5-1) Set up the counter ; (5-2) Judgment Is it greater than the total number of sensor groups in the causal constraint attention weight matrix? If yes, proceed to step (5-10); otherwise, proceed to step (5-3). (5-3) Set up the counter ; (5-4) Judgment Is it greater than the total number of sensor groups in the causal constraint attention weight matrix? If yes, proceed to step (5-9); otherwise, proceed to step (5-5). (5-5) Obtain the causal constraint attention weight matrix obtained in step (3). The Middle Sensor group and the Sensor group Average causal constraint attention weights between ; (5-6) Determine the attention weight matrix for causal constraints The Middle The sensor group and the first Average causal constraint attention weights among sensor groups Does the edge value exceed the preset threshold? And in the current causal graph, from the sensor group Pointing sensor group Causal weight of causal edges Is it less than or equal to the preset causal weight threshold? If so, then the causal weights will be adjusted. Update to the average causal constraint attention weight Then proceed to step (5-7); otherwise, proceed directly to step (5-7); where a threshold is added to the edge. Causal weight threshold ; (5-7) Determine the attention weight matrix for causal constraints The Middle The sensor group and the first Average causal constraint attention weights among sensor groups Is it less than the preset edge deletion threshold? And in the current causal graph, from the sensor group Pointing sensor group Causal weight of causal edges Is it greater than the causal weight threshold? If so, then the causal weights will be adjusted. Set it to 0, then proceed to step (5-8); otherwise, proceed directly to step (5-8); where the threshold for deletion is... ; (5-8) Settings And return to step (5-4); (5-9) Settings And return to step (5-2); (5-10) The edge strength of the current causal graph is updated using the exponential moving average (EMA) method to obtain the causal graph with updated edge strength. (5-11) The Kahn algorithm based on topological sorting is used to verify the acyclicity of the causal graph after edge strength update obtained in step (5-10) in order to obtain the optimized causal graph. (5-12) Based on the optimized causal graph obtained in step (5-11) and the average causal constraint attention weight obtained in step (5-5), obtain the coupling consistency loss. : ; in, As an indicator function, when the causal weights The value is 1 if the condition is met, and 0 otherwise. (5-13) The causal discovery loss in the optimization objective function of the causal discovery loss obtained in step (2-1) The loss of cross-granularity consistency constraints obtained in steps (1-5) and the coupling consistency loss obtained in step (5-12). Obtain the overall optimization objective function: ; in Let the loss be the cross-entropy loss, and we have: ; in, Indicates the first The measured value of the industrial equipment to be diagnosed at the sampling time belongs to the first... The true label of the class, Indicates the first The measured value of the industrial equipment to be diagnosed at the sampling time belongs to the first... The probability of a class; , , , Index for fault categories.
[0015] Preferably, step (6) includes the following sub-steps: (6-1) Obtain the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (1) based on the causal constraint attention weight matrix obtained in step (3); ; (6-2) Based on the multi-granularity feature representation space obtained in step (1) and the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (6-1), obtain the cross-granularity consistency score of the fine-grained feature. (6-2-1) Based on the attention importance values of all fine-grained features in the fine-grained feature matrix obtained in step (6-1), sort all fine-grained features from high to low to obtain the fine-grained ranking results. ; (6-2-2) Obtain the first fine-grained feature matrix obtained in step (1) The sensor group to which the fine-grained features belong The average attention importance, i.e., the arithmetic mean of the attention importance values of all fine-grained features within the sensor set, is calculated for the sensor set. All sensor groups were sorted from highest to lowest according to their average attention importance to obtain a medium-granularity ranking result. ; (6-2-3) The fine-grained feature matrix obtained in step (1) is the first... The sensor group to which the fine-grained features belong The average attention importance of the domain, i.e., the arithmetic mean of the average attention importance of all sensor groups within that domain, is the same as the average attention importance of all sensor groups within the industrial equipment to be diagnosed. Each domain is ranked from highest to lowest according to its average attention importance to obtain a coarse-grained ranking result. ; (6-2-4) Based on the fine-grained ranking results obtained in step (6-2-1) The medium-grained ranking results obtained in step (6-2-2) and the coarse-grained ranking results obtained in step (6-2-3). Obtain the set of consistency scores across granularity : ; in This indicates the first in the fine-grained ranking results. One element, Indicates the ranking results of medium-grained particles The first in One element, Indicates coarse-grained ranking results The first in One element, This represents the variance function, used to measure the dispersion of the three normalized ranking values; (6-3) Perform min-max normalization on the causal contribution of each fine-grained feature in the causal constraint attention weight matrix obtained in step (4), the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (6-1), and each cross-granularity consistency score in the cross-granularity consistency score set obtained in step (6-2), to obtain the 1st... The data includes the normalized causal contribution, the normalized attention importance value, and the normalized cross-granularity consistency score corresponding to each fine-grained feature. ; ; ; in , and Respectively represent all The operation involves finding the minimum and maximum values for each fine-grained feature; min-max normalization maps all three indicators to... The interval eliminates the difference in dimensions, making the subsequent weighted summation comparable; (6-4) Based on the measurement matrix obtained in step (1-1), the optimized causal graph obtained in step (5-11), and the causal constraint attention weight matrix obtained in step (3-4), obtain the adaptive weight coefficients. : ; in , , , All four are learnable parameters, and R represents the real number field. Denotes the dimension of the joint feature vector, and has , Represents the dimension of the hidden layer, and has , Let represent the feature vector of the attention distribution, and we have: ; in This represents the matrix of measurement values obtained from step (1-1). Any extracted measurement value, This represents any feature vector of the causal graph extracted from the optimized causal graph obtained in step (5-11). This represents the causal constraint attention weight matrix obtained from step (3-4). Extract any causal constraint attention weight; (6-5) The first step obtained in step (6-3) The normalized causal contribution, normalized attention importance, and normalized cross-granularity consistency scores corresponding to each fine-grained feature are weighted and summed with the adaptive weight coefficients obtained in step (6-4) to obtain the result. Key factor scores for fine-grained features : ; (6-6) Sort the fault critical factor scores of all fine-grained features obtained in step (6-5) in descending order to obtain a fault critical factor ranking list, and output the fault critical factor ranking list to the maintenance personnel of the industrial equipment to be diagnosed.
[0016] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects: (1) Since the present invention adopts steps (2) to (4), it constructs a causal soft mask matrix to constrain the attention calculation and calculates the causal contribution of each fine-grained feature based on path-aware causal effect decomposition. Therefore, it can solve the technical problems of existing methods based on statistical correlation and model importance that cannot distinguish between causal relationships and spurious correlations and that the identified key factors lack interferability. (2) Since the present invention adopts steps (3) to (5), it realizes the mutual correction of causal graph and attention weight through causal-attention bidirectional coupling optimization mechanism, so that the attention weight reflects the real causal effect rather than statistical correlation. Therefore, it can solve the technical problems of existing Shapley value-based methods that measure statistical contribution rather than causal contribution and have insufficient accuracy when features are correlated. (3) Since the present invention adopts steps (2) and (5), it deeply integrates causal inference technology with deep learning attention mechanism through a causal discovery method based on continuous optimization and a causal-attention bidirectional coupling optimization mechanism. Therefore, it can solve the technical problem that existing methods based on causal discovery and attention mechanism are difficult to effectively integrate the advantages of both. (4) Since the present invention adopts steps (1) and (6), it constructs a multi-granularity feature representation space (fine-grained, medium-grained, and coarse-grained) and fuses cross-granularity consistency scores based on a three-dimensional adaptive scoring function. Therefore, it can solve the technical problems of the above-mentioned existing methods that only perform feature analysis at a single granularity and cannot fully capture the hierarchical structure information of industrial data. (5) The implementation of the present invention is simple, the logic between each step is clear, and it is easy to integrate and deploy in existing industrial equipment fault diagnosis systems; (6) The present invention has wide applicability and can be applied to fault diagnosis scenarios of various industrial equipment (such as wind turbine generators, gas turbines, compressors, CNC machine tools, etc.), supporting classification tasks and regression tasks. Attached Figure Description
[0017] Figure 1 This is a flowchart of the fault key factor extraction method based on multi-granularity causal perception attention of the present invention; Figure 2 This is a detailed flowchart of step (1) in the method of the present invention; Figure 3 This is a detailed flowchart of step (3) in the method of the present invention; Figure 4 This is a detailed flowchart of step (5) in the method of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0019] The basic idea of this invention is to address the shortcomings of existing methods for extracting critical fault factors from four aspects: First, by constructing a multi-granularity feature representation space containing fine-grained, medium-grained, and coarse-grained levels, the hierarchical structural information of industrial sensor data is fully explored; second, by learning the causal structure between sensor groups through a causal discovery method based on continuous optimization, and by constructing a causal soft mask matrix to constrain attention calculation, the attention weights can reflect the true causal relationship rather than spurious correlations; third, through a causal-attention bidirectional coupling optimization mechanism, the mutual correction and iterative optimization of the causal graph and attention weights are achieved, deeply integrating causal inference with deep learning; finally, through a three-dimensional adaptive scoring function, information from three dimensions—causal contribution, attention importance, and cross-granularity consistency score—is integrated to comprehensively evaluate the importance of each sensor as a critical fault factor.
[0020] like Figure 1 As shown, this invention provides a method for extracting key fault factors based on multi-granularity causal perception attention, comprising the following steps: (1) Obtain the measurement value matrix and the corresponding fault label of the estimation task from the industrial equipment to be diagnosed. Construct a multi-granularity feature representation space based on the measurement value matrix, and obtain the loss of cross-granularity consistency constraint based on the multi-granularity feature representation space. The multi-granularity feature representation space includes fine-grained feature matrix, medium-grained feature matrix and coarse-grained feature matrix.
[0021] This invention is applicable to fault classification tasks (outputting discrete fault category labels) and regression tasks (outputting continuous health index or remaining lifespan), with the loss function adjusted according to the task type.
[0022] like Figure 2 As shown, this step includes the following sub-steps: (1-1) Obtain the measurement values of the industrial equipment to be diagnosed from multiple sensors at different sampling times, and the fault label corresponding to the estimation task of the industrial equipment to be diagnosed. The measurement values of the industrial equipment to be diagnosed, measured by all sensors at all sampling times, constitute a measurement value matrix. The measurement value matrix contains the first... Line number Column elements Indicates the first The sampling time of the first sampling moment The measured values of the industrial equipment to be diagnosed by a single sensor. , , Represents the real number field. This represents the total number of sampling times. Indicates the total number of sensors; Specifically, if the estimation task for the industrial equipment to be diagnosed is a classification task, then its corresponding fault label... ,in This represents the number of fault categories (including normal states); if the estimation task for the industrial equipment to be diagnosed is a regression task, then its corresponding fault label... This indicates the health index or remaining service life of the industrial equipment to be diagnosed.
[0023] (1-2) The measurement matrix obtained in step (1-1) Nonlinear transformation is performed to obtain a fine-grained feature matrix. ; Specifically, the formula for calculating the fine-grained feature matrix is as follows: ; in The weight matrix is initialized using the Xavier uniform distribution initialization method, specifically from a uniform distribution... Random sampling in the middle, It is the bias vector; for A dimensional vector of all 1s; is the activation function for the Gaussian error linear unit.
[0024] After the above nonlinear transformation processing, the fine-grained feature matrix The measurement matrix obtained in step (1-1) was maintained. The same structural characteristics, meaning that each column of the fine-grained feature matrix still corresponds to a sensor, the first... Column represents the first The feature representation of the sensor after nonlinear transformation (hereinafter referred to as "the first sensor") (Fine-grained features), totaling These fine-grained features and their correspondences lay the foundation for subsequent sensor grouping and causal analysis.
[0025] (1-3) The fine-grained feature matrix obtained in step (1-2) Aggregation processing is performed to obtain a medium-granularity feature matrix. ; Specifically, this step involves first calculating the fine-grained feature matrix. The Pearson correlation coefficients between every two columns are represented by the Pearson correlation coefficient matrix. Pearson correlation coefficient matrix The Middle Line number Column elements Indicates the first Column and number The Pearson correlation coefficient between columns is calculated using the following formula: ; in , Represents the fine-grained feature matrix The Middle Line number Column elements; Represents the fine-grained feature matrix. The mean of all elements in the column; Then, the obtained Pearson correlation coefficient matrix Hierarchical clustering is performed to obtain a sensor set consisting of multiple sensor groups. ,in This indicates the first sensor group. Let be the total number of sensor groups in the sensor set, where each sensor group contains one or more sensors. For the , A fine-grained feature, using This indicates the sensor group to which it belongs, i.e., satisfying The sensor array.
[0026] Furthermore, the hierarchical clustering process uses the Ward method as the link criterion, and incorporates the Pearson correlation coefficient matrix... Sensor pairs with an absolute value greater than 0.7 are grouped into the same sensor group. A correlation coefficient threshold of 0.7 is used based on the statistical criterion of strong correlation. In industrial equipment fault diagnosis scenarios, sensor groups can be divided according to equipment components, such as bearing sensor groups, gearbox sensor groups, lubrication system sensor groups, etc.
[0027] Subsequently, the obtained sensor set was... and fine-grained feature matrix Perform within-group mean aggregation to obtain the sensor group set. The Middle Sensor group Medium-granularity feature vectors: ; in, , Indicates the first The number of sensors contained in a sensor group Represents the first element in the fine-grained feature matrix. The column vector corresponding to the column; Finally, the medium-granularity feature vectors of all sensor groups are concatenated column-wise to obtain the medium-granularity feature matrix. .
[0028] (1-4) Apply the domain knowledge mapping relationship to the medium-granularity feature matrix obtained in step (1-3). Aggregation processing is performed to obtain a coarse-grained feature matrix. ; This step specifically involves: First, obtaining the domain knowledge mapping relationship. ,in For the first The set of sensor group indexes included in each field. This represents the total number of industrial equipment belonging to the sector to be diagnosed. ∈[1, ]; In industrial equipment fault diagnosis scenarios, the domain can be divided according to equipment subsystems, such as: power subsystem domain (including sensor groups for components such as motors and gearboxes), transmission subsystem domain (including sensor groups for components such as bearings, couplings, and drive shafts), auxiliary subsystem domain (including sensor groups for systems such as lubrication, cooling, and sealing), etc.
[0029] Then, the acquired domain knowledge mapping relationship and the medium-grained feature matrix obtained in steps (1-3) Perform feature concatenation processing (i.e., for the first...) Each field The medium-granularity feature vectors of all sensor groups in the domain are concatenated column-wise to obtain the domain concatenated feature vector. ,in This represents a matrix concatenation operator along the column direction, which horizontally concatenates all medium-granularity feature vectors belonging to the same domain according to the sensor group index order.
[0030] Finally, a multilayer perceptron nonlinear transformation is performed on all the obtained domain-concatenated feature vectors to obtain a coarse-grained feature matrix. ; Specifically, for the first In terms of splicing feature vectors across different domains, its coarse-grained features The calculation formula is: ; in This is a multilayer perceptron, employing a two-layer fully connected structure. The hidden layer dimension is half the concatenated input dimension, and the activation function is the Rectified Linear Unit (ReLU), defined as follows: The output is 0 when the input is negative, and equal to the input itself when the input is positive. This multilayer perceptron nonlinearly maps the concatenated medium-granular features to a coarse-granular representation, enabling it to capture the complex interactions between different components within the same subsystem.
[0031] (1-5) Based on the fine-grained feature matrix obtained in step (1-2) The medium-grained feature matrix obtained in steps (1-3) and the coarse-grained feature matrix obtained in steps (1-4) Obtain the loss across granularity consistency constraints; Specifically, the loss across granularity consistency constraints is: ; in, This represents the consistency loss from fine-grained to medium-grained, and is equal to: ; This represents the consistency loss from medium-grained to coarse-grained, and is equal to: ; in , Indicates the first The number of sensor groups included in each field, and the weighting coefficients. 0.1, to balance the constraint strength and the model degrees of freedom.
[0032] The advantage of this step (1) is that by constructing a multi-granularity feature representation space containing three levels of fine-grained, medium-grained and coarse-grained features, the hierarchical structural information of industrial sensor data can be fully explored, providing rich multi-scale feature representations for subsequent causal discovery and key factor scoring.
[0033] (2) Perform continuous optimization-based causal discovery processing on the medium-granularity feature matrix obtained in step (1) to obtain the initial causal graph; Specifically, this step includes the following sub-steps: (2-1) Based on the medium-grained feature matrix obtained in step (1-3) Construct an optimization objective function for causal discovery loss; Medium-grained feature representations are chosen for causal discovery because they strike a good balance between computational efficiency and expressive power: fine-grained features have too high a dimension, leading to unacceptable computational complexity, while coarse-grained features are too abstract and may lose details of component-level causal relationships.
[0034] The objective function for optimizing causal discovery loss is: ; in, Indicates loss of causal discovery. Let represent a causal adjacency matrix, and have Its initial value is obtained through the Xavier uniform distribution initialization method and is iteratively updated in subsequent optimization steps. Indicates the first Sensor group For sensor group The strength of the causal effect , Describing the Frobenius norm, Represents the L1 norm; The weights are acyclic and adaptively adjusted using the augmented Lagrangian method. Let represent the L1 sparsity regularization coefficient, and have To induce sparsity in the causal adjacency matrix; (2-2) Perform Taylor series expansion to approximate the acyclic constraint term in the causal discovery optimization objective function obtained in step (2-1) to obtain the acyclic constraint function. ; This step uses the following calculation formula: ; in, Let represent the Taylor expansion order, and have . , Represents the trace operation of a matrix; Hadamard product (element-by-element multiplication); when the acyclic constraint function... When this occurs, it indicates that the initial causal graph obtained is a directed acyclic graph, and when the acyclic constraint function... This indicates that a loop exists in the initial causal graph obtained.
[0035] Taylor expansion order It can be guaranteed that the truncation error is less than This meets the accuracy requirements for causal discovery.
[0036] (2-3) The augmented Lagrangian method is used to optimize the causal discovery objective function obtained in step (2-1) until the acyclic constraint function is solved. Continue until convergence is achieved, to obtain the causal adjacency matrix. As the initial causal graph, it includes One sensor group node and one target variable node The target variable node corresponds to the fault label obtained in step (1-1). ; Specifically, due to the causal adjacency matrix The dimension is This describes the causal relationships between sensor groups; therefore, this initial causal graph is also called a medium-granularity causal graph. The target variable nodes correspond to the fault labels obtained in step (1-1). , is used to represent the target variable for fault classification or health index prediction, and each sensor group node is connected to the target variable node through a directed causal edge.
[0037] The advantage of this step (2) is that, through the causal discovery method based on continuous optimization, the causal structure between sensor groups can be learned efficiently from medium-granular feature data. Compared with traditional constraint-based causal discovery algorithms such as PC and FCI, it has lower computational complexity and better scalability.
[0038] (3) Obtain the causal soft mask matrix based on the initial causal graph obtained in step (2), and perform attention calculation on the causal soft mask matrix to obtain the causal constraint attention weight matrix. ; like Figure 3 As shown, this step includes the following sub-steps: (3-1) Calculate the causal distance between every two fine-grained features in the initial causal graph obtained in step (2), and all the causal distances obtained constitute the causal distance matrix.
[0039] This step includes the following sub-steps: (3-1-1) Determine the first causal node in the initial causal graph. Sensor group corresponding to each fine-grained feature Is it equal to the first causal graph in the initial causal graph? Sensor group corresponding to each fine-grained feature If so, then set the causal distance between the two. Then the process ends; otherwise, proceed to step (3-1-2). (3-1-2) Determine whether there exists a sensor group to which the j-th fine-grained feature belongs in the initial causal graph obtained in step (2-3). The sensor group to which the i-th fine-grained feature belongs. If a causal edge is formed, then set the causal distance between the two. Then the process ends; otherwise, proceed to step (3-1-3). (3-1-3) Use a breadth-first search algorithm to search for the sensor group to which the i-th fine-grained feature belongs in the initial causal graph. The sensor group to which the j-th fine-grained feature belongs Find the shortest causal path (a causal path is an ordered sequence of nodes and edges traversed from the source node along directed edges to the target node in a causal graph), and determine whether there exists a sensor group belonging to the i-th fine-grained feature in the initial causal graph. The sensor group to which the j-th fine-grained feature belongs. If the causal path is correct, then set the causal distance between the two. Set the length of the causal path (i.e., the number of edges traversed along the causal path), and then the process ends; otherwise, set the causal distance between the two. Then the process ends; (3-2) Perform a soft mask transformation on the causal distance matrix obtained in step (3-1) to obtain the causal soft mask matrix. ; Specifically, this step uses the following formula to obtain the causal soft mask matrix. The Middle Line number Column elements : ; in The attenuation coefficient controls the rate at which the causal soft mask value decays as the causal distance increases; It is a very small positive number used to preserve non-zero soft mask values when no causal path exists.
[0040] (3-3) Perform a linear transformation on the fine-grained feature matrix obtained in step (1-2) to obtain the query matrix. Key matrix Sum matrix : ; ; ; in, For a learnable projection matrix, This indicates the attention head dimension, and has The reason for choosing this parameter is as follows: Attention head dimension The dimensions of the query vector and key vector are determined, which affects the ability of the attention mechanism to capture the expressive power of the relationships between features.
[0041] (3-4) Perform scaling dot product attention calculation on the query matrix Q and key matrix K obtained in step (3-3) to obtain the original attention score matrix. The causal soft mask matrix obtained in step (3-2) is then incorporated into the original attention score matrix to obtain the causal constraint attention weight matrix. ; Specifically, this step uses the following formula: ; in, This represents the Shapley interaction value matrix, where the element in the i-th row and j-th column is... This represents the joint contribution of the i-th and j-th fine-grained features to the model prediction, which can be calculated using the SHAP library. This means performing a normalization operation on each row of the matrix to ensure that the sum of the elements in each row is 1. This represents the Shapley interaction weight coefficient, and has The reason for choosing this parameter is as follows: Shapley interaction value matrix Used to supplement feature pairs not covered by the causal soft mask matrix (i.e. (part of the weighting coefficient) This determines the extent to which Shapley interaction information contributes to attention calculation.
[0042] The advantage of this step (3) is that by constructing a causal soft mask matrix to constrain the attention calculation, the attention weights can reflect the real causal relationship rather than spurious correlations, thereby effectively avoiding the problem that traditional attention mechanisms are susceptible to spurious correlations.
[0043] (4) Perform causal path identification processing on the initial causal graph obtained in step (2) to obtain the set of causal paths from each sensor group to the target variable node in the initial causal graph, and obtain the causal contribution of each fine-grained feature in the causal constraint attention weight matrix based on the obtained causal path set and the causal constraint attention weight matrix obtained in step (3). Specifically, this step includes the following sub-steps: (4-1) Use the depth-first search algorithm to obtain each sensor group from the initial causal graph obtained in step (2). To the target variable node obtained in step (2-3) The set of causal paths consisting of multiple causal paths ; To avoid an exponential explosion in the number of causal paths, this embodiment sets the maximum causal path length to 5 edges.
[0044] (4-2) Obtain the path effect of each causal path in the causal path set obtained in step (4-1); Specifically, the first step (4-1) yields the... Sensor group causal path set Each causal path Path effect equal: ; in Representing causal paths A directed causal edge on the top, and The starting and ending sensor groups corresponding to the directed causal edge are respectively located in the sensor group set. The index in, and ; This represents the causal adjacency matrix obtained in step (2-3). The Middle Line number The elements of the column, i.e., from the sensor group To the sensor group The weight of causal effects; Indicates sensor group and The average causal constraint attention weight between them is equal to: ; in For the first In the causal constraint attention weight matrix at the sampling time, the th Line number Column elements; (4-3) Based on the causal constraint attention weight matrix obtained in step (3) The fine-grained feature matrix obtained in step (1-2) is calculated. The relative importance weight of the i-th fine-grained feature in its respective sensor group ; Specifically, this step uses the following formula to calculate the i-th fine-grained feature in the fine-grained feature matrix obtained in step (1-2). : ; The design of this formula ensures that the sum of the relative importance weights of all fine-grained features within the same sensor group is 1, i.e. .
[0045] (4-4) The path effects of each causal path obtained in step (4-2) and the relative importance weights within the group obtained in step (4-3) are weighted and summed to obtain the causal contribution of the i-th fine-grained feature. ; in, Let be the path weight, and equal to: ; in Representing causal paths The length (number of sides).
[0046] This embodiment sets a causal path length attenuation coefficient. This gives direct causal pathways a higher weight than indirect causal pathways, as they are generally more reliable and easier to intervene in.
[0047] The advantage of this step (4) is that, through the path-aware causal effect decomposition method, the causal contribution of each fine-grained feature to the target variable can be accurately calculated, providing an interpretable causal basis for the identification of key fault factors.
[0048] (5) Perform causal-attention bidirectional coupling optimization on the initial causal graph obtained in step (2) and the causal constraint attention weight matrix obtained in step (3) to obtain the optimized causal graph; like Figure 4 As shown, this step includes the following sub-steps: (5-1) Set up the counter ; (5-2) Judgment Is it greater than the total number of sensor groups in the causal constraint attention weight matrix? If yes, proceed to step (5-10); otherwise, proceed to step (5-3). (5-3) Set up the counter ; (5-4) Judgment Is it greater than the total number of sensor groups in the causal constraint attention weight matrix? If yes, proceed to step (5-9); otherwise, proceed to step (5-5). (5-5) Obtain the causal constraint attention weight matrix obtained in step (3). The Middle Sensor group and the Sensor group Average causal constraint attention weights between ; The calculation method in this step is exactly the same as that in step (4-2) above, and will not be repeated here; (5-6) Determine the attention weight matrix for causal constraints The Middle The sensor group and the first Average causal constraint attention weights among sensor groups Does the edge value exceed the preset threshold? And in the current causal graph, from the sensor group Pointing sensor group Causal weight of causal edges Is it less than or equal to the preset causal weight threshold? If so, then the causal weights will be adjusted. Update to the average causal constraint attention weight Then proceed to step (5-7); otherwise proceed directly to step (5-7). In this invention, a threshold for adding edges is set. This is used to determine whether the attention weight is strong enough to imply a potential causal relationship; a causal weight threshold is set. This is used to determine whether a causal edge already exists in the current causal graph.
[0049] (5-7) Determine the attention weight matrix for causal constraints The Middle The sensor group and the first Average causal constraint attention weights among sensor groups Is it less than the preset edge deletion threshold? And in the current causal graph, from the sensor group Pointing sensor group Causal weight of causal edges Is it greater than the causal weight threshold? If so, then the causal weights will be adjusted. Set it to 0, then proceed to step (5-8); otherwise proceed directly to step (5-8). In this invention, a threshold for edge deletion is set. This is used to determine whether the attention weight is too weak and the corresponding causal edge needs to be deleted.
[0050] (5-8) Settings And return to step (5-4); (5-9) Settings And return to step (5-2); (5-10) Update the edge strength of the current causal graph to obtain the causal graph with updated edge strength; Specifically, for the causal edges (i.e., causal weights) retained in the current causal graph Furthermore, for the edges that were not set to zero in steps (5-7), their causal weights are updated using the Exponential Moving Average (EMA) method to obtain the updated causal weights: (5-11) The Kahn algorithm based on topological sorting is used to verify the acyclicity of the causal graph after edge strength update obtained in step (5-10) in order to obtain the optimized causal graph. (5-12) Based on the optimized causal graph obtained in step (5-11) and the average causal constraint attention weight obtained in step (5-5), obtain the coupling consistency loss. .
[0051] Specifically, the coupling consistency loss is: ; in, As an indicator function, when the causal weights The value is 1 if it is true, and 0 otherwise.
[0052] (5-13) The causal discovery loss in the optimization objective function of the causal discovery loss obtained in step (2-1) The loss of cross-granularity consistency constraints obtained in steps (1-5) and the coupling consistency loss obtained in step (5-12). Obtain the overall optimization objective function; The overall optimization objective function is: ; in Let the loss be the cross-entropy loss, and we have: ; in, Indicates the first The measured value of the industrial equipment to be diagnosed at the sampling time belongs to the first... The actual label of the class (using one-hot encoding, if it belongs to the first class) (If it is a class, it is 1; otherwise, it is 0). Indicates the first The measured value of the industrial equipment to be diagnosed at the sampling time belongs to the first... The probability of the class; this embodiment sets , , To balance predictive performance, causal structure learning, and the coordination of attention distribution, Index for fault categories; The advantage of step (5) is that, through the causal-attention bidirectional coupling optimization mechanism, the mutual correction and iterative optimization of the causal graph and the attention weights are realized, effectively integrating the interpretability advantage of causal inference and the representation learning capability of deep learning. The advantages of steps (2) to (5) above are that, by deeply integrating causal inference technology with deep learning attention mechanism, the problems of high computational complexity when using causal discovery method alone and susceptibility to false correlation when using attention mechanism alone are avoided, and the advantages of both are complemented.
[0053] (6) Based on the optimized causal graph obtained in step (5), the causal contribution obtained in step (4), and the causal constraint attention weight matrix obtained in step (3), obtain the key factor score of each fine-grained feature in the fine-grained feature matrix obtained in step (1). Sort the fault key factor scores of all the fine-grained features in descending order to obtain the fault key factor ranking list. Output the fault key factor ranking list to the maintenance personnel of the industrial equipment to be diagnosed.
[0054] Specifically, this step includes the following sub-steps: (6-1) Obtain the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (1) based on the causal constraint attention weight matrix obtained in step (3); ; The formula calculates the first... The sum of the average attention weights of each fine-grained feature to all other features in the fine-grained feature matrix reflects the overall attention level of that fine-grained feature in the attention mechanism.
[0055] (6-2) Based on the multi-granularity feature representation space obtained in step (1) and the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (6-1), obtain the cross-granularity consistency score of the fine-grained feature. (6-2-1) Based on the attention importance values of all fine-grained features in the fine-grained feature matrix obtained in step (6-1), sort all fine-grained features from high to low to obtain the fine-grained ranking results. ; (6-2-2) Obtain the first fine-grained feature matrix obtained in step (1) The sensor group to which the fine-grained features belong The average attention importance (i.e., the arithmetic mean of the attention importance values of all fine-grained features within the sensor set) for the sensor set. All sensor groups were sorted from highest to lowest according to their average attention importance to obtain a medium-granularity ranking result. ; (6-2-3) The fine-grained feature matrix obtained in step (1) is the first... The sensor group to which the fine-grained features belong The average attention importance of the field (i.e., the arithmetic mean of the average attention importance of all sensor groups within that field), and the total attention importance of the industrial equipment to be diagnosed. Each domain is ranked from highest to lowest according to its average attention importance to obtain a coarse-grained ranking result. ; (6-2-4) Based on the fine-grained ranking results obtained in step (6-2-1) The medium-grained ranking results obtained in step (6-2-2) and the coarse-grained ranking results obtained in step (6-2-3). Obtain the set of consistency scores across granularity : Specifically, the i-th element in the cross-granularity consistency score set equal: ; in This indicates the first in the fine-grained ranking results. One element, Indicates the ranking results of medium-grained particles The first in One element, Indicates coarse-grained ranking results The first in One element, This represents the variance function, used to measure the dispersion of the three normalized ranking values.
[0056] This formula ensures that features with consistent importance rankings across the three granularity levels receive higher consistency scores, indicating that their importance is more robust.
[0057] (6-3) Perform min-max normalization on the causal contribution of each fine-grained feature in the causal constraint attention weight matrix obtained in step (4), the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (6-1), and each cross-granularity consistency score in the cross-granularity consistency score set obtained in step (6-2), to obtain the 1st... The data includes the normalized causal contribution, the normalized attention importance value, and the normalized cross-granularity consistency score corresponding to each fine-grained feature. ; ; ; in , and Respectively represent all The minimum and maximum values are calculated for each fine-grained feature. Minimum-maximum normalization maps all three metrics to... The interval eliminates the difference in dimensions, making the subsequent weighted summation comparable.
[0058] (6-4) Based on the measurement value matrix obtained in step (1-1), the optimized causal graph obtained in step (5-11), and the causal constraint attention weight matrix obtained in step (3-4), obtain the adaptive weight coefficients; Specifically, adaptive weighting coefficients equal: ; in , , , All four are learnable parameters, and R represents the real number field. Denotes the dimension of the joint feature vector, and has , Represents the dimension of the hidden layer, and has , Let represent the feature vector of the attention distribution, and we have: ; in This represents the matrix of measurement values obtained from step (1-1). Any extracted measurement value, This represents any feature vector of the causal graph extracted from the optimized causal graph obtained in step (5-11). This represents the causal constraint attention weight matrix obtained from step (3-4). Extract any causal constraint attention weight.
[0059] (6-5) The first step obtained in step (6-3) The normalized causal contribution, normalized attention importance, and normalized cross-granularity consistency scores corresponding to each fine-grained feature are weighted and summed with the adaptive weight coefficients obtained in step (6-4) to obtain the result. Key factor scores for fine-grained features : ; because After softmax normalization, it satisfies And all are non-negative, therefore the key factor scores .
[0060] The weight generation network and the main model are trained end-to-end, and the weights are automatically learned through backpropagation to dynamically adjust the weight combination of the three dimensions according to the current data characteristics and model state.
[0061] (6-6) Sort the fault critical factor scores of all fine-grained features obtained in step (6-5) in descending order to obtain a fault critical factor ranking list, and output the fault critical factor ranking list to the maintenance personnel of the industrial equipment to be diagnosed.
[0062] The advantage of step (6) is that by using a three-dimensional adaptive scoring function to integrate information from three dimensions—causal contribution, attention importance, and cross-granularity consistency score—it can comprehensively and robustly assess the importance of each sensor as a key factor in failure, avoiding the limitations of a single indicator. The advantages of steps (1) to (6) above are that by using a multi-granularity causal perception attention mechanism, it can identify key sensors and key operating parameters with real causal effects, avoid interference from spurious correlations, and provide reliable technical support for predictive maintenance and root cause analysis of industrial equipment.
[0063] This invention achieves multi-level fine-grained feature modeling by constructing a multi-granularity feature representation space; effectively avoids spurious correlation interference through a causal constraint-based soft masking attention mechanism; provides a finer-grained causal explanation than traditional methods through path-aware causal effect decomposition; achieves deep integration of causal inference and deep learning through a causal-attention bidirectional coupling optimization mechanism; and provides a more comprehensive and robust evaluation of key factors through a three-dimensional adaptive scoring function. Compared with existing technologies, this invention can identify fault-critical sensors and key operating parameters with genuine causal effects, avoid spurious correlation interference, and provide reliable technical support for predictive maintenance and root cause analysis of industrial equipment under diagnosis.
[0064] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for extracting key fault factors based on multi-granularity causal perception attention, characterized in that, Includes the following steps: (1) Obtain the measurement value matrix and the corresponding fault label of the estimation task from the industrial equipment to be diagnosed. Construct a multi-granularity feature representation space based on the measurement value matrix, and obtain the loss of cross-granularity consistency constraint based on the multi-granularity feature representation space. The multi-granularity feature representation space includes fine-grained feature matrix, medium-grained feature matrix and coarse-grained feature matrix. (2) Perform causal discovery processing based on continuous optimization on the medium-granularity feature matrix obtained in step (1) to obtain the initial causal graph; (3) Obtain the causal soft mask matrix based on the initial causal graph obtained in step (2), and perform attention calculation on the causal soft mask matrix to obtain the causal constraint attention weight matrix. ; (4) Perform causal path identification processing on the initial causal graph obtained in step (2) to obtain the set of causal paths from each sensor group to the target variable node in the initial causal graph, and obtain the causal contribution of each fine-grained feature in the causal constraint attention weight matrix based on the obtained causal path set and the causal constraint attention weight matrix obtained in step (3). (5) Perform causal-attention bidirectional coupling optimization on the initial causal graph obtained in step (2) and the causal constraint attention weight matrix obtained in step (3) to obtain the optimized causal graph; (6) Based on the optimized causal graph obtained in step (5), the causal contribution obtained in step (4), and the causal constraint attention weight matrix obtained in step (3), obtain the key factor score of each fine-grained feature in the fine-grained feature matrix obtained in step (1). Sort the fault key factor scores of all the fine-grained features in descending order to obtain the fault key factor ranking list. Output the fault key factor ranking list to the maintenance personnel of the industrial equipment to be diagnosed.
2. The method for extracting key fault factors based on multi-granularity causal perception attention according to claim 1, characterized in that, Step (1) includes the following sub-steps: (1-1) Obtain the measurement values of the industrial equipment to be diagnosed from multiple sensors at different sampling times, and the fault label corresponding to the estimation task of the industrial equipment to be diagnosed. The measurement values of the industrial equipment to be diagnosed, measured by all sensors at all sampling times, constitute a measurement value matrix. The measurement value matrix contains the first... Line number Column elements Indicates the first The sampling time of the first sampling moment The measured values of the industrial equipment to be diagnosed by a single sensor. , , Represents the real number field. This represents the total number of sampling times. Indicates the total number of sensors; If the estimation task for the industrial equipment to be diagnosed is a classification task, then its corresponding fault label... ,in This represents the number of fault categories; if the estimation task for the industrial equipment to be diagnosed is a regression task, then its corresponding fault label... This indicates the health index or remaining service life of the industrial equipment to be diagnosed. (1-2) The measurement matrix obtained in step (1-1) Nonlinear transformation is performed to obtain a fine-grained feature matrix. : ; in The weight matrix is initialized using the Xavier uniform distribution initialization method, specifically from a uniform distribution... Random sampling in the middle, It is the bias vector; for A dimensional vector of all 1s; The activation function for the Gaussian error linear unit; (1-3) The fine-grained feature matrix obtained in step (1-2) Aggregation processing is performed to obtain a medium-granularity feature matrix. ; (1-4) Apply the domain knowledge mapping relationship to the medium-granularity feature matrix obtained in step (1-3). Aggregation processing is performed to obtain a coarse-grained feature matrix. ; (1-5) Based on the fine-grained feature matrix obtained in step (1-2) The medium-grained feature matrix obtained in steps (1-3) and the coarse-grained feature matrix obtained in steps (1-4) Obtain the loss for cross-granularity consistency constraints.
3. The method for extracting critical fault factors based on multi-granularity causal perception attention according to claim 1 or 2, characterized in that, Steps (1-3) specifically involve first calculating the fine-grained feature matrix. The Pearson correlation coefficients between every two columns are represented by the Pearson correlation coefficient matrix. Pearson correlation coefficient matrix The Middle Line number Column elements Indicates the first Column and number Pearson correlation coefficient between columns: ; in , Represents the fine-grained feature matrix The Middle Line number Column elements; Represents the fine-grained feature matrix. The mean of all elements in the column; Then, the obtained Pearson correlation coefficient matrix Hierarchical clustering is performed to obtain a sensor set consisting of multiple sensor groups. ,in This indicates the first sensor group. The total number of sensor groups in the sensor set, where each sensor group contains one or more sensors; for the first... A fine-grained feature, using This indicates the sensor group to which it belongs, i.e., satisfying Sensor group; Subsequently, the obtained sensor set was... and fine-grained feature matrix Perform within-group mean aggregation to obtain the sensor group set. The Middle Sensor group Medium-granularity feature vectors: ; in, , Indicates the first The number of sensors contained in a sensor group Represents the first element in the fine-grained feature matrix. The column vector corresponding to the column; Finally, the medium-granularity feature vectors of all sensor groups are concatenated column-wise to obtain the medium-granularity feature matrix. .
4. The method for extracting critical fault factors based on multi-granularity causal perception attention according to any one of claims 1 to 3, characterized in that, Steps (1-4) are as follows: First, obtain the domain knowledge mapping relationship. ,in For the first The set of sensor group indexes included in each field. This represents the total number of industrial equipment belonging to the sector to be diagnosed. ∈[1, ]; Then, the acquired domain knowledge mapping relationship and the medium-grained feature matrix obtained in steps (1-3) Feature concatenation is performed to obtain a neighborhood concatenated feature vector. ,in Represents the matrix concatenation operator along the column direction; Finally, a multilayer perceptron nonlinear transformation is performed on all the obtained domain-concatenated feature vectors to obtain a coarse-grained feature matrix. ; among which, for the first In terms of splicing feature vectors across different domains, its coarse-grained features The calculation formula is: ; in It is a multilayer perceptron, which adopts a two-layer fully connected structure, with the hidden layer dimension being half of the concatenated input dimension, and the activation function being the rectified linear unit ReLU; The loss of the cross-granularity consistency constraint in steps (1-5) is: ; in, This represents the consistency loss from fine-grained to medium-grained, and is equal to: ; This represents the consistency loss from medium-grained to coarse-grained, and is equal to: ; in , Indicates the first The number of sensor groups included in each field, and the weighting coefficients. 0.
1.
5. The method for extracting key fault factors based on multi-granularity causal perception attention according to claim 4, characterized in that, Step (2) includes the following sub-steps: (2-1) Based on the medium-grained feature matrix obtained in step (1-3) Construct the optimization objective function for causal discovery loss: ; in, Indicates loss of causal discovery. Let represent a causal adjacency matrix, and have . Its initial value is obtained through the Xavier uniform distribution initialization method and is iteratively updated in subsequent optimization steps. Indicates the first Sensor group For sensor group The strength of the causal effect , Describing the Frobenius norm, Represents the L1 norm; The weights are acyclic and adaptively adjusted using the augmented Lagrangian method. Let represent the L1 sparsity regularization coefficient, and have To induce sparsity in the causal adjacency matrix; (2-2) Perform Taylor series expansion to approximate the acyclic constraint term in the causal discovery optimization objective function obtained in step (2-1) to obtain the acyclic constraint function. : ; in, Let represent the Taylor expansion order, and have . , Represents the trace operation of a matrix; Represents the Hadamard product; when the acyclic constraint function When this occurs, it indicates that the initial causal graph obtained is a directed acyclic graph, and when the acyclic constraint function... This indicates that a loop exists in the initial causal graph obtained; (2-3) The augmented Lagrangian method is used to optimize the causal discovery objective function obtained in step (2-1) until the acyclic constraint function is solved. Continue until convergence is achieved, to obtain the causal adjacency matrix. As the initial causal graph, it includes One sensor group node and one target variable node The target variable node corresponds to the fault label obtained in step (1-1). .
6. The method for extracting key fault factors based on multi-granularity causal perception attention according to claim 5, characterized in that, Step (3) includes the following sub-steps: (3-1) Calculate the causal distance between every two fine-grained features in the initial causal graph obtained in step (2), and the causal distances obtained constitute a causal distance matrix; (3-2) Perform a soft mask transformation on the causal distance matrix obtained in step (3-1) to obtain the causal soft mask matrix. The causal soft mask matrix The Middle Line number Column elements equal: ; in The attenuation coefficient is... It is a very small positive number; (3-3) Perform a linear transformation on the fine-grained feature matrix obtained in step (1-2) to obtain the query matrix. Key matrix Sum matrix : ; ; ; in, The projection matrix is learnable. This indicates the attention head dimension, and has The reason for choosing this parameter is as follows: Attention head dimension The dimensions of the query vector and key vector are determined, which affects the ability of the attention mechanism to capture the expressiveness of relationships between features; (3-4) Perform scaling dot product attention calculation on the query matrix Q and key matrix K obtained in step (3-3) to obtain the original attention score matrix. The causal soft mask matrix obtained in step (3-2) is then incorporated into the original attention score matrix to obtain the causal constraint attention weight matrix. : ; in This represents the Shapley interaction value matrix, where the element in the i-th row and j-th column is... This represents the joint contribution of the i-th and j-th fine-grained features to the model prediction. This indicates that a normalization operation is performed on each row of the matrix. This represents the Shapley interaction weight coefficient, and has .
7. The method for extracting key fault factors based on multi-granularity causal perception attention according to claim 6, characterized in that, Step (3-1) includes the following sub-steps: (3-1-1) Determine the first causal node in the initial causal graph. Sensor group corresponding to each fine-grained feature Is it equal to the first causal graph in the initial causal graph? Sensor group corresponding to each fine-grained feature If so, then set the causal distance between the two. Then the process ends; otherwise, proceed to step (3-1-2). (3-1-2) Determine whether there exists a sensor group to which the j-th fine-grained feature belongs in the initial causal graph obtained in step (2-3). The sensor group to which the i-th fine-grained feature belongs. If a causal edge is formed, then set the causal distance between the two. Then the process ends; otherwise, proceed to step (3-1-3). (3-1-3) Use a breadth-first search algorithm to search for the sensor group to which the i-th fine-grained feature belongs in the initial causal graph. The sensor group to which the j-th fine-grained feature belongs Find the shortest causal path and determine whether there exists a sensor group to which the i-th fine-grained feature belongs in the initial causal graph. The sensor group to which the j-th fine-grained feature belongs. If the causal path is correct, then set the causal distance between the two. Set the length of the causal path, then the process ends; otherwise, set the causal distance between the two. Then the process ends.
8. The method for extracting key fault factors based on multi-granularity causal perception attention according to claim 7, characterized in that, Step (4) includes the following sub-steps: (4-1) Use the depth-first search algorithm to obtain each sensor group from the initial causal graph obtained in step (2). To the target variable node obtained in step (2-3) The set of causal paths consisting of multiple causal paths ; (4-2) Obtain the path effect of each causal path in the causal path set obtained in step (4-1); where the first... Sensor group causal path set Each causal path Path effect equal: ; in Representing a causal path A directed causal edge on the top, and The starting and ending sensor groups corresponding to the directed causal edge are respectively located in the sensor group set. The index in, and ; This represents the causal adjacency matrix obtained in step (2-3). The Middle Line number The elements of the column, i.e., from the sensor group To the sensor group The weight of causal effects; Indicates sensor group and The average causal constraint attention weight between them is equal to: ; in For the first In the causal constraint attention weight matrix at the sampling time, the th Line number Column elements; (4-3) Based on the causal constraint attention weight matrix obtained in step (3) The fine-grained feature matrix obtained in step (1-2) is calculated. The relative importance weight of the i-th fine-grained feature in its respective sensor group : ; (4-4) The path effects of each causal path obtained in step (4-2) and the relative importance weights within the group obtained in step (4-3) are weighted and summed to obtain the causal contribution of the i-th fine-grained feature. ; in Let be the path weight, and equal to: ; in Representing a causal path The length.
9. The method for extracting key fault factors based on multi-granularity causal perception attention according to claim 8, characterized in that, Step (5) includes the following sub-steps: (5-1) Set up the counter ; (5-2) Judgment Is it greater than the total number of sensor groups in the causal constraint attention weight matrix? If yes, proceed to step (5-10); otherwise, proceed to step (5-3). (5-3) Set up the counter ; (5-4) Judgment Is it greater than the total number of sensor groups in the causal constraint attention weight matrix? If yes, proceed to step (5-9); otherwise, proceed to step (5-5). (5-5) Obtain the causal constraint attention weight matrix obtained in step (3). The Middle Sensor group and the Sensor group Average causal constraint attention weights between ; (5-6) Determine the attention weight matrix for causal constraints The Middle The sensor group and the first Average causal constraint attention weights among sensor groups Does the edge value exceed the preset threshold? And in the current causal graph, from the sensor group Pointing sensor group Causal weight of causal edges Is it less than or equal to the preset causal weight threshold? If so, then the causal weights will be adjusted. Update to the average causal constraint attention weight Then proceed to step (5-7); otherwise, proceed directly to step (5-7); where a threshold is added to the edge. Causal weight threshold ; (5-7) Determine the attention weight matrix for causal constraints The Middle The sensor group and the first Average causal constraint attention weights among sensor groups Is it less than the preset edge deletion threshold? And in the current causal graph, from the sensor group Pointing sensor group Causal weight of causal edges Is it greater than the causal weight threshold? If so, then the causal weights will be adjusted. Set it to 0, then proceed to step (5-8); otherwise, proceed directly to step (5-8); where the threshold for deletion is... ; (5-8) Settings And return to step (5-4); (5-9) Settings And return to step (5-2); (5-10) The edge strength of the current causal graph is updated using the exponential moving average (EMA) method to obtain the causal graph with updated edge strength. (5-11) The Kahn algorithm based on topological sorting is used to verify the acyclicity of the causal graph after edge strength update obtained in step (5-10) in order to obtain the optimized causal graph. (5-12) Based on the optimized causal graph obtained in step (5-11) and the average causal constraint attention weight obtained in step (5-5), obtain the coupling consistency loss. : ; in, As an indicator function, when the causal weights The value is 1 if the condition is met, and 0 otherwise. (5-13) The causal discovery loss in the optimization objective function of the causal discovery loss obtained in step (2-1) The loss of cross-granularity consistency constraints obtained in steps (1-5) and the coupling consistency loss obtained in step (5-12). Obtain the overall optimization objective function: ; in Let the loss be the cross-entropy loss, and we have: ; in, Indicates the first The measured value of the industrial equipment to be diagnosed at the sampling time belongs to the first... The true label of the class, Indicates the first The measured value of the industrial equipment to be diagnosed at the sampling time belongs to the first... The probability of a class; , , , Index for fault categories.
10. The method for extracting key fault factors based on multi-granularity causal perception attention according to claim 9, characterized in that, Step (6) includes the following sub-steps: (6-1) Obtain the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (1) based on the causal constraint attention weight matrix obtained in step (3); ; (6-2) Based on the multi-granularity feature representation space obtained in step (1) and the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (6-1), obtain the cross-granularity consistency score of the fine-grained feature. (6-2-1) Based on the attention importance values of all fine-grained features in the fine-grained feature matrix obtained in step (6-1), sort all fine-grained features from high to low to obtain the fine-grained ranking results. ; (6-2-2) Obtain the first fine-grained feature matrix obtained in step (1) The sensor group to which the fine-grained features belong The average attention importance, i.e., the arithmetic mean of the attention importance values of all fine-grained features within the sensor set, is calculated for the sensor set. All sensor groups were sorted from highest to lowest according to their average attention importance to obtain a medium-granularity ranking result. ; (6-2-3) The fine-grained feature matrix obtained in step (1) is the first... The sensor group to which the fine-grained features belong The average attention importance of the domain, i.e., the arithmetic mean of the average attention importance of all sensor groups within that domain, is the same as the average attention importance of all sensor groups within the industrial equipment to be diagnosed. Each domain is ranked from highest to lowest according to its average attention importance to obtain a coarse-grained ranking result. ; (6-2-4) Based on the fine-grained ranking results obtained in step (6-2-1) The medium-grained ranking results obtained in step (6-2-2) and the coarse-grained ranking results obtained in step (6-2-3). Obtain the set of consistency scores across granularity : ; in This indicates the first in the fine-grained ranking results. One element, Indicates the ranking results of medium-grained particles The first in One element, Indicates coarse-grained ranking results The first in One element, Represents the variance function; (6-3) Perform min-max normalization on the causal contribution of each fine-grained feature in the causal constraint attention weight matrix obtained in step (4), the attention importance value of each fine-grained feature in the fine-grained feature matrix obtained in step (6-1), and each cross-granularity consistency score in the cross-granularity consistency score set obtained in step (6-2), to obtain the 1st... The data includes the normalized causal contribution, the normalized attention importance value, and the normalized cross-granularity consistency score corresponding to each fine-grained feature. ; ; ; in , and Respectively represent all The operation of finding the minimum and maximum values on each fine-grained feature; Min-Max Normalization maps all three metrics to The interval eliminates the difference in dimensions, making the subsequent weighted summation comparable; (6-4) Based on the measurement matrix obtained in step (1-1), the optimized causal graph obtained in step (5-11), and the causal constraint attention weight matrix obtained in step (3-4), obtain the adaptive weight coefficients. : ; in , , , All four are learnable parameters, and R represents the real number field. Denotes the dimension of the joint feature vector, and has , Represents the dimension of the hidden layer, and has , Let represent the feature vector of the attention distribution, and we have: ; in This represents the matrix of measurement values obtained from step (1-1). Any extracted measurement value, This represents any feature vector of the causal graph extracted from the optimized causal graph obtained in step (5-11). This represents the causal constraint attention weight matrix obtained from step (3-4). Extract any causal constraint attention weight; (6-5) The first step obtained in step (6-3) The normalized causal contribution, normalized attention importance, and normalized cross-granularity consistency scores corresponding to each fine-grained feature are weighted and summed with the adaptive weight coefficients obtained in step (6-4) to obtain the result. Key factor scores for fine-grained features : ; (6-6) Sort the fault critical factor scores of all fine-grained features obtained in step (6-5) in descending order to obtain a fault critical factor ranking list, and output the fault critical factor ranking list to the maintenance personnel of the industrial equipment to be diagnosed.
