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

temperature, maximum temperature, mean temperature, total rain, total snow, total precipitation and snow thickness on ground, etc. For this case study, the total 16 years weather monitoring data have been obtained for the training purpose. As mentioned in the previous section, two independent weather parameters measured on a daily basis - the total precipitation and mean temperature are selected as the inputs for the proposed neural network.

To evaluate how long the weather can impact on the drainage from this waste rock pile, two types of input layers are proposed for comparison in the study. When a target (flow rate or acidity) is selected to train the neural network, its measurement date is extracted. Daily average input layer consists of 21 neurons including the time tag of measurement day, daily total precipitation and daily mean temperature from previous 9 days and the measurement day, which mainly investigates short-term weather impact on the drainage. Furthermore, weekly average input layer has 21 neurons including the time tag of measurement day, weekly average total precipitation and weekly averaged mean temperature from previous 9 weeks and current week to investigate long-term weather impact. The weekly average input layer reflects longer weather monitoring data than the daily average input layer does, however, high frequent information is filtered in the weekly average input layer. The summary of daily average and weekly average input layers can be found in **Table 1**. Here 0 day means the measurement day, 0 week means measurement day and previous 6 days. Finally, both types of input layers are adopted to train the neural network to determine which input layer is more competent to capture the underlying pattern and make a better prediction.

As the mine site is anonymous, the original monitoring data is confidential and not publicly accessed. To protect the site information, only normalized historical monitoring data including total precipitation, mean temperature, flow rate and acidity from the 16 years are provided in **Figure 3**. Total numbers of flow rate measurement and acidity measurement during the 16 years is 1741 and 320, respectively. It should be noticed that the weather data are extracted on a daily basis and any missing data is represented by a gap. The flow rate and acidity is not measured in a fixed time frame and the time interval is dynamic, so each measurement data is represented by a solid dot in the figure. As some weather data are missing, not all of drainage measurements are utilized for the training. Those drainage measurements that do not have a complete daily average or weekly average input will be excluded. In terms of the hold-out approach to avoid overfitting, 80% of the total observation samples are used for training and 20% for validation. No testing data is allocated


**Table 1.**

*Description of daily average and weekly average input layers.*

*Deep Learning Applications*

ing performance.

**Figure 2.**

**3. Validation-a case study**

Theoretically, the lower value for *MSE* and the closer to 1 for *R*, the better train-

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 validate the proposed neural network approach, a full-scale case study is performed to predict real drainage flow rate and drainage chemistry in field condition. A real waste rock pile from an anonymous mine site in western Canada is adopted in this study. The proposed neural network is trained by historical monitoring data for 16 years (Year 1 to Year 16). After the training is completed, it will be used to predict the drainage in the next 2 years (Year 17 and Year 18). A comparison between real

At this mine site, the drainage flow rates are not directly measured but they are calculated based on readings of the water level in v-notch weirs installed at the end of the drainage collecting ditch. Thus the v-notch is used as the one actual target of neural network training. In the following discussion, the drainage flow rate actually refers to the original measurement of v-notch from the weirs. Among all drainage chemistry data from this waste rock pile, acidity is selected for this case study as another target, because it is directly linked to the lime consumption for contaminant treatment. These drainage measurement are generally performed in a dynamic time frame at this mine site. During spring freshet and large precipitation periods, the measurements are usually more frequent than the remaining time in a year, as

The weather monitoring data at this site is extracted from the website of Environment Canada (weather.gc.ca) on a daily basis, including minimum

to utilize weather forecast to predict future drainage on site.

**3.1 Input, target and neural network parameters**

*The functions of the proposed feedforward neural network.*

measurement and predicted value will be provided.

increased drainage flow rate is observed.

**106**

**Figure 3.**

*Normalized monitoring data for the 16 years (year 1 to year 16). (a) Year 1 to year 4; (b) year 5 to year 8; (c) year 8 to year 12 and (d) year 13 to year 16.*

**109**

**Table 2.**

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

in the training process, as a prediction of the drainage in the next 2 years will be performed after the training is completed. As the monitoring data of weather and drainage during the next 2 years are also available. The real weather data will be utilized as the input of the neural network. In real situation, weather forecasting data should be adopted for prediction purpose. The predicted drainage flow rates

After the training is completed, all training and validation observation samples go through Eq. (1) again and then the calculated output is called drainage regression. The *MSE* and *R* between drainage regression and real measured ones (targets) are listed in **Table 2** based on a grid search is performed on both of daily average input layer and weekly average input layer with 5, 10 and 20 neurons in the hidden layer. It is observed that results from the neuron network with weekly average input layer are generally better than those obtained from the neuron network with daily average input layer, indicating that both of flow rate and acidity from this waste rock pile are mainly controlled by long-term weather trend rather than short-term one. For flow rate regression, the lowest *MSE* is obtained from both of 10 and 20 neurons in hidden layer, so the neuron network trained by weekly average input layer with 10 neurons in hidden layer is selected as the successful candidate to predict future drainage flow rates as it has smaller size and less undermined coefficients than the network with 20 neurons in the hidden layer. For acidity regression, the lowest *MSE* is obtained from the neuron network with weekly average input layer and 20 neurons in the hidden layer, which is selected to

> **Daily Average**

5 1.01, 0.62 0.25, 0.93 0.53, 0.65 0.35, 0.78 10 0.99, 0.63 0.18, 0.95 0.55, 0.65 0.41, 0.79 20 0.92, 0.67 0.18, 0.95 0.58, 0.67 0.28, 0.84

**Flow Rate (***MSE, R***) Acidity (***MSE, R***)**

**Daily Average**

**Weekly Average**

**Weekly Average**

As shown in the **Figure 1**, only a single hidden layer is in the feedforward neural network adopted for this case study. So the number of neurons in the hidden layer is considered as a hyperparameter for the training process. A grid search is performed on 5, 10 and 20 neurons in the hidden layer to find the optimized size. The proposed neural network is trained through Levenberg–Marquardt backpropagation algorithm. The adaptive value (damping factor) is set to 0.001 initially, and will increase by 10 until the change of above results in a reduced performance value. The change is then made to the network and adaptive value is decreased by 0.1. The maximum adaptive value is set to 1e10. The maximum epochs before the stop of training is set to 1000. However, the training may be stopped early if the *MSE* on the validation vectors stops to improve or remains the same for 6 epochs in a row. The proposed neural network is implemented through the machine learning toolbox built in commercial software MATLAB. The weather monitoring data are pre-constructed for both types of input layer through Microsoft Excel Macro before

and acidities will be compared with the real monitoring values.

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

exporting into the MATLAB.

**3.2 Regression and prediction results**

predict future drainage acidities.

**Number of Neurons in the** 

**Hidden layer**

*Results of the grid search.*
