# Blast Loading Prediction of Complex Structures Based on Bayesian Deep Active Learning
## 3 Blast Loading Prediction Method Based on BDAL
### Principles of Bayesian Neural Networks  
The core concept of BNNs is to treat network parameters as random variables. Consequently, these parameters are not fixed values; instead, each parameter follows a specific probability distribution [37; 38]. Consider a dataset \(D=\{X,Y\}\) containing \(M\) samples, with \(X=\{\mathbf{x}_{i}\}_{i=1}^{M}\) representing the input data and \(Y=\{y_{i}\}_{i=1}^{M}\) representing the corresponding labels. Equation (2) represents a BNN as follows:  
\[y=f_{\mathbf{\Theta}}(\mathbf{x}) \tag{2}\]  
where \(\mathbf{\Theta}=\{\mathbf{\Theta_{1}},\mathbf{\Theta_{2}},\dots\}\) is the set of parameters, and \(\mathbf{x}\) and \(y\) denote the inputs and outputs of the neural network, respectively. Given a prior distribution \(p(\mathbf{\Theta})\) for the parameters, the likelihood function can be denoted as shown in Equation (3):  
\[P(Y|X,\mathbf{\Theta})=\prod_{i=1}^{M}p(y_{i}|\mathbf{x}_{i},\mathbf{\Theta}) \tag{3}\]  
According to [PERSON] theorem, the posterior distribution of the model parameters \(\mathbf{\Theta}\) is expressed as follows:  
\[p(\mathbf{\Theta}|X,Y)=\frac{p(\mathbf{\Theta})\cdot\prod_{i=1}^{M}p(y_{i}|\mathbf{x}_{i},\mathbf{\Theta})}{\int_{\mathbf{\Theta}}p(\mathbf{\Theta})\prod_{i=1}^{M}p(y_{i}|\mathbf{x}_{ i},\mathbf{\Theta})d\mathbf{\Theta}} \tag{4}\]  
Based on the posterior distribution, for the new input \(\mathbf{x}\), the BNN gives the predicted distribution of the output \(y\prime\) as follows:  
\[p(y^{\prime}|\mathbf{x}^{\prime},X,Y)=\int p(\mathbf{\Theta}|X,Y)p(y^{\prime}|\mathbf{x}^ {\prime},\mathbf{\Theta})d\mathbf{\Theta} \tag{5}\]  
As shown in Equation (5), obtaining the predictive distribution of the output \(y\prime\) requires an analytical solution for the posterior distribution of the model parameters. To avoid complex high-dimensional integrals, variational inference (VI) can be used to approximate this posterior distribution. Define a variational distribution \(q_{\lambda}(\mathbf{\Theta})\), such as a multivariate normal distribution or Gamma distribution. VI aims to make \(q_{\lambda}(\mathbf{\Theta})\) as close as possible to the true posterior distribution \(p(\mathbf{\Theta}|X,Y)\) by optimizing the variational parameter \(\lambda\). Thus, the inference problem is transformed into an optimization problem. As shown in Equation (6), this study used Kullback-Leibler (KL) divergence to quantify the similarity between \(q_{\lambda}(\mathbf{\Theta})\) and \(p(\mathbf{\Theta}|X,Y)\):  
\[KL[q_{\lambda}(\mathbf{\Theta})||p(\mathbf{\Theta}|D)] =\int q_{\lambda}(\mathbf{\Theta})\log\biggl{(}\frac{q_{\lambda}(\mathbf{ \Theta})}{p(\mathbf{\Theta}|D)}\biggr{)}\mathrm{d}\mathbf{\Theta} \tag{6}\] \[=\int q_{\lambda}(\mathbf{\Theta})\log p(D)\mathrm{d}\mathbf{\Theta}-\int q _{\lambda}(\mathbf{\Theta})\log\biggl{(}\frac{p(\mathbf{\Theta},D)}{q_{\lambda}(\mathbf{ \Theta})}\biggr{)}\mathrm{d}\mathbf{\Theta}\] \[=\log p(D)-\int q_{\lambda}(\mathbf{\Theta})\log\biggl{(}\frac{p(\bm {\Theta},D)}{q_{\lambda}(\mathbf{\Theta})}\biggr{)}\mathrm{d}\mathbf{\Theta}\]The optimization objectives of KL divergence include the following:  
\[\lambda^{*} =\underset{\alpha}{\text{argmin}}\bigg{\{}-\int q_{\lambda}(\mathbf{ \Theta})log\bigg{(}\frac{p(\mathbf{\Theta},D)}{q_{\lambda}(\mathbf{\Theta})}\bigg{)} \text{d}\mathbf{\Theta}\bigg{\}} \tag{7}\] \[=\underset{\alpha}{\text{argmin}}\bigg{\{}\begin{aligned} \int q_{\lambda}(\mathbf{ \Theta})log\bigg{(}\frac{q_{\lambda}(\mathbf{\Theta})}{p(\mathbf{\Theta})}\bigg{)} \text{d}\mathbf{\Theta}\bigg{\}}\] \[=\underset{\alpha}{\text{argmin}}\{KL[q_{\lambda}(\mathbf{\Theta}) ||p(\mathbf{\Theta})]-E_{\mathbf{\Theta}\sim q_{\lambda}}[log\ p(D|\mathbf{\Theta})]\}\]  
where \(E_{\mathbf{\Theta}\sim q_{\lambda}}[\log p(D|\mathbf{\Theta})]\) is a logarithmic likelihood function. For each test sample, the output based on the BNN model is a set of probability distributions rather than a definitive point estimate.