## 2 Methods
### Root Cause Tracing Based on Adam Variational Inference Bayesian Neural Network  
#### 2.2.1 Framework for Solving Ideas  
When energy consumption anomalies are detected, the key is to identify the root cause of the anomaly. However, directly analyzing the correlation between energy consumption anomalies and specific factors (such as production factors, equipment factors, operational factors, etc.) is often difficult. Therefore, this section breaks the problem down into two levels: first, identifying the process variables directly related to the anomalous energy consumption (such as furnace temperature during heating, reduction amount during rolling, etc.); second, further exploring the relationship between these process variables and underlying factors.  
After identifying the process variables directly associated with the anomaly, it is necessary to further investigate whether these variables are independent of each other or if there are any interdependencies or interactions between the variables that trigger the anomaly. If the relationships between the variables can be uncovered, it will be possible to more effectively identify the key variables and prioritize them for investigation, significantly improving work efficiency. To this end, this section introduces Granger causality to represent the interactions between variables. Since Granger causality can only handle linear systems and is difficult to use to evaluate the optimal causal path, this paper proposes a weighted Granger causality analysis method based on LSTM to better meet the practical needs of industrial sites.  
By analyzing the causal paths with the highest weights, it is usually possible to identify the characteristic variables that exhibit abnormal behavior, i.e., the fault variables. However, more importantly, it is necessary to further explore the underlying causes of these abnormal phenomena. This requires establishing relationships between process variables and potential influencing factors, so that once anomalous variables are identified, a probabilistic explanation can be provided. To this end, this paper proposes a Bayesian neural network based on Adam variational inference to achieve root cause tracing; by introducing Bayesian inference, it provides a probabilistic interpretation of the results, making the diagnostic process more scientific and reliable.  
Based on the above, the overall framework is shown in Figure 2. The process can be divided into the following steps:  
Step 1: Analyze the variables related to the anomalous indicator \(y_{i}\).  
Step 2: For the related variables, apply weighted Granger causality analysis based on LSTM to obtain the weighted causality coefficient matrix.  
Step 3: Based on the weighted causality coefficient matrix, calculate the optimal causal path.  
Step 4: Use historical information to construct a dataset for the variable \(x\) and underlying factors \(z\).  
Step 5: Construct a Bayesian neural network and optimize the network weights using Adam.  
Step 6: Convert the calculated optimal causal path into input for the Bayesian neural network.  
Step 7: Compute the probability of each factor and its potential anomaly occurrence.  
Granger causality [26] analysis is used to find the causal path that leads to anomalies, while the Bayesian neural network gives the underlying factors related to the causal path, namely, the root cause.