**2.2 Application to predict the drainage from waste rock storage**

The schematic of the proposed feedforward neural network structure is illustrated in **Figure 1**. As mentioned above, hydrologic properties and geo-bio-chemical conditions in waste rock storages are generally considered as a very slow evolution, which means they are relatively stable compared with weather conditions such as rain, snow and temperature in the field. The dynamics of weather conditions are powerful to act as driving input forces for the training process, leaving hydrologic properties and geo-bio-chemical conditions as coefficients within neural network to be determined during learning process. As the temperature controls not only the formation of rain/snow but also evaporation rate on the surface, total precipitation and mean temperature are then selected as two groups of neurons in the input layer. Current and preceding total precipitation and mean temperature are extracted from the weather monitoring database, then they are formatted into a time series in the input layer before entering the hidden layer. The length of time series determines the neuron number in each group of the input layer. For example, an input including previous 10 daily weather monitoring data indicates 10 neurons for previous daily total precipitation and 10 neurons for previous daily mean temperature in the input layer.

An additional neuron in the input layer is composed of a time tag that represents the drainage measurement day. For example, the day with first weather monitoring data is considered as the first day, and the corresponding time tag is set to 1. Any future time tag for one drainage measurement is the accumulated day number adding from the first day to the measurement day. By introducing the concept of accumulated day number as the time tag, the geo-bio-chemical evolutions inside the waste rock storages no longer have to keep constant in the temporal scale, and become potentially time dependent. Thus this hybrid input structure enables the proposed neural network to capture the long-term trend of the drainage flow rates and drainage chemistries.

The output can be calculated by moving forward in the neural network based on Eq. (1). After the output is obtained, it is compared with drainage monitoring data (target) including flow rate and chemistry concentration. A cost function is then adopted to evaluate the difference between output and target. In this study, the mean squared errors (*MSE*) is used as the cost function, which is the average squared difference between calculated outputs and the target. The calculation of *MSE* is as follows,

**105**

performance.

*The Application of Artificial Neural Network to Predicting the Drainage from Waste Rock…*

( )

*i i*

(2)

(6)

= = − ∑ **<sup>2</sup> 1 1** *<sup>m</sup>*

where *<sup>i</sup> o* is the *i* th calculated output, *<sup>i</sup> t* is the *i* th target, and *m* is the number

*i MSE o t m*

As both of input and target data are different in terms of their scales, it is generally required to pre-process them to become normalized before the training starts. The normalization could accelerate the training process by making all undetermined coefficients in the neural network get updated in the same scales. For this study, the mean for each data set (total precipitation, mean temperature, flow rate, chemistry concentration) is set to 0 and the standard deviation is set to 1. The

> = =∑**1** / *n i i*

( ) <sup>=</sup> = − ∑ **<sup>1</sup>** / *<sup>n</sup>*

where *x* and *s* is the mean and standard deviation for the data set of *x* . *n* is the total number of data in the set, denotes Hadamard division, and *y* is the

In the beginning, all coefficients within the neural network shown in Eq. (1) are randomly initiated. During the training process, they are automatically updated through a special data iteration technique called backpropagation algorithm, which calculates the gradient of the cost function based on comparing target with output. The proposed feedforward neural network should be trained with a fair amount of observation samples from historical monitoring database so that it can capture the correlation between input data and target data. Here an observation sample is defined as a combination of input and target from historical monitoring database. The training needs assessment to prevent both of underfitting and overfitting with various validation methods. The hold-out approach is adopted in this study. Among all observation samples, the training observation samples are those for actual training, the validation observation samples are for evaluating the generalization of the neural network and the training process continues until the generalization does not get improved, and the rest are called testing observation samples which do not impact on the training process but give independent assessment for the training

After the training is completed, both of *MSE* and *R* are used to estimate the training performance. Here *R* value measures the correlation between calculated results (output) and measured ones (target), which is calculated as follows,

∑ × −∑ ∑ <sup>=</sup>

*R*

( ) ( )( )

*m ot o t*

*mo o mt t*

∑ −∑ ∑ −∑ **2 2 2 2**

( ) ( )

*x xn* (3)

*<sup>i</sup> <sup>i</sup> s x xn* (4)

*y xx s i i* = − ( ) (5)

*DOI: http://dx.doi.org/10.5772/intechopen.96162*

of the target for machine learning.

normalization of *x* .

normalization is obtained by following calculations:

**Figure 1.**

*The proposed feedforward neural network structure.*

*The Application of Artificial Neural Network to Predicting the Drainage from Waste Rock… DOI: http://dx.doi.org/10.5772/intechopen.96162*

$$\text{MSE} = \frac{\mathbf{1}}{m} \sum\_{i=1}^{m} \left(\mathbf{o}\_{i} - \mathbf{t}\_{i}\right)^{2} \tag{2}$$

where *<sup>i</sup> o* is the *i* th calculated output, *<sup>i</sup> t* is the *i* th target, and *m* is the number of the target for machine learning.

As both of input and target data are different in terms of their scales, it is generally required to pre-process them to become normalized before the training starts. The normalization could accelerate the training process by making all undetermined coefficients in the neural network get updated in the same scales. For this study, the mean for each data set (total precipitation, mean temperature, flow rate, chemistry concentration) is set to 0 and the standard deviation is set to 1. The normalization is obtained by following calculations:

$$\overline{\mathfrak{X}} = \sum\_{i=1}^{n} \mathfrak{x}\_i \nmid n \tag{3}$$

$$s = \sqrt{\sum\_{i=1}^{n} \left(\mathfrak{x}\_i - \overline{\mathfrak{x}}\right) / n} \tag{4}$$

$$\mathbf{y}\_i = \left(\mathbf{x}\_i - \overline{\mathbf{x}}\right) \oslash \mathbf{s} \tag{5}$$

where *x* and *s* is the mean and standard deviation for the data set of *x* . *n* is the total number of data in the set, denotes Hadamard division, and *y* is the normalization of *x* .

In the beginning, all coefficients within the neural network shown in Eq. (1) are randomly initiated. During the training process, they are automatically updated through a special data iteration technique called backpropagation algorithm, which calculates the gradient of the cost function based on comparing target with output. The proposed feedforward neural network should be trained with a fair amount of observation samples from historical monitoring database so that it can capture the correlation between input data and target data. Here an observation sample is defined as a combination of input and target from historical monitoring database. The training needs assessment to prevent both of underfitting and overfitting with various validation methods. The hold-out approach is adopted in this study. Among all observation samples, the training observation samples are those for actual training, the validation observation samples are for evaluating the generalization of the neural network and the training process continues until the generalization does not get improved, and the rest are called testing observation samples which do not impact on the training process but give independent assessment for the training performance.

After the training is completed, both of *MSE* and *R* are used to estimate the training performance. Here *R* value measures the correlation between calculated results (output) and measured ones (target), which is calculated as follows,

$$\mathcal{R} = \frac{m(\boldsymbol{\Sigma}\boldsymbol{o} \times \mathbf{t}) - (\boldsymbol{\Sigma}\boldsymbol{o})(\boldsymbol{\Sigma}\boldsymbol{t})}{\sqrt{\left[m\boldsymbol{\Sigma}\boldsymbol{o}^{2} - \left(\boldsymbol{\Sigma}\boldsymbol{o}\right)^{2}\right] \left[m\boldsymbol{\Sigma}\boldsymbol{t}^{2} - \left(\boldsymbol{\Sigma}\boldsymbol{t}\right)^{2}\right]}} \tag{6}$$

*Deep Learning Applications*

input layer.

and drainage chemistries.

*MSE* is as follows,

**2.2 Application to predict the drainage from waste rock storage**

The schematic of the proposed feedforward neural network structure is illustrated in **Figure 1**. As mentioned above, hydrologic properties and geo-bio-chemical conditions in waste rock storages are generally considered as a very slow evolution, which means they are relatively stable compared with weather conditions such as rain, snow and temperature in the field. The dynamics of weather conditions are powerful to act as driving input forces for the training process, leaving hydrologic properties and geo-bio-chemical conditions as coefficients within neural network to be determined during learning process. As the temperature controls not only the formation of rain/snow but also evaporation rate on the surface, total precipitation and mean temperature are then selected as two groups of neurons in the input layer. Current and preceding total precipitation and mean temperature are extracted from the weather monitoring database, then they are formatted into a time series in the input layer before entering the hidden layer. The length of time series determines the neuron number in each group of the input layer. For example, an input including previous 10 daily weather monitoring data indicates 10 neurons for previous daily total precipitation and 10 neurons for previous daily mean temperature in the

An additional neuron in the input layer is composed of a time tag that represents the drainage measurement day. For example, the day with first weather monitoring data is considered as the first day, and the corresponding time tag is set to 1. Any future time tag for one drainage measurement is the accumulated day number adding from the first day to the measurement day. By introducing the concept of accumulated day number as the time tag, the geo-bio-chemical evolutions inside the waste rock storages no longer have to keep constant in the temporal scale, and become potentially time dependent. Thus this hybrid input structure enables the proposed neural network to capture the long-term trend of the drainage flow rates

The output can be calculated by moving forward in the neural network based on Eq. (1). After the output is obtained, it is compared with drainage monitoring data (target) including flow rate and chemistry concentration. A cost function is then adopted to evaluate the difference between output and target. In this study, the mean squared errors (*MSE*) is used as the cost function, which is the average squared difference between calculated outputs and the target. The calculation of

**104**

**Figure 1.**

*The proposed feedforward neural network structure.*

**Figure 2.**

*The functions of the proposed feedforward neural network.*

Theoretically, the lower value for *MSE* and the closer to 1 for *R*, the better training performance.

In theory, a well-trained neural network proposed in this study is able to reasonably predict future drainage flow rate and drainage chemistry concentration for full-scale waste rock storages as long as the historical weather monitoring database, historical drainage monitoring database and the weather forecast onsite are available. **Figure 2** shows the schematic diagram of the general functions for the proposed feedforward neural network approach. There are two processes involved in the implementation of the approach. After the training processed is completed, the correlation between weather and drainage for the waste rock storage is believed to be captured by the proposed neural network, and then the prediction process starts to utilize weather forecast to predict future drainage on site.
