## 2 Materials and Methods
### Application of the Artificial Neural Network  
The artificial neural network (ANN) used in this study, as shown in Figure 2, was a function fitting artificial neural network (MLP) composed of 7 neurons in the input layer (representing voltage, current, active power, power factor, frequency, days, and minutes), 15 neurons in the hidden layer, and 1 neuron in the output layer, representing electricity consumption. The software used for the implementation of the ANN, as well as for obtaining the results, was MATLAB R2024b [18]. After applying the algorithm proposed in [2], it was concluded that the most effective configuration during the validation phase was to use 15 neurons in the hidden layer, with 90% of the samples allocated for training (1336 samples) and 10% for validation (148 samples). This decision was motivated by the significant similarity among the samples, which exhibited common characteristics, justifying the need for a larger number of neurons in the hidden layer. However, increasing the number of neurons beyond 15 led to a deterioration in training performance. Neural networks that use the backpropagation algorithm, like various other types of artificial neural networks, are often perceived as indeterminate. This is due to the lack of clarity regarding why these networks produce certain results, as their predictions lack explicit justifications. Recognizing this limitation, many studies have focused on knowledge extraction from artificial neural networks and the development of explanatory techniques to provide insights into the network's behavior in specific situations [2]. It is important to  
Figure 1: Flowchart of the data collection and processing stage. note that each time the network is retrained, it may produce different results; therefore, it is necessary to save the weight values and, whenever the developed ANN methodology is used, apply the stored weights to generate consistent results. Figure 3 shows the flowchart of the ANN used to estimate energy consumption. The \(\mathrm{Y_{des}}\) and \(\mathrm{Y_{ob}}\) vectors represent, respectively, the desired output obtained from the experiment and the output generated by the ANN. Scaled conjugate gradient backpropagation (SCG) is a training algorithm for neural networks that iteratively adjusts weight and bias values. This method uses the scaled conjugate gradient and is applicable to any network whose weight, net input, and transfer functions have derivatives. Backpropagation is employed to calculate performance derivatives with respect to the weight and bias variables [19]. In this study, SCG was the training  
Figure 3: Flowchart of the ANN used in this work. Figure 2: ANN used in this work (function fitting artificial neural networks). function used. The hyperbolic tangent and linear activation functions used in the hidden and output layers of network are represented in Equations (1) and (2), respectively:  
\[f(u)=\frac{(1-e^{-tu})}{(1+e^{-tu})}, \tag{1}\]  
where \(t\) is an arbitrary constant, corresponding to the slope of the curve. \[f(u)=u \tag{2}\]  
The mean square error (MSE) vector of the neural networks is calculated using (3)  
\[\mathbf{MSE}=\frac{1}{n}\sum_{i=1}^{n}\left(\mathbf{Y_{ob}}-\mathbf{Y_{des}} \right)^{2} \tag{3}\]  
in which \(\mathbf{Y_{ob}}\) and \(\mathbf{Y_{des}}\) are the obtained and desired outputs of the artificial neural network (MLP) compared during the network training, and n is the number of samples. As the MSE, the mean absolute error (MAE) (4) and the mean absolute percentage error (MAPE) (5) were also applied to the performance of the models used. The mean absolute percentage error (MAPE) is one of the most commonly used key performance indicators to measure forecast accuracy. A MAPE below 5% is generally considered very good performance in many applications, indicating that the model is making predictions quite close to the actual values.