Fault diagnosis method and device based on directed acyclic graph, equipment and medium

By using a fault diagnosis method based on directed acyclic graphs, an embedding sequence is generated by an encoder and a neural network, and the probabilistic adjacency matrix is ​​optimized by reinforcement learning. This solves the problems of high latency and high energy consumption in fault diagnosis of mechanical equipment, and achieves efficient and real-time fault diagnosis.

CN117666528BActive Publication Date: 2026-04-14NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing fault diagnosis methods in mechanical equipment suffer from high diagnostic latency, high energy consumption, and poor real-time performance, making it difficult to meet the needs of intelligent manufacturing scenarios.

Method used

A fault diagnosis method based on directed acyclic graphs is adopted. By acquiring observation data of equipment operation, an encoder is used to generate an embedding sequence, a multilayer perceptron learns a local stochastic policy, a neural network determines the probability adjacency matrix, and a directed acyclic graph is constructed for fault diagnosis by combining reinforcement learning and policy gradient optimization.

Benefits of technology

It improves the accuracy and efficiency of fault diagnosis, reduces energy consumption, enhances the stability and real-time performance of diagnosis, and has good generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117666528B_ABST
    Figure CN117666528B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of fault diagnosis, and relates to a fault diagnosis method, device, equipment and medium based on a directed acyclic graph. The method comprises the following steps: acquiring observation data of equipment operation, wherein the observation data comprises a plurality of random variables; reading the observation data by using an encoder and generating an embedding sequence of each random variable; learning a local random strategy of each random variable by using a multilayer perceptron according to the embedding sequence, and judging a probability that each random variable in the observation data is a parent variable by using a neural network to obtain a probability adjacency matrix; performing Bernoulli sampling and obtaining a graph matrix according to the probability adjacency matrix; calculating a score function of the graph matrix according to the observation data; when the neural network converges, obtaining a directed acyclic graph that maximizes the score function by using reinforcement learning according to the probability adjacency matrix; and performing fault diagnosis in the equipment operation process according to the directed acyclic graph. The application can improve the precision and efficiency of fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of fault diagnosis technology, and in particular to a fault diagnosis method, apparatus, device and medium based on directed acyclic graphs. Background Technology

[0002] According to my country's current industrial classification, industry consists of manufacturing, mining, and the production and supply of electricity, gas, and water. Manufacturing is the core of industry, as all material products needed for people's survival and development come from manufacturing. Manufacturing plays a crucial role in the economic growth of all industrialized countries, and its scale and level are important indicators of a nation's comprehensive national strength. The development of manufacturing is the foundation of my country's economic restructuring (industrialization), and it is also a pillar industry and the leading sector of my country's national economy, occupying a vital position in my country's socio-economic development.

[0003] In manufacturing, machinery plays a crucial role. Failures in machinery, or in complex, precision components within it, can severely disrupt normal operations, leading to production interruptions and even significant losses. Therefore, predictive diagnostics of machinery failures for early prevention are a vital issue for the development of the manufacturing industry.

[0004] Meanwhile, manufacturing is the carrier of the knowledge economy, and high-tech industries are inseparable from manufacturing. With the development of high-tech industries, artificial intelligence, the Internet of Things, and industrial internet technologies are constantly emerging, and manufacturing is gradually moving towards digitalization and intelligence. Mechanical equipment is also developing towards increasing complexity and integration. On the one hand, this greatly improves system performance, making system functions increasingly powerful; on the other hand, due to the increasing complexity of technology and structure, uncertainties and uncertain information abound, and the probability of system failure also increases significantly, shifting from single failures to multiple concurrent failures. Therefore, fault diagnosis of mechanical equipment or systems is also constantly evolving.

[0005] Existing fault diagnosis methods include: non-destructive testing technology, oil analysis technology, temperature detection technology, etc.

[0006] However, the aforementioned fault diagnosis methods have high diagnostic latency and energy consumption, poor real-time performance, which directly affects the efficiency and safety of actual production. They are difficult to meet the needs of the rapidly developing high-tech industry, and are unable to provide high-quality diagnostic services to meet the needs of intelligent manufacturing scenarios. Summary of the Invention

[0007] Therefore, it is necessary to provide a fault diagnosis method, device, equipment, and medium based on directed acyclic graphs to address the above-mentioned technical problems. This method can improve the accuracy and efficiency of fault diagnosis, provide good stability and real-time performance, and reduce energy consumption.

[0008] Fault diagnosis methods based on directed acyclic graphs include:

[0009] Acquire observation data of device operation, the observation data including multiple random variables;

[0010] The observation data is read using an encoder, and an embedding sequence for each random variable is generated. Based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thus obtaining a probability adjacency matrix.

[0011] Bernoulli sampling is performed, and the graph matrix is ​​obtained based on the probability adjacency matrix.

[0012] Based on the observed data, calculate the scoring function of the graph matrix;

[0013] When the neural network converges, reinforcement learning is used to obtain a directed acyclic graph that maximizes the score function based on the probability adjacency matrix; fault diagnosis is then performed during equipment operation based on the directed acyclic graph.

[0014] In one embodiment, it also includes:

[0015] When the neural network fails to converge, the policy gradient is used to update the probability adjacency matrix according to the scoring function to obtain an optimized probability adjacency matrix.

[0016] Bernoulli sampling is performed again, and the optimized graph matrix is ​​obtained based on the optimized probabilistic adjacency matrix.

[0017] The score function of the optimized graph matrix is ​​recalculated based on the observed data until the neural network converges.

[0018] In one embodiment, an encoder reads the observation data and generates an embedding sequence for each random variable; based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, resulting in a probability adjacency matrix, including:

[0019] The observed data are denoted as D and D∈R n×d R is a random variable X = {X1, ..., Xn} that is independent and identically distributed. d A data matrix composed of}

[0020] The observed data D is read using an encoder, and sampled data D' is generated, where D'∈R. n'×d The encoder reads the sampled data D' and generates an embedding sequence E for each random variable, where E ∈ R. h×dWhere h represents the number of hidden layers, E i ∈R h×1 Represents random variable X i Embedding;

[0021] Based on the embedded sequence, a multilayer perceptron (MLP) is used to learn each random variable X. i Local stochastic strategy:

[0022]

[0023] In the formula, p(.|X i For each random variable X i Local random strategy, For the output layer neural network, MLP 2 For intermediate layer neural networks, MLP 1 For the input layer neural network, W represents the weights of the output layer neurons. 2 W represents the weights of the intermediate layer neurons. 1 These are the weights of the input layer neurons;

[0024] The neural network is used to determine each random variable X in the observed data. i It is the parent variable Π i From the probabilities, we obtain the probability adjacency matrix:

[0025]

[0026] In the formula, p(.|X) is the probability adjacency matrix, p ij X ∈[0,1] j →X i The transition probability.

[0027] In one embodiment, calculating the score function of the graph matrix based on the observed data includes:

[0028] The observed data are denoted as D and D∈R n×d R is a random variable X = {X1, ..., Xn} that is independent and identically distributed. d A data matrix composed of}

[0029] Calculate the BDeu score function:

[0030]

[0031] In the formula, S BDeu (G;D) is the BDeu scoring function, rΠ i For Π i The number of possible instantiations, Π x For X i The parent set G, αijk Let n be the hyperparameter of the Dirichlet distribution. ijk For D to contain x ik and Π ij The number of elements, r i For X i The number of categories, α * Parameters for equivalent samples;

[0032] Calculate the BIC score function:

[0033]

[0034] In the formula, S BIC (G;D) is the BIC score function, P(X) i |Π i ) represents the conditional posterior probability. For hyperparameters;

[0035] Calculate the score function of the graph matrix based on the BDeu score function and the BIC score function:

[0036]

[0037] In the formula, S(G;D) is the scoring function of the graph matrix, S(G i ;D) is S BDeu (G;D) or S BIC (G;D).

[0038] In one embodiment, when the neural network fails to converge, a policy gradient is used to update the probability adjacency matrix according to the scoring function to obtain an optimized probability adjacency matrix, including:

[0039]

[0040] In the formula, To optimize the probabilistic adjacency matrix, Let be the expected value of the probability distribution, and b be the baseline independent of policy π. The gradient is the probability transition.

[0041] In one embodiment, when using a multilayer perceptron to learn the local stochastic policy for each random variable, a masking rule is used for acyclic constraints:

[0042] Construct a binary mask adjacency matrix M∈(0,1) d×d , of which M ij =1 means that variable X j Not variable X i The latent parent variable, and vice versa, is constrained for each random variable X by storing its descendants in the previous step. iPotential parent variable Π i This ensures that each random variable in a DAG cannot choose its parent from its descendants.

[0043] In one embodiment, when using a multilayer perceptron to learn a local stochastic policy for each random variable, a loss function is used for acyclic constraints:

[0044] Based on the smoothing equality constraint function, i.e., the non-negative weighting matrix P∈(0,1) d×d A directed acyclic graph is a graph if and only if:

[0045] h(P) = trace(e) P )-d=0

[0046]

[0047] In the formula, h(P) is the loss function, I is the identity matrix, and P k Let k be the probability matrix raised to the power of k, and k! be the factorial of k.

[0048] A fault diagnosis device based on a directed acyclic graph includes:

[0049] The acquisition module is used to acquire observation data of the device operation, and the observation data includes multiple random variables;

[0050] The encoding module is used to read the observation data using an encoder and generate an embedding sequence for each random variable; based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thereby obtaining a probability adjacency matrix.

[0051] The sampling module is used to perform Bernoulli sampling and obtain the graph matrix based on the probability adjacency matrix;

[0052] The calculation module is used to calculate the score function of the graph matrix based on the observed data;

[0053] The diagnostic module is used to obtain a directed acyclic graph that maximizes the score function by using reinforcement learning based on the probability adjacency matrix when the neural network converges; and to perform fault diagnosis during equipment operation based on the directed acyclic graph.

[0054] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0055] Acquire observation data of device operation, the observation data including multiple random variables;

[0056] The observation data is read using an encoder, and an embedding sequence for each random variable is generated. Based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thus obtaining a probability adjacency matrix.

[0057] Bernoulli sampling is performed, and the graph matrix is ​​obtained based on the probability adjacency matrix.

[0058] Based on the observed data, calculate the scoring function of the graph matrix;

[0059] When the neural network converges, reinforcement learning is used to obtain a directed acyclic graph that maximizes the score function based on the probability adjacency matrix; fault diagnosis is then performed during equipment operation based on the directed acyclic graph.

[0060] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0061] Acquire observation data of device operation, the observation data including multiple random variables;

[0062] The observation data is read using an encoder, and an embedding sequence for each random variable is generated. Based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thus obtaining a probability adjacency matrix.

[0063] Bernoulli sampling is performed, and the graph matrix is ​​obtained based on the probability adjacency matrix.

[0064] Based on the observed data, calculate the scoring function of the graph matrix;

[0065] When the neural network converges, reinforcement learning is used to obtain a directed acyclic graph that maximizes the score function based on the probability adjacency matrix; fault diagnosis is then performed during equipment operation based on the directed acyclic graph.

[0066] The aforementioned fault diagnosis methods, devices, equipment, and media based on directed acyclic graphs (DAGs) utilize a score-based reinforcement learning model for DAG structure learning, which is simple and effective. A decomposable score function S(G;D)=∑S(G) is used. iD) As a reward for RL, to reduce the policy space and improve search capability, the problem is then transformed from searching for the best graph to searching for the most likely parent set for each variable. The reinforcement learning model uses a predefined score function as the reward signal (with the flexibility to quickly converge to large datasets by pre-training on small datasets), models the score function as the reward mechanism in reinforcement learning, and optimizes the parameters of the NN through the policy gradient method, so that SR-DAG can handle all decomposable score functions without worrying about the smoothness of the score function; it improves search capability by decomposing the original problem, consumes less time than other neural network models by decomposing the search space, and the property of learning the policy by searching for high scores allows SR-DAG to be trained on a pre-trained model with the same variables, showing excellent score-based search capability. Based on the reinforcement learning model (RL), the traditional score-based search process is transferred to the neural network model to construct the directed acyclic graph (SR-DAG), decomposes the graph search task into the search parent of each variable to find the best score based on NN and RL, thereby capturing the optimal solution from complex distributed data and a large policy space (the policy space represents the possible parent set of each variable), improving search capability. Furthermore, simpler constraints were constructed to enforce non-cyclicity. Two methods for applying non-cyclic constraints were considered: the first enforces non-cyclicity by constraining the participants' outputs, and the second introduces a smoothing function h(P) = trace(e). P )-d is the loss function to ensure non-cyclicity; unlike previous NN models that used penalty terms for non-cyclic constraints, the output of SR-DAG is not affected by the penalty parameter. This application outperforms other NN models on both synthetic and standard datasets, demonstrating excellent generalization ability. Attached Figure Description

[0067] Figure 1 This is an application scenario diagram of a fault diagnosis method based on a directed acyclic graph in one embodiment;

[0068] Figure 2 This is a flowchart illustrating a fault diagnosis method based on a directed acyclic graph in one embodiment.

[0069] Figure 3 This is a schematic diagram of the architecture of a fault diagnosis method based on a directed acyclic graph in one embodiment;

[0070] Figure 4 This is a structural block diagram of a fault diagnosis device based on a directed acyclic graph in one embodiment;

[0071] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0072] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0073] It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly.

[0074] Furthermore, the use of terms such as "first" and "second" in this application is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of those features. In the description of this application, "multiple sets" means at least two sets, such as two sets, three sets, etc., unless otherwise explicitly specified.

[0075] In this application, unless otherwise expressly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection, an electrical connection, a physical connection, or a wireless communication connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two elements or the interaction between two elements, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0076] Furthermore, the technical solutions of the various embodiments of this application can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by this application.

[0077] The method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 may be a server corresponding to various portal websites or work system backends.

[0078] This application provides a fault diagnosis method based on directed acyclic graphs, such as... Figure 2 As shown, in one embodiment, the method is applied to Figure 1 Taking the terminal in the example, the explanation includes:

[0079] Step 202: Obtain observation data of device operation, the observation data including multiple random variables.

[0080] In this step, the observed data of the device operation includes multiple processes such as log printing, information transmission, core functional modules, and error reporting modules. Different processes are interconnected (i.e., fault relationships). By observing the status of related processes, the actual cause of the device's abnormality can be located.

[0081] Observational data refers to data obtained by observing fault-related processes during equipment operation. Observational data is discrete and can be obtained by sampling fault-related processes during equipment operation.

[0082] A directed acyclic graph (DAG) is a graph that extracts and models entities from different processes of device operation. At the same time, entities correspond to different times or periods of observation data. In other words, different processes of device operation (different times or periods of observation data) correspond to different nodes of the DAG, and the coupling relationships between the processes of device operation correspond to the edges of the DAG.

[0083] Step 204: The encoder reads the observation data and generates an embedding sequence for each random variable; based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thus obtaining a probability adjacency matrix.

[0084] Specifically:

[0085] The observed data are denoted as D and D∈R n×d R is a random variable X = {X1, ..., Xn} that is independent and identically distributed. d A data matrix composed of}

[0086] The observed data D is read using an encoder, and sampled data D' is generated, where D'∈R. n'×d The encoder reads the sampled data D' and transforms it to generate an embedding sequence E for each random variable, where E∈R. h×d Where h represents the number of hidden layers, and each E i ∈R h×1 Represents random variable X i Embedding;

[0087] Based on the embedded sequence, a multilayer perceptron (MLP) is used to learn each random variable X. iLocal stochastic strategy (considering each random variable X individually) i and its parent variable Π i Different MLPs are used to learn the parent variables of each random variable separately to simplify the policy space. Each MLP is defined by E. i The input is the i-th output of the encoder, and the output is p(.|X). i )∈R d That is, variable X i (d-dimensional probability vector):

[0088]

[0089] E = MLP 2 (MLP 1 (D',W 1 ),W 2 )

[0090] In the formula, p(.|X i For each random variable X i Local random strategy, For the output layer neural network, MLP 2 For intermediate layer neural networks, MLP 1 For the input layer neural network, W represents the weights of the output layer neurons. 2 W represents the weights of the intermediate layer neurons. 1 These are the weights of the input layer neurons;

[0091] Given each random variable X i And its possible parent sets, assigning high probability to parent sets with high local scores and low probability to parent sets with low local scores; using a neural network to determine each random variable X in the observed data. i It is the parent variable (parent set) Π i Given the probability, the random policy p(.|X) can be represented as a probability adjacency matrix:

[0092]

[0093] In the formula, p(.|X) is the probability adjacency matrix, p ij X ∈[0,1] j →X i The transition probability.

[0094] In this step, a stochastic policy p(.|X) is learned, and based on the obtained probability adjacency matrix, each variable X can be inferred. j It is a random variable X i The parent variable Π i The probability p(.|X) i )={p i1,…,p id In other words, by learning each variable X j It is a random variable X i We learn a DAG by using the probabilities of the parent variables to find the probability of each variable X. i The parent set of G has the maximum local score S(G) i ;D), where G i It is by X i and its father set Π i The resulting local graph is ultimately a binary adjacency matrix G, calculated based on each element p in the probability adjacency matrix p(.|X) representing the probability of the variable. ij Bernoulli sampling is performed to obtain the final graph structure.

[0095] It should be noted that when using a multilayer perceptron to learn the local stochastic strategy for each random variable, a masking rule or loss function is used to impose acyclic constraints on the DAG. The above two acyclic constraint solutions are used to ensure that the DAG is generated in the graph generation model.

[0096] Specifically:

[0097] 1) Introduce masking rules to achieve acyclic constraints in the graph generation model:

[0098] Based on the intuitive acyclic property—that is, for each variable in a DAG, its parent cannot be chosen from its descendants (i.e., a variable's descendant cannot be its parent)—this acyclic rule guarantees acyclicity. A binary mask adjacency matrix M∈(0,1) is constructed. d×d , of which M ij =1 means that variable X j Not variable X i The latent parent variable, and vice versa, is constrained in the graph generation model for each random variable X by storing its descendants in the previous step. i Potential parent variable Π i This ensures that each random variable in the DAG cannot choose its parent from its descendants, allowing the optimization process to focus on searching for the highest-scoring function without considering acyclicity.

[0099] The specific algorithm process is as follows:

[0100]

[0101] 2) As the number of variables increases, the mask-based acyclic constraints introduce uncertainty into the policy space, making convergence difficult. Therefore, a smooth equality constraint is used as the loss function for acyclic constraints:

[0102] Based on the smoothing equality constraint function, i.e., the non-negative weighting matrix P∈(0,1) d×d A directed acyclic graph is a graph if and only if:

[0103] h(P) = trace(e) P )-d=0

[0104]

[0105] In the formula, h(P) is the loss function, I is the identity matrix, and P k Let k be the probability matrix raised to the power of k, and k! be the factorial of k.

[0106] It should be noted that P is the probability adjacency matrix of the random policy p(.|X), which is output by the DAG generation model in this step; essentially, it boils down to trace(P) k ) Calculate the number of closed cycles of length k in a directed graph, while an acyclic graph should have a trace(P) for all k = 1, ..., ∞. k Since ) = 0, h(P) can be used as a loss function to ensure that the graph generation model is optimized towards an acyclic graph by optimizing the parameters of the NN, that is, to ensure that the output graph is acyclic.

[0107] Step 206: Perform Bernoulli sampling and obtain the graph matrix based on the probability adjacency matrix.

[0108] In this step, how to perform Bernoulli sampling and how to obtain the graph matrix from the probability adjacency matrix are existing technologies and will not be described in detail here.

[0109] Step 208: Calculate the scoring function of the graph matrix based on the observed data.

[0110] Specifically:

[0111] The observed data are denoted as D and D∈R n×d R is a random variable X = {X1, ..., Xn} that is independent and identically distributed. d A data matrix composed of}

[0112] Calculate the BDeu score function to measure the posterior probability of G given the observed data D:

[0113]

[0114]

[0115] In the formula, S BDeu (G;D) is the BDeu scoring function. For Π i The number of possible instantiations, Π i For X i The parent set G, α ijk Let n be the hyperparameter of the Dirichlet distribution. ijkFor D to contain x ik and Π ij The number of elements, r i For X i The number of categories, α * Parameters for equivalent samples;

[0116] The BIC score function is calculated; BIC stands for Bayesian Information Criterion, which provides a simple approximation that does not depend on any hyperparameters.

[0117]

[0118] In the formula, S BIC (G;D) is the BIC score function, P(X) i |Π i ) represents the conditional posterior probability. For hyperparameters;

[0119] Based on the BDeu scoring function and the BIC scoring function (both decomposable and the total score is the sum of local scores), calculate the scoring function of the graph matrix:

[0120]

[0121] In the formula, S(G;D) is the scoring function of the graph matrix, S(G i ;D) is S BDeu (G;D) or S BIC (G;D).

[0122] In this step, given the observed data, the highest-scoring graph is searched from all potential directed graphs, where the score is calculated by a function S(G;D) based on the observed data and the graph itself. DAG structure learning is performed based on the score function (popular score functions include BDeu, BGe, BIC, and MDL, with BDeu and BIC used as examples here). The score function measures how well the data matches the candidate structure, essentially making it a combinatorial optimization problem. Structure learning of directed acyclic graphs (DAGs) is fundamental to causal discovery. Learning DAGs directly from data is challenging because the graph space grows exponentially with the number of variables; therefore, this learning task is modeled as a combinatorial optimization problem, and finding the DAG that maximizes the structure score demonstrates how well it fits the data.

[0123] For combinatorial optimization problems, existing algorithms include: exact algorithms capable of finding optimal solutions with additional constraints, approximate algorithms applicable to a wider range of categories but not guaranteeing optimality, and continuous optimization methods. Research on exact algorithms is limited to relatively small problems because computational and memory requirements grow exponentially with the number of variables; in particular, GOBNILP has been shown to handle problems with up to several hundred variables, but it assumes an upper bound on the parent node set for each variable is a small constant. Approximate algorithms are based on local or stochastic searches, such as greedy search, simulated annealing, coordinate descent, and genetic algorithms. For practical problems exceeding small node sizes, these methods often require additional structural assumptions. Continuous optimization methods transform traditional combinatorial optimization problems into continuous procedures; this approach is a breakthrough but is only applicable to linear structural equation models (SEM). Additionally, there are neural network (NN) methods. GraN-DAG extends the framework to handle nonlinear relationships between variables by employing negative log-likelihood as the loss function, while DAG-GNN develops a deep generative model that captures complex data distributions through a novel graph NN architecture; however, the loss function in these methods must be carefully chosen for application to continuous optimization methods.

[0124] In this application, the observed data D is a known quantity, and the search aims to find the optimal DAG that maximizes the fractional function S(G;D):

[0125] maxS(G;D),subject toG∈DAGs

[0126] It should be noted that each element depends only on each variable X in the DAG. i The father set Π i The choice of the optimal DAG simplifies the problem from searching for the best DAG to finding the parent set for each variable.

[0127] Step 210: When the neural network converges, reinforcement learning is used to obtain a directed acyclic graph that maximizes the score function based on the probability adjacency matrix; fault diagnosis is performed during equipment operation based on the directed acyclic graph.

[0128] In this step, when the neural network fails to converge, the policy gradient is used to update the probabilistic adjacency matrix according to the scoring function to obtain an optimized probabilistic adjacency matrix; Bernoulli sampling is performed again, and an optimized graph matrix is ​​obtained according to the optimized probabilistic adjacency matrix; the scoring function of the optimized graph matrix is ​​recalculated according to the observed data until the neural network converges.

[0129] It should be noted that the final directed acyclic graph learned contains the fault relationships in equipment operation, which is used for fault diagnosis during equipment operation.

[0130] Specifically:

[0131] To train a DAG generation model, reinforcement learning (RL) is used to search the policy space based on optimal scores to find the optimal DAG. RL provides a suitable paradigm for training neural networks to learn DAG structures, especially since it allows for flexible scoring functions regardless of their smoothness. The training objective is a graph with expected scores, given an input dataset D, defined as:

[0132]

[0133] In the formula, θ represents the parameters of the DAG generation model optimized by policy-based RL, and G is the probability adjacency matrix p θ (.|X) sampled graph;

[0134] During training, the stochastic policy p(.|X) learns each variable X. i Let's learn the locally stochastic policy p(.|X i Furthermore, the overall training objective can be decomposed into learning each X... i The optimal local score of the local graph consisting of the set of variables and its parent variables:

[0135]

[0136] The REINFORCE gradient optimization method is used, employing policy gradient and stochastic gradient descent (for learning X). j →X i We use the probability of θ to optimize the parameter, and obtain the optimized probability adjacency matrix:

[0137]

[0138] In the formula, To optimize the probabilistic adjacency matrix, Let be the expected value of the probability distribution, and b be the baseline independent of policy π. The gradient is the probability transition.

[0139] A good baseline can reduce gradient variance and improve learning speed. The goal of the baseline is to estimate the advantage of the chosen policy π, therefore, b is defined as the best score S during training. max (G' i |D). With such a baseline, if strategy π is better than before, then the function -(S(G) i |D)-S max (G' i A negative |D)) results in an amplified action, and vice versa. Similar to AlphaGo, this approach ensures that the best model is always challenged. Based on this, Adam is used as the optimizer, and the specific algorithm process is as follows:

[0140]

[0141] It should also be noted that when using an acyclic constraint scheme with a loss function, the training objective considers both the score function S(G|D) and the acyclic constraint function h(P):

[0142]

[0143] In this embodiment, training a DAG generation model using RL requires multiple iterations. The model can be further trained on a converged model trained on a small dataset, thus converging faster on a large dataset. Furthermore, the model's generalization depends on the distribution of the training data; SR-DAG can converge quickly on the same set of variables. In contrast, in existing technologies, RL models for DAG structure learning are highly sensitive to the size of the input data, requiring retraining each time the dataset size changes.

[0144] like Figure 3 The SR-DAG architecture shown in the diagram teaches the actor to learn the policy from the dataset using a multilayer perceptron (MLP) and then enforces non-recurrence using a probability matrix.

[0145] The aforementioned fault diagnosis method based on directed acyclic graphs (DAGs) uses a score-based reinforcement learning model for DAG structure learning, which is simple and effective. It employs a decomposable score function S(G;D)=∑S(G) iD) is used as a reward for RL to reduce the policy space and improve search capability. The problem then changes from searching for the optimal graph to searching for the most likely parent set for each variable. The reinforcement learning model uses a predefined score function as the reward signal (which has the flexibility to converge quickly to a large dataset by pre-training on a small dataset). The score function is modeled as the reward mechanism in reinforcement learning, and the parameters of the NN are optimized through the policy gradient method, so that SR-DAG can handle all decomposable score functions without worrying about the smoothness of the score function. The search capability is improved by decomposing the original problem, and the search space decomposition takes less time than other neural network models. The characteristic of learning the policy by searching for high scores allows SR-DAG to be trained on a pre-trained model with the same variables, showing excellent score-based search capability, with improvements in both accuracy and efficiency. This approach leverages reinforcement learning (RL) to transfer the traditional score-based search process to a neural network model, constructing a directed acyclic graph (SR-DAG). The graph search task is decomposed into search parents for each variable to find the optimal score based on both NN and RL. This improves search capability by capturing optimal solutions from complex data distributions and large policy spaces (representing the possible parent set of each variable). Furthermore, simpler constraints are constructed to enforce non-cyclicity. Two methods for applying non-cyclic constraints are considered: the first enforces non-cyclicity by constraining the participant's output, and the second introduces a smoothing function h(P) = trace(e...). P )-d is the loss function to ensure non-cyclicity; unlike previous NN models that used penalty terms for non-cyclic constraints, the output of SR-DAG is not affected by the penalty parameter. This application outperforms other NN models on both synthetic and standard datasets, demonstrating excellent generalization ability.

[0146] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0147] In one specific embodiment, experiments were conducted to study the performance of SR-DAG.

[0148] SR-DAG on synthetic and standard datasets is compared with various baselines, including recent neural network models such as RL-BIC, DAG-GNN, GraN-DAG, and the gradient-based method NOTEARS, as well as the state-of-the-art DAG exact solver GOBNILP. Traditional structure learning algorithms such as PC, MMHC, and GES are ignored because the state-of-the-art exact DAG solver GOBNILP outperforms other traditional algorithms. All algorithms were run using the publicly available code on the respective authors' websites, and the default parameters of these algorithms were used in the experiments unless otherwise stated.

[0149] To evaluate the performance of SR-DAG, the results are first compared with other neural network models, and then the scores returned by the method in this application are compared with the exact solver GOBNILP to further estimate the search capability. Part 1 demonstrates the capability of SR-DAG on synthetic datasets, including discrete and continuous data; Part 2 applies SR-DAG to two discrete benchmark datasets: Asia and Sachs.

[0150] The experiments were implemented using PyTorch. In all experiments, an MLP with a batch size of 10 and a hidden dimension of 1024 was used, embedding the input data for each variable into a 1024-dimensional space. For synthetic datasets, the estimated DAG was evaluated on three metrics: BDeu (discrete dataset) score, BIC (discrete and continuous dataset) score, and the Hamming distance (SHD) of the structure. For standard datasets, three additional metrics were included: false discovery rate (FDR), true positive rate (TPR), and false positive rate (FPR) to directly measure the closeness between the ground truth graph and the learned graph.

[0151] 1. Synthetic dataset

[0152] Consider different data types varying along three dimensions: data generation process, number of variables, and number of edges. Specifically, a stochastic DAG is first generated using an ER model with the expected number of variables and edges, and then a dataset is generated according to a specific sampling scheme. The synthetic dataset is divided into three categories based on the generation process: discrete BN dataset, discrete linear binomial dataset, and continuous nonlinear Gaussian ANM dataset. Two schemes for constraining acyclicity are used on the synthetic dataset, denoted as SR-DAG (using a loss function to constrain acyclicity) and SR-DAG-mask (using a masking rule to constrain acyclicity). It should be noted that SR-DAG-mask is only used for small graphs because the uncertainty of its policy space makes it difficult to converge on large graphs (more than 40 variables).

[0153] 1) Discrete Bayesian Network Dataset

[0154] Given a random DAG generated from an ER model, assign random probability values ​​to each variable and its parent variable according to their BETA distributions to obtain a conditional probability distribution table (CPT). Given the CPT, sample a dataset from the joint distribution of the BN model. Based on the sampling process, generate a random dataset D∈R with the number of variables and edges (d,r)∈{(5,7),(16,40),(40,50)} and a sample size n=4096. n×d .

[0155] Table 1 shows the experimental results for the Discrete Bayesian Network (BN) dataset. Italics indicate the results of the exact global solver GOBNILP, and the best results other than GOBNILP are indicated in bold. "-" indicates that the model cannot handle this dataset.

[0156] Table 1

[0157]

[0158] As shown in Table 1, to evaluate the scores obtained by SR-DAG, the scores returned by the proposed method are first compared with those of the exact solver GOBNILP. The results show that although the proposed method cannot guarantee a globally optimal score, the scores obtained are very close to the values ​​of GOBNILP in many cases. Furthermore, SR-DAG and SR-DAG-mask are the best performing methods in all settings for BDeu scoring, BIC scoring, and SHD. The poor performance of NOTEARS can be explained by its inability to model nonlinear datasets. GraN-DAG's performance is similar to NOTEARS, which may be due to its modeling assumptions being unreasonable on synthetic discrete BN datasets. RL-BIC, RL-BIC2, and DAG-GNN outperform NOTEARS and GraN-DAG, but handling large graphs (more than 40 variables) is challenging for RL-BIC and RL-BIC2. Among the NN models considered, SR-DAG and SR-DAG-mask are the best performing on synthetic discrete BN datasets, indicating that the proposed method significantly improves search capabilities.

[0159] 2) Discrete linear datasets

[0160] Consider a discrete linear dataset and see if the SR-DAG remains competitive. The linear binomial dataset is derived from a binomial noise model X = W. T The samples are taken from X+z, where the weight matrix W represents uniformly random edge weights. Based on the sampling process, a random dataset D∈R is generated by generating a random dataset with the number of variables and edges (d,e)∈{(5,7),(16,40),(40,50)} and a sample size n=4096. n×d .

[0161] Table 2 shows the experimental results for a discrete linear dataset. Italics indicate the results of the exact global solver GOBNILP, and the best results other than GOBNILP are indicated in bold. "-" indicates that the model cannot handle this dataset.

[0162] Table 2

[0163]

[0164] As shown in Table 2, the BDeu and BIC scores of the proposed method remain outstanding on the linear binomial dataset. However, NOTEARS performs similarly to the proposed method in SHD, but performs poorly in terms of scores. This may be because the generation process of the linear binomial dataset shows that high BDeu or BIC scores do not always imply a better DAG, which also explains why GOBNILP performs poorly in SHD. Nevertheless, SR-DAG outperforms all other NN models (including the BIC-based methods RL-BIC and RL-BIC2) in both BDeu and BIC scores, demonstrating the powerful search capabilities of the proposed method.

[0165] 3) Continuous Gaussian dataset

[0166] Consider a continuous synthetic dataset, where the relationship f for each variable is... i It is a function sampled from a Gaussian process with a unit bandwidth RBF kernel. Setups also considered using GraN-DAG and RL-BIC: graphs with 10 and 20 variables, d and 4d edges.

[0167] Table 3 shows the experimental results for the continuous Gaussian dataset. Italics indicate the results of the exact global solver GOBNILP, and the best results other than GOBNILP are indicated in bold. "-" indicates that the model cannot handle this dataset.

[0168] Table 3

[0169]

[0170] As shown in Table 3, GOBNILP performs poorly on 4d edge graphs, which may be due to the fact that the parent set of the real graph is larger than the default setting (maximum of three parent sets). For the method in this application, it performs quite well, with the BIC score outperforming all other NN methods.

[0171] 4) Continue training

[0172] The advantage of this method is that the model can converge to a policy with high scores, rather than simply searching for the best score without convergence. This advantage is particularly competitive when learning from large datasets. To demonstrate this capability, a random dataset D∈R was constructed. n×d The number of variables is d∈{20,40,60,80} and the sample size is n=10000.

[0173] Table 4 shows SR-DAG-continue vs. SR-DAG.

[0174] Table 4

[0175]

[0176] Table 4 shows a comparison of the results of SR-DAG-continue (training based on a pre-trained model with a sample size of n=2000), SR-DAG (training based on the original settings), and the real graph. It is clear from Table 4 that pre-training reduces the number of iterations from thousands to hundreds.

[0177] 2. Standard Dataset

[0178] Experiments were conducted on two discrete benchmark datasets: Asia and Sachs, with a sample size of n = 4096. More detailed results regarding the experiments are reported: false discovery rate (FDR), true positive rate (TPR), and false positive rate (FPR) for a comprehensive evaluation of all the methods mentioned.

[0179] Table 5 shows the experimental results for the benchmark dataset. Italics indicate the results of the exact global solver GOBNILP, and the best results other than GOBNILP are indicated in bold. "-" indicates that the model cannot handle this dataset.

[0180] Table 5

[0181]

[0182] As shown in Table 5, SR-DAG performed excellently in all aspects for both Asia and Sachs. In Asia, SR-DAG achieved the same highest score as GOBNILP. Overall, the proposed method demonstrated competitive search capabilities for each task.

[0183] This application also provides a fault diagnosis device based on a directed acyclic graph, such as... Figure 4 As shown, in one embodiment, it includes: an acquisition module 402, an encoding module 404, a sampling module 406, a calculation module 408, and a diagnosis module 410, wherein:

[0184] The acquisition module 402 is used to acquire observation data of the device operation, the observation data including multiple random variables;

[0185] The encoding module 404 is used to read the observation data using an encoder and generate an embedding sequence for each random variable; based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thereby obtaining a probability adjacency matrix.

[0186] The sampling module 406 is used to perform Bernoulli sampling and obtain a graph matrix based on the probability adjacency matrix.

[0187] The calculation module 408 is used to calculate the score function of the graph matrix based on the observation data;

[0188] The diagnostic module 410 is used to obtain a directed acyclic graph that maximizes the score function by using reinforcement learning based on the probability adjacency matrix when the neural network converges; and to perform fault diagnosis during equipment operation based on the directed acyclic graph.

[0189] Specific limitations regarding the fault diagnosis device based on directed acyclic graphs can be found in the limitations of the fault diagnosis method based on directed acyclic graphs mentioned above, and will not be repeated here. Each module in the above device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0190] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a fault diagnosis method based on a directed acyclic graph. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0191] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0192] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.

[0193] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0194] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0195] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0196] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A fault diagnosis method based on directed acyclic graphs, characterized in that, include: Acquire observation data of device operation, the observation data including multiple random variables; The observation data is read using an encoder, and an embedding sequence for each random variable is generated. Based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thus obtaining a probability adjacency matrix. Bernoulli sampling is performed, and the graph matrix is ​​obtained based on the probability adjacency matrix. Based on the observed data, calculate the scoring function of the graph matrix; When the neural network converges, reinforcement learning is used to obtain a directed acyclic graph that maximizes the score function based on the probability adjacency matrix. Fault diagnosis is performed during equipment operation based on the directed acyclic graph. An encoder is used to read the observed data and generate an embedding sequence for each random variable. Based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observed data is a parent variable, resulting in a probability adjacency matrix, including: The observation data is denoted as and , For the reason n 10 independent and identically distributed random variables The data matrix formed; The observation data is read using an encoder. and generate sampling data. and The sampled data is read using an encoder. And generate the embedding sequence for each random variable. and ;in, Indicates the number of hidden layers. Represents random variables Embedding; Based on the embedded sequence, a multilayer perceptron (MLP) is used to learn each random variable. Local stochastic strategy: In the formula, For each random variable Local random strategy, For the output layer neural network, It is an intermediate layer neural network. For the input layer neural network, These are the weights of the output layer neurons. These are the weights of the intermediate layer neurons. These are the weights of the input layer neurons; The neural network is used to determine each random variable in the observed data. Parent variable From the probabilities, we obtain the probability adjacency matrix: In the formula, It is a probability adjacency matrix. for The transition probability; Based on the observed data, the scoring function of the graph matrix is ​​calculated, including: The observation data is denoted as and , For the reason n 10 independent and identically distributed random variables The data matrix formed; Calculate the BDeu score function: In the formula, For the BDeu scoring function, for The number of instantiations, for Father set , Let be the hyperparameters of the Dirichlet distribution. for It contains and The number of elements, for Number of categories, Parameters for equivalent samples; Calculate the BIC score function: In the formula, For BIC scoring function, For conditional posterior probability, For hyperparameters; Calculate the score function of the graph matrix based on the BDeu score function and the BIC score function: In the formula, The scoring function for the graph matrix. for or .

2. The fault diagnosis method based on directed acyclic graphs according to claim 1, characterized in that, Also includes: When the neural network fails to converge, the policy gradient is used to update the probability adjacency matrix according to the scoring function to obtain an optimized probability adjacency matrix. Bernoulli sampling is performed again, and the optimized graph matrix is ​​obtained based on the optimized probabilistic adjacency matrix. The score function of the optimized graph matrix is ​​recalculated based on the observed data until the neural network converges.

3. The fault diagnosis method based on directed acyclic graphs according to claim 2, characterized in that, When the neural network fails to converge, a policy gradient is applied to update the probability adjacency matrix according to the scoring function, resulting in an optimized probability adjacency matrix, including: In the formula, To optimize the probabilistic adjacency matrix, Let be the expected value of the probability distribution. To be independent of strategy The baseline, The gradient represents the probability transition.

4. The fault diagnosis method based on directed acyclic graphs according to any one of claims 1 to 3, characterized in that, When using a multilayer perceptron to learn the local stochastic policy for each random variable, a masking rule is used for acyclic constraints: Construct a binary mask adjacency matrix ,in, Meaning variables Not a variable The potential parent variable, and vice versa, constrain each random variable by storing its descendants in the previous step. Potential parent variable This ensures that each random variable in a DAG cannot choose its parent from its descendants.

5. The fault diagnosis method based on directed acyclic graphs according to any one of claims 1 to 3, characterized in that, When using a multilayer perceptron to learn the local stochastic policy for each random variable, a loss function is used for acyclic constraints: Based on the smoothing equality constraint function, i.e., the non-negative weighting matrix A directed acyclic graph is a graph if and only if: In the formula, For loss function, It is the identity matrix. For probability matrix k Power of 1 for k factorial.

6. A fault diagnosis device based on a directed acyclic graph, characterized in that, The fault diagnosis method based on directed acyclic graphs as described in any one of claims 1 to 5 includes: The acquisition module is used to acquire observation data of the device operation, and the observation data includes multiple random variables; The encoding module is used to read the observation data using an encoder and generate an embedding sequence for each random variable; based on the embedding sequence, a multilayer perceptron is used to learn the local stochastic strategy for each random variable, and a neural network is used to determine the probability that each random variable in the observation data is a parent variable, thereby obtaining a probability adjacency matrix. The sampling module is used to perform Bernoulli sampling and obtain the graph matrix based on the probability adjacency matrix; The calculation module is used to calculate the score function of the graph matrix based on the observed data; The diagnostic module is used to obtain a directed acyclic graph that maximizes the score function by using reinforcement learning based on the probability adjacency matrix when the neural network converges; and to perform fault diagnosis during equipment operation based on the directed acyclic graph.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Acquisition terminal fault prediction method and system based on Bayesian network optimization algorithm

    CN108320040A

  • Intelligent analysis method of fault mechanism based on Bayesian network and depth learning algorithm

    CN109063841A