




技术领域technical field
本发明涉及液体火箭发动机故障诊断技术领域,主要涉及一种液体火箭发动机稳态阶段的分层贝叶斯变分推理故障诊断方法。The invention relates to the technical field of fault diagnosis of liquid rocket engines, and mainly relates to a fault diagnosis method for hierarchical Bayesian variational reasoning in a steady state stage of a liquid rocket engine.
背景技术Background technique
火箭发动机作为运载火箭推进动力的核心,其运行的高可靠性是航天发射任务顺利进行的重要保障。液体火箭发动机是在极端物理条件下运行的复杂热力学系统,其发生故障具有极端的快速性,并会造成极大的破坏性。采取高可靠性的发动机故障诊断系统,可以对发动机工作过程中出现的故障予以警示和判断,并能及时采取有效的措施,保证液体火箭和载荷的安全,确保发射任务的顺利进行。As the core of the propulsion power of the launch vehicle, the high reliability of the rocket engine is an important guarantee for the smooth progress of the space launch mission. Liquid rocket engines are complex thermodynamic systems operating under extreme physical conditions, and their failures are extremely rapid and destructive. Adopting a high-reliability engine fault diagnosis system can warn and judge the faults that occur during the engine operation, and take effective measures in time to ensure the safety of the liquid rocket and the payload, and ensure the smooth progress of the launch mission.
稀疏数据场景下,传统的多项式-狄利克雷模型存在一定的分类精度问题,是由于多项式分布和狄利克雷分布的共轭性,参数估计非常有效,但是在一个节点上需要估计的条件分布的数量呈指数级大小,即使在具有中等规模变量的贝叶斯网络中,参数估计的精度也不高。通过马尔科夫链蒙特卡罗(MCMC)方法对模型优化,计算联合后验分布,在处理大型数据时,MCMC方法需要大量的计算时间。In the sparse data scenario, the traditional polynomial-Dirichlet model has a certain classification accuracy problem. Due to the conjugation of the polynomial distribution and the Dirichlet distribution, the parameter estimation is very effective, but the conditional distribution that needs to be estimated on a node The numbers are exponentially large, and even in Bayesian networks with moderately large variables, the accuracy of parameter estimates is not high. The model is optimized by the Markov Chain Monte Carlo (MCMC) method to calculate the joint posterior distribution. When dealing with large data, the MCMC method requires a lot of computational time.
发明内容SUMMARY OF THE INVENTION
发明目的:针对上述背景技术中存在的问题,本发明提供了一种液体火箭发动机稳态阶段的分层贝叶斯变分推理故障诊断方法,通过引入超先验,构建分层多项式-狄利克雷模型,用于贝叶斯网络的参数估计,显著提升参数估计的精度。同时引入变分推理算法用于分层多项式-狄利克雷模型的优化,计算联合后验分布,减少训练时间,提高参数估计的精度,大大提高液体火箭发动机稳态工作阶段故障诊断过程中的效率以及故障诊断的准确性。Purpose of the invention: In view of the problems existing in the above background technology, the present invention provides a hierarchical Bayesian variational inference fault diagnosis method in the steady-state stage of a liquid rocket engine. By introducing a super-prior, a hierarchical polynomial-Dirich Ray model, used for parameter estimation of Bayesian network, significantly improves the accuracy of parameter estimation. At the same time, the variational inference algorithm is introduced to optimize the hierarchical polynomial-Dirichlet model, calculate the joint posterior distribution, reduce the training time, improve the accuracy of parameter estimation, and greatly improve the efficiency of the fault diagnosis process of the liquid rocket engine in the steady working stage. and the accuracy of fault diagnosis.
技术方案:为实现上述目的,本发明采用的技术方案为:Technical scheme: In order to realize the above-mentioned purpose, the technical scheme adopted in the present invention is:
一种液体火箭发动机稳态阶段的分层贝叶斯变分推理故障诊断方法,包括以下步骤:A fault diagnosis method for hierarchical Bayesian variational reasoning in the steady-state stage of a liquid rocket engine, comprising the following steps:
步骤S1、根据液体火箭发动机稳态工作阶段选择故障类型和属性变量,使用最小描述长度离散化方法对连续型数值进行离散化处理,将非数值型数据转换为数值型,且数据样本不含缺失值;Step S1, select the fault type and attribute variable according to the steady-state working stage of the liquid rocket engine, use the minimum description length discretization method to discretize the continuous numerical value, convert the non-numerical data into numerical type, and the data samples do not contain missing data value;
步骤S2、构建液体火箭发动机TAN结构故障分类模型;Step S2, constructing a liquid rocket engine TAN structural fault classification model;
步骤S3、基于传统多项式-狄利克雷模型,建立分层多项式-狄利克雷模型,引入变分推理算法进一步优化,对液体火箭动机稳态工作状态故障进行分类;Step S3, establishing a hierarchical polynomial-Dirichlet model based on the traditional polynomial-Dirichlet model, introducing a variational inference algorithm for further optimization, and classifying the steady-state working state faults of the liquid rocket motor;
步骤S4、从液体火箭发动机故障样本中抽取若干个实例构成训练集,估计TAN网络的参数,另外抽取不包括训练集样本的测试集,对测试集进行故障分类。Step S4, extracting several instances from the liquid rocket engine fault samples to form a training set, estimating the parameters of the TAN network, and extracting a test set excluding the training set samples, and classifying the faults on the test set.
进一步地,所述步骤S2中构建TAN结构故障分类模型的具体方法包括:Further, the specific method for constructing the TAN structural fault classification model in the step S2 includes:
步骤S2.1、基于步骤S1选择的属性变量,计算条件互信息:Step S2.1, based on the attribute variable selected in step S1, calculate the conditional mutual information:
其中,Xi与Xj代表两种属性变量,,C代表数据集,这里指训练集。将步骤S1中选择的属性变量作为树的节点,将各属性变量间的条件互信息作为节点间的边的权重,构建最大生成树;Among them, Xi and Xj represent two attribute variables, and C represents the data set, here refers to the training set. The attribute variable selected in step S1 is used as the node of the tree, the conditional mutual information between each attribute variable is used as the weight of the edge between the nodes, and the maximum spanning tree is constructed;
步骤S2.2、设置每条边的方向,将最上层类节点插入生成树中,使类节点指向每个属性节点,由此构成TAN结构故障分类模型。Step S2.2: Set the direction of each edge, insert the top-level class node into the spanning tree, and make the class node point to each attribute node, thereby forming a TAN structure fault classification model.
进一步地,所述步骤S3具体包括:Further, the step S3 specifically includes:
步骤S3.1、建立分层多项式-狄利克雷模型如下:Step S3.1, establish a hierarchical polynomial-Dirichlet model as follows:
设定α是一个隐随机向量,服从狄利克雷先验:Let α be a latent random vector obeying the Dirichlet prior:
α|s,α0~s·Dirichlet(α0)α|s,α0 ~s·Dirichlet(α0 )
其中等效样本量s和参数向量α0是模型的超参量,且元素和满足:where the equivalent sample size s and the parameter vector α0 are the hyperparameters of the model, and the element sum satisfies:
θX|Y的先验是狄利克雷混合分布:The prior for θX|Y is a Dirichlet mixture distribution:
上式中先验值不能对y进行因式分解,不同的条件分布的参数不再是先验独立的;The prior value in the above formula cannot factorize y, and the parameters of different conditional distributions are no longer independent a priori;
步骤S3.2、基于变分推理算法进一步优化求解参数的联合后验分布;Step S3.2, further optimizing the joint posterior distribution of the solution parameters based on the variational inference algorithm;
由n个独立同分布的观测值(xk,yk)组成的数据集,其中k=1,...,n,则参数的后验分布是狄利克雷混合分布:A dataset consisting of n independent and identically distributed observations (xk , yk ), where k=1,...,n, then the posterior distribution of the parameters is a Dirichlet mixture:
根据α的后验期望定义上式的解;Posterior expectation according to α Define the solution of the above formula;
θx|y的后验均值为:The posterior mean of θx|y is:
其中nxy表示θx|y的估计量的充分统计值,即X=x和Y=y条件下的观测数,ny=∑x∈Xnxy表示变量Y的统计数。α的后验分布无法被解析地计算,表示如下:where nxy represents the sufficient statistics of the estimator of θx|y , that is, the number of observations under the conditions of X=x and Y=y, ny =∑x∈X nxy represents the statistics of the variable Y. The posterior distribution of α cannot be computed analytically and is expressed as follows:
采用变分推理算法进行快速求解θX|Y和α的后验分布;具体地,The variational inference algorithm is used to quickly solve the posterior distribution of θX|Y and α; specifically,
步骤S3.2.1、通过分解分布估算p(θX|Y,α|D)如下:Step S3.2.1, estimate p(θX|Y , α|D) by decomposing the distribution as follows:
其中,θX|y和α为独立的随机变量;当时,和且∑x∈χκx=1,为变分推理模型的参数,满足:Among them, θX|y and α are independent random variables; when hour, and And ∑x∈χ κx =1, is the parameter of the variational inference model, which satisfies:
α|s,τ,κ~s·Dirichlet(τκ)α|s,τ,κ~s·Dirichlet(τκ)
令q(θX|y)=q(θX|y|vy)且q(α)=q(α|τ,κ);联合变分分布q(θX|y,α)是变分参数τ,κ和vy的函数,其中Let q(θX|y )=q(θX|y |vy ) and q(α)=q(α|τ,κ); the joint variational distribution q(θX|y ,α) is the variation a function of the parameters τ, κ and vy , where
步骤S3.2.2、最小化后验分布p(θX|Y,α|D)和变分估计q(θX|y,α)之间的KL散度,求解变分推理模型参数τ,κ和vy;Step S3.2.2. Minimize the KL divergence between the posterior distribution p(θX|Y ,α|D) and the variational estimation q(θX|y ,α), and solve the variational inference model parameters τ, κ and vy ;
最小化KL散度即为最大化边际似然log(p(D))的变分下限Minimizing the KL divergence is maximizing the lower variational bound of the marginal likelihood log(p(D))
其中表示变分分布q的均值;所述变分分布和后验分布之间的KL散度等于log(p(D))和之间的差值,表示如下:in represents the mean of the variational distribution q; the KL divergence between the variational distribution and the posterior is equal to log(p(D)) and The difference between , expressed as follows:
特定情况下,在与变分推理模型近似的分层多项式-狄利克雷模型中,无法将写为变分参数的解析函数,因此,对的变分下限估算为是参数的解析函数,满足:In certain cases, in a hierarchical polynomial-Dirichlet model approximated by a variational inference model, it is not possible to convert An analytic function written as a variational argument, therefore, for The lower bound of the variation is estimated as is the analytic function of the parameter, satisfying:
其中vxy是参数向量vy的元素χ;通过计算关于vxy的偏导数,并置为0,得到:where vxy is the element χ of the parameter vector vy ; by computing The partial derivatives of vxy , juxtaposed to 0, yield:
其中,ψ(·)是digamma函数,代表log Gamma函数的导数;令上式等于0,则在给定参数向量κ的值时,可以求出参数vxy的估计值Among them, ψ( ) is the digamma function, which represents the derivative of the log Gamma function; if the above formula is equal to 0, when the value of the parameter vector κ is given, the estimated value of the parameter vxy can be obtained
通过导出牛顿法求出τ值;使最大化,需要计算关于τ的一阶和二阶偏导数;对τ求偏导如下:Find the value of τ by deriving Newton's method; let to maximize, need to calculate the first and second partial derivatives with respect to τ; The partial derivative with respect to τ is as follows:
对τ求二阶偏导如下: The second-order partial derivative with respect to τ is as follows:
由于参数τ总是正值,推导出更新log(τ)的牛顿算法;定义Since the parameter τ is always positive, derive Newton's algorithm for updating log(τ); define
则:but:
设定已知参数向量κ为固定值,则步骤κ处的牛顿更新如下:Set the known parameter vector κ as a fixed value, then the Newton update at step κ is as follows:
更新后的参数τk+1为:The updated parameter τk+1 is:
τk+1=τk exp(Δlog(τk))τk+1 =τk exp(Δlog(τk ))
上式即为参数τ的迭代公式;The above formula is the iterative formula of the parameter τ;
通过导出牛顿法求出κ值;使最大化,需要计算关于κx'的一阶和二阶偏导数;关于κx'的偏导数为:Obtain the κ value by deriving Newton's method; let to maximize, need to calculate the first and second partial derivatives with respect to κx' ; The partial derivative with respect to κx' is:
关于κx'的二阶偏导数为: The second order partial derivative with respect to κx' is:
其中所有二阶混合导数都等于0;由于∑x∈χκx=1,使用约束牛顿法优化在步骤k中,需要获得牛顿更新Δκk,使因此求解系统:where all second-order mixed derivatives are equal to 0; since ∑x∈χ κx =1, the constrained Newton method is used to optimize In step k, the Newton update Δκk needs to be obtained so that So solve the system:
其中u的元素是有约束的对偶变量,Hk是步骤k的hessian矩阵,1是恒等矩阵,gk是步骤k的梯度向量;定义:where the elements of u are constrained dual variables, Hk is the hessian matrix of step k, 1 is the identity matrix, and gk is the gradient vector of step k; definition:
给定参数τ和v的值,梯度向量的元素x表达如下:Given the values of the parameters τ and v, the element x of the gradient vector is expressed as:
在特定情况下,hessian矩阵的元素是对角阵,即H=diag(hk);因此,向量元素x的约束牛顿步骤是In a specific case, the elements of the hessian matrix is a diagonal matrix, that is, H=diag(hk ); therefore, the constrained Newton step for vector element x is
所以参数κ的迭代公式为:So the iterative formula of parameter κ is:
步骤S3.2.3、不断迭代,获取变分推理模型参数vy,τ和κ的值;具体地,Step S3.2.3, iterate continuously to obtain the values of the variational inference model parameters vy , τ and κ; specifically,
步骤L1、指定参数vy,τ和κ的初始值其中指定外部优化的最大迭代次数maxiter1和最大误差tol1;Step L1, specify the initial values of parameters vy , τ and κ in Specify the maximum number of iterations maxiter1 and the maximum error tol1 for external optimization;
步骤L2、当迭代次数K<maxiter1或相邻两次更新差值tolerance>tol1时,更新vy的估计值,即计算在和时,的值;Step L2, when the number of iterations K < maxiter1 or the difference tolerance of two adjacent updates > tol1 , update the estimated value of vy , that is, calculate in and hour, the value of;
步骤L3、指定内部优化的初始值,即指定内部优化的最大迭代次数maxiter2和最大误差tol2;Step L3, specify the initial value of the internal optimization, that is Specify the maximum number of iterations maxiter2 and the maximum error tol2 for internal optimization;
步骤L4、当迭代次数k<maxiter2或相邻两次更新差值tolerance>tol2时,更新τ的估计值,即计算和时,的值;同时更新κ的估计值,即计算在和时,的值;增加迭代次数k;Step L4, when the number of iterations k < maxiter2 or the difference tolerance between two adjacent updates > tol2 , update the estimated value of τ, that is, calculate and hour, ; at the same time update the estimated value of κ, that is, calculate the and hour, The value of ; increase the number of iterations k;
步骤L5、将和定义为内循环中获得的τ和κ的估计值,增加迭代次数K;外循环中获得的vy,τ和κ的值即为和Step L5, will and Defined as the estimated values of τ and κ obtained in the inner loop, increasing the number of iterations K; the values of vy , τ and κ obtained in the outer loop are and
有益效果:Beneficial effects:
本发明提供的液体火箭发动机稳态阶段的分层贝叶斯变分推理故障诊断方法,可以针对离散动态系统进行故障诊断,采用的分层模型与传统模型相比,能够显著提高参数估计的精度,且训练样本越少,分层模型的优势越明显。通过构建虚拟节点,将底层贝叶斯网络的推理结果作为不确定性证据,输入到对应的上层网络节点中,可以代替该底层贝叶斯网络,改进了分类分布的估计。引入变分推理算法优化模型,因为参数的后验分布没有解析解,分解分布得到变分模型的参数,通过对变分参数之间的依赖性来重构参数之间的依赖性,通过最小化后验分布和变分估计之间的KL散度对这些参数进行求解。与传统的马尔科夫链-蒙特卡洛方法相比,变分推理算法训练时间和参数估计精度都优于后者。The layered Bayesian variational reasoning fault diagnosis method in the steady state stage of the liquid rocket engine provided by the invention can perform fault diagnosis for discrete dynamic systems, and the layered model adopted can significantly improve the accuracy of parameter estimation compared with the traditional model. , and the fewer training samples, the more obvious the advantage of the hierarchical model. By constructing virtual nodes, the inference results of the underlying Bayesian network are used as uncertainty evidence and input to the corresponding upper-level network nodes, which can replace the underlying Bayesian network and improve the estimation of the classification distribution. The variational inference algorithm is introduced to optimize the model, because the posterior distribution of the parameters has no analytical solution, the parameters of the variational model are obtained by decomposing the distribution, and the dependence between the parameters is reconstructed by the dependence between the variational parameters. These parameters are solved for by the KL divergence between the posterior distribution and the variational estimate. Compared with the traditional Markov chain-Monte Carlo method, the variational inference algorithm has better training time and parameter estimation accuracy than the latter.
附图说明Description of drawings
图1是本发明提供的分层模型结合贝叶斯网络的有向图;Fig. 1 is the directed graph of the layered model provided by the present invention in conjunction with the Bayesian network;
图2是本发明实施例中液体火箭发动机故障分类的TAN结构图;Fig. 2 is the TAN structure diagram of liquid rocket engine fault classification in the embodiment of the present invention;
图3是本发明实施例中分层模型与传统模型的ROC曲线比较。FIG. 3 is a comparison of the ROC curves of the hierarchical model and the traditional model in the embodiment of the present invention.
图4是本发明实施例中分层模型与传统模型的KL散度箱型图比较;Fig. 4 is the KL divergence box plot comparison of the hierarchical model and the traditional model in the embodiment of the present invention;
图5是本发明实施例中分层模型与传统模型的ROC面积箱型图比较。FIG. 5 is a comparison of the ROC area box plot of the layered model and the traditional model in the embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图对本发明作更进一步的说明。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The present invention will be further described below in conjunction with the accompanying drawings. Obviously, the described embodiments are some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
步骤S1、根据液体火箭发动机稳态工作阶段选择故障类型和属性变量,从试车数据中选择7类易发生的故障类型,共包含22个属性变量。故障类型和属性变量如下表1和表2所示。使用最小描述长度离散化方法对连续型数值进行离散化,将非数值型数据转换为数值型,且数据样本不含缺失值。Step S1 , selecting fault types and attribute variables according to the steady-state working stage of the liquid rocket engine, and selecting 7 types of fault types that are prone to occur from the test data, including a total of 22 attribute variables. The fault type and attribute variables are shown in Tables 1 and 2 below. Use the minimum description length discretization method to discretize continuous numeric values, convert non-numeric data to numeric, and the data samples do not contain missing values.
表1液体火箭发动机易发生故障类型Table 1 Liquid rocket engine prone to failure types
表2特征属性变量选择情况Table 2 Feature attribute variable selection
步骤S2、构建液体火箭发动机TAN结构故障分类模型。具体地,Step S2, constructing a liquid rocket engine TAN structural fault classification model. specifically,
步骤S2.1、基于步骤S1选择的属性变量,计算条件互信息:Step S2.1, based on the attribute variable selected in step S1, calculate the conditional mutual information:
其中,Xi与Xj代表两种属性变量,C代表数据集,这里指训练集。将从上表2中选择的属性变量作为树的节点,将各属性变量间的条件互信息作为节点间的边的权重,构建最大生成树;Among them, Xi and Xj represent two attribute variables, C represents the data set, here refers to the training set. The attribute variables selected from the above table 2 are used as the nodes of the tree, and the conditional mutual information between the attribute variables is used as the weight of the edges between the nodes to construct a maximum spanning tree;
步骤S2.2、设置每条边的方向,将最上层类节点插入生成树中,使类节点指向每个属性节点,由此构成TAN结构故障分类模型如图2所示。除了类节点外,每个节点至多只有一个属性节点作为该节点的父节点。各节点之间的依赖关系也反应出在实际情况下,属性之间的相互关系。Step S2.2: Set the direction of each edge, insert the top-level class node into the spanning tree, and make the class node point to each attribute node, thus forming a TAN structure fault classification model as shown in Figure 2. Except for class nodes, each node has at most one attribute node as the parent node of the node. The dependencies between nodes also reflect the interrelationships between attributes in actual situations.
步骤S3、基于传统多项式-狄利克雷模型,建立分层多项式-狄利克雷模型,引入变分推理算法进一步优化,对液体火箭动机稳态工作状态故障进行分类。具体地,Step S3, based on the traditional polynomial-Dirichlet model, establish a hierarchical polynomial-Dirichlet model, introduce a variational inference algorithm for further optimization, and classify the steady-state working state faults of the liquid rocket motor. specifically,
步骤S3.1、建立分层多项式-狄利克雷模型如下:Step S3.1, establish a hierarchical polynomial-Dirichlet model as follows:
设定α是一个隐随机向量,服从狄利克雷先验:Let α be a latent random vector obeying the Dirichlet prior:
α|s,α0~s·Dirichlet(α0)α|s,α0 ~s·Dirichlet(α0 )
其中等效样本量s和参数向量α0是模型的超参量,且元素和满足:where the equivalent sample size s and the parameter vector α0 are the hyperparameters of the model, and the element sum satisfies:
θX|Y的先验是狄利克雷混合分布:The prior for θX|Y is a Dirichlet mixture distribution:
上式中先验值不能对y进行因式分解,不同的条件分布的参数不再是先验独立的;The prior value in the above formula cannot factorize y, and the parameters of different conditional distributions are no longer independent a priori;
步骤S3.2、基于变分推理算法进一步优化求解参数的联合后验分布;Step S3.2, further optimizing the joint posterior distribution of the solution parameters based on the variational inference algorithm;
由n个独立同分布的观测值(xk,yk)组成的数据集,其中k=1,...,n,则参数的后验分布是狄利克雷混合分布:A dataset consisting of n independent and identically distributed observations (xk , yk ), where k=1,...,n, then the posterior distribution of the parameters is a Dirichlet mixture:
α的值在确定θX|Y的后验分布时具有较高的权重。上式没有封闭形式的解,因此,将其表示为后验期望。这些量是根据α的后验期望定义的,表示为The value of α has a higher weight in determining the posterior distribution of θX|Y . There is no closed-form solution to the above equation, so it is expressed as the posterior expectation. These quantities are defined in terms of the posterior expectation of α, expressed as
θx|y的后验均值为:The posterior mean of θx|y is:
其中nxy表示θx|y的估计量的充分统计值,即X=x和Y=y条件下的观测数,ny=∑x∈Xnxy表示变量Y的统计数。α的后验分布无法被解析地计算,表示如下:where nxy represents the sufficient statistics of the estimator of θx|y , that is, the number of observations under the conditions of X=x and Y=y, ny =∑x∈X nxy represents the statistics of the variable Y. The posterior distribution of α cannot be computed analytically and is expressed as follows:
采用变分推理算法进行快速求解θX|Y和α的后验分布;具体地,The variational inference algorithm is used to quickly solve the posterior distribution of θX|Y and α; specifically,
步骤S3.2.1、通过分解分布估算p(θX|Y,α|D)如下:Step S3.2.1, estimate p(θX|Y , α|D) by decomposing the distribution as follows:
其中,θX|y和α为独立的随机变量;当时,和且∑x∈χκx=1,为变分推理模型的参数,满足:Among them, θX|y and α are independent random variables; when hour, and And ∑x∈χ κx =1, is the parameter of the variational inference model, which satisfies:
α|s,τ,κ~s·Dirichlet(τκ)α|s,τ,κ~s·Dirichlet(τκ)
令q(θX|y)=q(θX|y|vy)且q(α)=q(α|τ,κ);联合变分分布q(θX|y,α)是变分参数τ,κ和vy的函数,其中Let q(θX|y )=q(θX|y |vy ) and q(α)=q(α|τ,κ); the joint variational distribution q(θX|y ,α) is the variation a function of the parameters τ, κ and vy , where
步骤S3.2.2、最小化后验分布p(θX|Y,α|D)和变分估计q(θX|y,α)之间的KL散度,求解变分推理模型参数τ,κ和vy;Step S3.2.2. Minimize the KL divergence between the posterior distribution p(θX|Y ,α|D) and the variational estimation q(θX|y ,α), and solve the variational inference model parameters τ, κ and vy ;
最小化KL散度即为最大化边际似然log(p(D))的变分下限Minimizing the KL divergence is maximizing the lower variational bound of the marginal likelihood log(p(D))
其中表示变分分布q的均值;所述变分分布和后验分布之间的KL散度等于log(p(D))和之间的差值,表示如下:in represents the mean of the variational distribution q; the KL divergence between the variational distribution and the posterior is equal to log(p(D)) and The difference between , expressed as follows:
特定情况下,在与变分推理模型近似的分层多项式-狄利克雷模型中,无法将写为变分参数的解析函数,因此,对的变分下限估算为是参数的解析函数,满足:In certain cases, in a hierarchical polynomial-Dirichlet model approximated by a variational inference model, it is not possible to convert An analytic function written as a variational argument, therefore, for The lower bound of the variation is estimated as is the analytic function of the parameter, satisfying:
其中vxy是参数向量vy的元素χ;通过计算关于vxy的偏导数,并置为0,得到:where vxy is the element χ of the parameter vector vy ; by computing The partial derivatives of vxy , juxtaposed to 0, yield:
其中,ψ(·)是digamma函数,代表log Gamma函数的导数;令上式等于0,则在给定参数向量κ的值时,可以求出参数vxy的估计值Among them, ψ( ) is the digamma function, which represents the derivative of the log Gamma function; if the above formula is equal to 0, when the value of the parameter vector κ is given, the estimated value of the parameter vxy can be obtained
通过导出牛顿法求出τ值;使最大化,需要计算关于τ的一阶和二阶偏导数;对τ求偏导如下:Find the value of τ by deriving Newton's method; let to maximize, need to calculate the first and second partial derivatives with respect to τ; The partial derivative with respect to τ is as follows:
对τ求二阶偏导如下: The second-order partial derivative with respect to τ is as follows:
由于参数τ总是正值,推导出更新log(τ)的牛顿算法;定义Since the parameter τ is always positive, derive Newton's algorithm for updating log(τ); define
则:but:
设定已知参数向量κ为固定值,则步骤κ处的牛顿更新如下:Set the known parameter vector κ as a fixed value, then the Newton update at step κ is as follows:
更新后的参数τk+1为:The updated parameter τk+1 is:
τk+1=τk exp(Δlog(τk))τk+1 =τk exp(Δlog(τk ))
上式即为参数τ的迭代公式;The above formula is the iterative formula of the parameter τ;
通过导出牛顿法求出κ值;使最大化,需要计算关于κx一阶和二阶偏导数;Obtain the κ value by deriving Newton's method; let to maximize, need to calculate with respect to the first and second partial derivatives of κx ;
关于κx'的偏导数为: The partial derivative with respect to κx' is:
关于κx'的二阶偏导数为: The second order partial derivative with respect to κx' is:
其中所有二阶混合导数都等于0;由于∑x∈χκx=1,使用约束牛顿法优化在步骤k中,需要获得牛顿更新Δκk,使因此求解系统:where all second-order mixed derivatives are equal to 0; since ∑x∈χ κx =1, the constrained Newton method is used to optimize In step k, the Newton update Δκk needs to be obtained so that So solve the system:
其中u的元素是有约束的对偶变量,Hk是步骤k的hessian矩阵,1是恒等矩阵,gk是步骤k的梯度向量;定义:where the elements of u are constrained dual variables, Hk is the hessian matrix of step k, 1 is the identity matrix, and gk is the gradient vector of step k; definition:
给定参数τ和v的值,梯度向量的元素x表达如下:Given the values of the parameters τ and v, the element x of the gradient vector is expressed as:
在特定情况下,hessian矩阵的元素是对角阵,即H=diag(hk);因此,向量元素x的约束牛顿步骤是In a specific case, the elements of the hessian matrix is a diagonal matrix, i.e. H=diag(hk ); therefore, the constrained Newton step for the vector element x is
所以参数κ的迭代公式为:So the iterative formula of parameter κ is:
步骤S3.2.3、不断迭代,获取变分推理模型参数vy,τ和κ的值;具体地,Step S3.2.3, iterate continuously to obtain the values of the variational inference model parameters vy , τ and κ; specifically,
步骤L1、指定参数vy,τ和κ的初始值其中指定外部优化的最大迭代次数maxiter1和最大误差tol1;Step L1, specify the initial values of parameters vy , τ and κ in Specify the maximum number of iterations maxiter1 and the maximum error tol1 for external optimization;
步骤L2、当迭代次数K<maxiter1或相邻两次更新差值tolerance>tol1时,更新vy的估计值,即计算在和时,的值;Step L2, when the number of iterations K < maxiter1 or the difference tolerance of two adjacent updates > tol1 , update the estimated value of vy , that is, calculate in and hour, the value of;
步骤L3、指定内部优化的初始值,即指定内部优化的最大迭代次数maxiter2和最大误差tol2;Step L3, specify the initial value of the internal optimization, that is Specify the maximum number of iterations maxiter2 and the maximum error tol2 for internal optimization;
步骤L4、当迭代次数k<maxiter2或相邻两次更新差值tolerance>tol2时,更新τ的估计值,即计算和时,的值;同时更新κ的估计值,即计算在和时,的值;增加迭代次数k;Step L4, when the number of iterations k < maxiter2 or the difference tolerance between two adjacent updates > tol2 , update the estimated value of τ, that is, calculate and hour, ; at the same time update the estimated value of κ, that is, calculate the and hour, The value of ; increase the number of iterations k;
步骤L5、将和定义为内循环中获得的τ和κ的估计值,增加迭代次数K;外循环中获得的vy,τ和κ的值即为和Step L5, will and Defined as the estimated values of τ and κ obtained in the inner loop, increasing the number of iterations K; the values of vy , τ and κ obtained in the outer loop are and
步骤S4、对液体火箭发动机稳态工作状态故障进行分类,验证不同样本量对传统模型和分层模型的影响。从液体火箭发动机故障样本中随机抽取n行数据构成训练集进行实验,其中n∈{20,40,80,160,320}。对于每个不同的n值,重复10次以下过程:Step S4 , classifying the liquid rocket engine steady-state working state faults, and verifying the influence of different sample sizes on the traditional model and the layered model. Randomly select n rows of data from liquid rocket engine failure samples to form a training set for experiments, where n ∈ {20, 40, 80, 160, 320}. For each different value of n, repeat the following process 10 times:
步骤1、从液体火箭发动机故障样本中抽取n个实例构成训练集。
步骤2、从训练集中估计TAN网络的参数。Step 2. Estimate the parameters of the TAN network from the training set.
步骤3、从液体火箭发动机故障样本中随机抽取不包含训练集的1000个实例,构成测试集。Step 3. Randomly select 1000 instances from the liquid rocket engine failure samples that do not contain the training set to form a test set.
步骤4、对测试集进行分类。Step 4. Classify the test set.
对于传统的BDeu先验,设置进行参数估计。对于分层模型,设置和设置变分推理算法迭代的终止条件为迭代次数大于1000次或相邻两次迭代的差值小于10-6。另外,除了均方误差MSE,将KL散度也作为衡量参数估计精度的指标,同时使用ROC曲线下的面积衡量分类器的分类性能。For traditional BDeu priors, set Perform parameter estimation. For hierarchical models, set and The termination condition of the iteration of the variational inference algorithm is set as the number of iterations is greater than 1000 or the difference between two adjacent iterations is less than 10-6 . In addition, in addition to the mean square error MSE, the KL divergence is also used as an indicator to measure the accuracy of parameter estimation, and the area under the ROC curve is used to measure the classification performance of the classifier.
以n=20为例,分层模型下训练集的分类结果分别如下表3-4所示。Taking n=20 as an example, the classification results of the training set under the hierarchical model are shown in Table 3-4 below.
表3液体火箭发动机的故障数据的混淆矩阵Table 3 Confusion matrix of failure data for liquid rocket engines
表4故障分类评价指标Table 4 Fault classification evaluation index
将n=20时,分层模型和传统模型对训练集的分类结果绘制成ROC曲线,如图3所示。When n=20, the classification results of the hierarchical model and the traditional model on the training set are drawn as ROC curves, as shown in Figure 3.
尽管训练样本集的实例数仅有20个,但是建立的分层模型对实例数为1000的测试集进行分类,ROC曲线下面积仍然达到0.939,而传统模型仅有0.732。对比发现,当样本实例较少,相比于传统模型,分层模型对于贝叶斯网络参数估计的提升是巨大的。这也表明,分层模型用于贝叶斯网络的参数估计十分有效。Although the number of instances in the training sample set is only 20, the established hierarchical model classifies the test set with 1000 instances, and the area under the ROC curve still reaches 0.939, while the traditional model is only 0.732. The comparison shows that when there are few sample instances, compared with the traditional model, the hierarchical model can greatly improve the parameter estimation of the Bayesian network. It also shows that the hierarchical model is very effective for parameter estimation of Bayesian network.
为了比较两种模型各方面性能的差异,针对不同的样本数量,还绘制了KL散度和ROC曲线面积图,如图4-5所示。In order to compare the performance differences of the two models in various aspects, KL divergence and ROC curve area graphs are also drawn for different sample sizes, as shown in Figure 4-5.
从KL散度的计算结果来看,分层模型在参数估计精度上优于传统模型,且当样本中包含实例数量越少,这种优势越明显。尽管随着样本实例n不断增大,两者之前的参数估计精度的差异越来越小,但是分层模型的表现仍然优于传统模型。从ROC曲线的面积来看,分层模型具有较高的分类精度,且样本实例数量越少,差距越明显。随着训练集样本实例数不断增加,分层模型的ROC曲线下的面积接近于1,且分类结果较为稳定。From the calculation results of KL divergence, the hierarchical model is superior to the traditional model in parameter estimation accuracy, and when the sample contains fewer instances, the advantage is more obvious. Although the difference between the two previous parameter estimation accuracies becomes smaller as the sample instance n increases, the hierarchical model still outperforms the traditional model. From the area of the ROC curve, the hierarchical model has higher classification accuracy, and the smaller the number of sample instances, the more obvious the gap is. As the number of sample instances in the training set increases, the area under the ROC curve of the hierarchical model is close to 1, and the classification results are relatively stable.
以上所述仅是本发明的优选实施方式,应当指出:对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only the preferred embodiment of the present invention, it should be pointed out that: for those skilled in the art, without departing from the principle of the present invention, several improvements and modifications can also be made, and these improvements and modifications are also It should be regarded as the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111622537.8ACN114358164A (en) | 2021-12-28 | 2021-12-28 | A Hierarchical Bayesian Variational Inference Fault Diagnosis Method for the Steady-State Stage of Liquid Rocket Motor |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111622537.8ACN114358164A (en) | 2021-12-28 | 2021-12-28 | A Hierarchical Bayesian Variational Inference Fault Diagnosis Method for the Steady-State Stage of Liquid Rocket Motor |
| Publication Number | Publication Date |
|---|---|
| CN114358164Atrue CN114358164A (en) | 2022-04-15 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111622537.8APendingCN114358164A (en) | 2021-12-28 | 2021-12-28 | A Hierarchical Bayesian Variational Inference Fault Diagnosis Method for the Steady-State Stage of Liquid Rocket Motor |
| Country | Link |
|---|---|
| CN (1) | CN114358164A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118378460A (en)* | 2024-06-25 | 2024-07-23 | 北京航空航天大学 | A planning method and device for reliability test of reusable rocket engine |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170364404A1 (en)* | 2016-06-21 | 2017-12-21 | EMC IP Holding Company LLC | Fault processing method, system, and computer program product |
| CN109447236A (en)* | 2018-09-28 | 2019-03-08 | 重庆邮电大学 | A kind of method for diagnosing faults of hybrid vehicle heat management system |
| CN111259927A (en)* | 2020-01-08 | 2020-06-09 | 西北工业大学 | Rocket engine fault diagnosis method based on neural network and evidence theory |
| US20210373544A1 (en)* | 2020-05-27 | 2021-12-02 | Jiangnan University | Estimation Methods of Actuator Faults based on Bayesian Learning |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170364404A1 (en)* | 2016-06-21 | 2017-12-21 | EMC IP Holding Company LLC | Fault processing method, system, and computer program product |
| CN109447236A (en)* | 2018-09-28 | 2019-03-08 | 重庆邮电大学 | A kind of method for diagnosing faults of hybrid vehicle heat management system |
| CN111259927A (en)* | 2020-01-08 | 2020-06-09 | 西北工业大学 | Rocket engine fault diagnosis method based on neural network and evidence theory |
| US20210373544A1 (en)* | 2020-05-27 | 2021-12-02 | Jiangnan University | Estimation Methods of Actuator Faults based on Bayesian Learning |
| Title |
|---|
| LAURA AZZIMONTI等: "Hierarchical estimation of parameters in Bayesian networks", 《COMPUTATIONAL STATISTICS & DATA ANALYSIS》, vol. 137, 19 February 2019 (2019-02-19), pages 1* |
| 刘久富等: "液体火箭发动机的分层贝叶斯变分推理故障诊断方法", 《北京理工大学学报》, vol. 42, no. 3, 26 January 2022 (2022-01-26)* |
| 谢红卫: "《多阶段小样本数据条件下装备试验评估》", 30 September 2016, 国防工业出版社, pages: 7* |
| 郝志峰: "《数据科学与数学建模》", 31 January 2019, 华中科技大学出版社, pages: 125* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118378460A (en)* | 2024-06-25 | 2024-07-23 | 北京航空航天大学 | A planning method and device for reliability test of reusable rocket engine |
| Publication | Publication Date | Title |
|---|---|---|
| Kang et al. | Rawlsgcn: Towards rawlsian difference principle on graph convolutional network | |
| Malinsky et al. | Causal structure learning from multivariate time series in settings with unmeasured confounding | |
| Ravikumar et al. | High-dimensional Ising model selection using ℓ 1-regularized logistic regression | |
| CN105530122B (en) | A kind of network fault diagnosis method based on the hidden Naive Bayes Classifier of selectivity | |
| US7844449B2 (en) | Scalable probabilistic latent semantic analysis | |
| Luu et al. | Sampling from non-smooth distributions through Langevin diffusion | |
| Gu et al. | Learning big Gaussian Bayesian networks: Partition, estimation and fusion | |
| CN118468208B (en) | Fault diagnosis method and system for light electric propulsion system | |
| Li et al. | Constraint-based causal structure learning with consistent separating sets | |
| Chiu et al. | Discrete probabilistic inverse optimal transport | |
| CN113987195B (en) | A Differentiable Method for Mining Constant Rules | |
| VanDerHorn et al. | Bayesian model updating with summarized statistical and reliability data | |
| CN117454224A (en) | Chemical process fault detection method based on deep semi-non-negative matrix factorization | |
| Wang et al. | Inference for sparse conditional precision matrices | |
| Castelletti et al. | Objective Bayes model selection of Gaussian interventional essential graphs for the identification of signaling pathways | |
| CN114358164A (en) | A Hierarchical Bayesian Variational Inference Fault Diagnosis Method for the Steady-State Stage of Liquid Rocket Motor | |
| Ragavan et al. | Adaptive Sampling line search for local stochastic optimization with integer variables | |
| Xiang et al. | Understanding propagation error and its effect on collective classification | |
| Liang et al. | Advanced voltage abnormality detection in real-vehicle battery systems using self-organizing map neural networks and adaptive threshold | |
| Cunegatti et al. | Understanding sparse neural networks from their topology via multipartite graph representations | |
| Wang et al. | An efficient causal discovery algorithm for linear models | |
| Nagano et al. | Phase transition in compressed sensing with horseshoe prior | |
| CN107682193A (en) | A kind of common communication multi-business flow method of estimation | |
| Melville et al. | Methods for data-centric small satellite anomaly detection and fault prediction | |
| Yang et al. | Federated multi-task Bayesian network learning in the presence of overlapping and distinct variables |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |