# Energy Optimisation of Industrial Limestone Grinding Using ANN
## 8 Optimisation of the Neural Network Model
### Bayesian Optimisation  
Bayesian optimisation is a global optimisation strategy designed for problems where the objective function is expensive to evaluate, lacks an analytical form, and may be noisy [70; 71]. It is particularly effective for optimising black-box functions such as those represented by deep neural networks. The goal is to find  
\[x^{*}=\arg\min f(x) \tag{10}\]  
subject to the following conditions:  
* \(f\) is a black-box function with unknown analytical form and gradients;
* Evaluations of \(f(x)\) are computationally expensive;
* Observation \(y=f(x)\) may be noisy. Given these constraints, Bayesian optimisation is well-suited for optimising data-driven models like neural networks used in this work. The method constructs a surrogate model of the objective function using a Gaussian process (GP), which is updated iteratively based on observed data. The algorithm proceeds as follows [72]:  
1. At iteration \(t\), a GP model, is fit to the observations \((x_{i},y_{i})\) for \(i=1,\ldots,t\). 2. A computationally inexpensive acquisition function \(u(x)\) is optimised to select the next point for evaluation: \(x_{t+1}=\arg\max u(x)\). 3. The objective function is evaluated at \(x_{t+1}\) to obtain \(y_{t+1}=f(x_{t+1})\). The acquisition function balances exploration and exploitation. In this work, the algorithm probabilistically selected among several acquisition strategies using the gp_hedge heuristic:  
* Expected Improvement (EI): \(EI(x)=\mathbb{E}[f(x^{+})-f(x)]\);
* Lower Confidence Bound (LCB): \(LCB(x)=\mu_{\text{GP}}(x)+\kappa\cdot\sigma(x)\);
* Probability of Improvement (PI): \(PI(x)=\mathbb{P}(f(x)\leq f(x^{+})-\epsilon)\). Here, \(f(x^{+})\) is the best observed value to date, and \(\mu_{\text{GP}}(x)\) and \(\sigma(x)\) are the GP posterior mean and standard deviation, respectively. In this study, Bayesian optimisation was employed to identify the optimal setpoints of controllable process parameters that minimize the predicted values of the energy indicators \(W\) and \(S\). The optimisation was implemented using the gp_minimize function from the scikit-optimize library, which applies Gaussian process regression to iteratively refine the search space. The objective functions were constructed using previously trained neural network models:  
* \(f_{W}(\mathbf{x})=\text{model}_{\text{W}}\cdot\text{predict}(\mathbf{x})\);
* \(f_{S}(\mathbf{x})=\text{model}_{S}\cdot\text{predict}(\mathbf{x})\). Here, \(\mathbf{x}\) represents a vector of normalized controllable process variables. The optimisation was performed independently for each indicator with the following configuration:
* Total evaluations: 50. * Initial random samples: 10. * Acquisition strategy: gp_hedge. * Random seed: 42 (to ensure reproducibility). At each iteration, the surrogate GP model was updated with the latest data, and the next candidate point was selected by maximizing the acquisition function. This iterative procedure converged toward the minimum of the surrogate model, yielding the following:  
* \(\min f_{\text{W}}(\mathbf{x})\) at optimal parameters \(\mathbf{x}_{\text{W}}^{\star}\);
* \(\min f_{S}(\mathbf{x})\) at optimal parameters \(\mathbf{x}_{S}^{\star}\). The convergence of the optimisation process was visualized using convergence plots, depicting the evolution of the best observed function value over iterations. Figure 13 illustrates the convergence behavior of the Bayesian optimisation process for both indicators. The plots demonstrate that the optimization algorithm rapidly approaches near-optimal values within the first 10-15 evaluations and stabilizes thereafter. This confirms that the ensemble-based surrogate models provide not only improved predictive accuracy (Tables 6-9) but also reliable guidance for downstream optimisation tasks, ensuring effective search for energy-efficient operating conditions. This approach offers an efficient, data-driven methodology for determining optimal operating conditions without relying on the explicit physical modelling of the process.