## 2 Methods
### Root Cause Tracing Based on Adam Variational Inference Bayesian Neural Network
#### 2.2.3 Root Cause Tracing Based on Adam Variational Inference Bayesian Neural Network
\begin{table}
\begin{tabular}{c c c} \hline \hline
**No.** & **Process Variable** & **Corresponding Factors** \\ \hline
1 & Inlet Temperature & Process Heating Temperature, Furnace Surface Temperature \\
2 & Outlet Temperature & Heat Loss, Time in Furnace Deviation, Air–Fuel Ratio \\
3 & Sensor 1 Measurement & Rolling Ratio, Product Specifications, Billet Weight \\
4 & \(\cdots\) & \(\cdots\) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Anomalous variables and factors. The above method treats each process variable as independent and of equal importance. To better reflect the causality between variables, this section treats the traceability results as vectors and assigns weights to each vector. These weighted vectors are then input into the Bayesian neural network to obtain the final results. In Figure 8, \(c_{i}\) represents the weight of the variable and \(p_{i}\) represents the probability of the corresponding factor. Let the set of abnormal variable chains be denoted as \(\Omega\), where \(x_{k}\) is the root cause variable. Since the root cause variable has a significant weight in the variable chain, \(c_{k}=1\). For the remaining variables \(c_{i}\), where \(i\
eq k,i\in\Omega\), their values decrease according to the sequence in which the variable chain flows, i.e.,  
\[c_{i}=1-\frac{v-1}{\#\Omega} \tag{26}\]  
where \(\#\Omega\) is the number of elements in the variable path set and \(v\) represents the position of a specific variable within the entire variable path. The weights for the remaining variables, which are not part of the abnormal variable chain set, are set to 0. As shown in Figure 9, the vector input can be represented by the vector \([1,0,0]^{\mathrm{T}},[0,0.67,0]^{\mathrm{T}},[0,0,0.33]^{\mathrm{T}}\) and the factor output can be represented by the vector \([1,1,1,0,0,0]^{\mathrm{T}},[0,0,1,1,0,0]^{\mathrm{T}},[0,0,0,1,1,1]^{\mathrm{T}}\). Figure 8: Bayesian neural network architecture. Figure 7: Relationship between variables and factors. (**a**) One-to-one or one-to-many. (**b**) Many-to-many. C. Network weight optimization based on Adam variational inference  
In a Bayesian neural network, the network weights \(w\) are treated as random variables rather than fixed point estimates. Using variational inference, we optimize the distribution of the weights instead of directly optimizing the weights themselves. Typically, a parameterized variational distribution \(q(w)\) is chosen to approximate the posterior distribution \(\Pr(w|X,Z)\), which is expressed as  
\[q(w)=\mathcal{N}(w|\mu,\sigma^{2}), \tag{27}\]  
where \(\mu\) represents the mean of the weights and \(\sigma^{2}\) represents the uncertainty (variance) of the weights. The training objective of the Bayesian neural network is to maximize the evidence lower bound (ELBO) [30], which involves maximizing the following objective function to simultaneously minimize the likelihood and KL divergence:  
\[\text{ELBO}(q)=\mathbb{E}_{q(w)}[\log\Pr(X,Z|w)]-\text{KL}(q(w)||\Pr(w)), \tag{28}\]  
In this context, the first term \(\mathbb{E}_{q(w)}[\log\Pr(X,Z|w)]\) is the expectation of the log-likelihood of the data under the approximate distribution \(q(w)\), which indicates the degree of fit of the model. The specific form is \(\mathbb{E}_{q(w)}[\log p(X,Z|w)]=\int q(w)\log p(X,Z|w)dw\). The second term \(\text{KL}(q(w)||\Pr(w))\) is the KL divergence between the approximate distribution and the prior distribution, which is used to maintain the regularization of the parameters. Its specific form is \(\text{KL}(q(w)||p(w))=\int q(w)\log\frac{q(w)}{p(w)}dw\). Assume that the prior \(p(w)\) is also a Gaussian distribution--that is, \(p(w)=\mathcal{N}(w|0,\sigma_{0}^{2})\). Taking partial derivatives of \(\mu\) and \(\sigma^{2}\),  
\[