# An ANN Model for Predicting the Compressive Strength of Concrete
## 4 The Results  
There are 482 data in the database. We separate the database into two sets, the training set and the testing set, respectively. The training set includes 85% of the data. Therefore, the training set comprises 410 samples and the testing set comprises 72 samples. Samples included in the testing set are marked in the Appendix A. Artificial neural networks with 3-12 neurons in the hidden layer are tested. More neurons in the hidden layer mean the ANN is more complicated so it can memorize more detailed features. However, it also means the result of the ANN has a tendency towards over-fitting. Furthermore, too many repetitions of the training iteration will also make the ANN memorize too many detailed features and perform poorly when it is in practical use. A time of iteration indicates all the synaptic weights and the thresholds are updated according to the error residual in the training set. To help us detect whether over-fitting or over-training happens, both the root-mean-square errors of the training set and the testing are calculated after finishing each iteration. The values of the thresholds and the synaptic weights are also temporarily saved so we can come back to use them when we have selected a suitable ANN structure and have determined the proper iteration times. The root-mean-square error is defined as:  
\[E_{r.m.s.}=\sqrt{\left(\eta^{(d)}-\eta^{(o)}\right)^{2}} \tag{10}\]  
where the overbar represents the average in the data set. Note that the numbers of samples in the two data sets are different. Among all the training results, we chose the results of 3, 7, and 12 neurons in the hidden layer to demonstrate the features of over-fitting and over-training. They are shown in Figure 2. It can be observed that the root-mean-square error of the training set decreases as more iterations are processed, but it does not happen to the testing set. This demonstrates the effect of over-training. One can also find that setting more neurons in the ANN can help reduce the root-mean-square error of the training set. But the root-mean-square error of the testing set seems to not go the same way as more and more neurons in the hidden layer are comprised. This indicates that setting more neurons in the hidden layer tends to cause over-fitting. With the results shown in Figure 2, we suggest that setting 7 neurons in the hidden layer is sufficient for the ANN in this study. It is worth noting that the ANN in [16] has 14 neurons in the hidden layer. The thresholds and the synaptic weights of the 7-hidden-neuron ANN with 12,040 times of training iteration are used for further investigations. This is chosen for the reason that the root-mean-square errors of the training set and the testing set are equivalent to each other. The synaptic weights from the input layer to the hidden layer and the thresholds of the hidden neurons are listed in Table 2. The synaptic weights from the hidden layer to the output neuron and the threshold of the output neuron are shown in Table 3. With these thresholds and synaptic weights, the predicted outputs are calculated and compared with their desired values. The comparison is shown in Figure 3. It can be found that the results of the two data sets have similar divergence. That is because the root-mean-square errors of the two sets are very close. It is also worth noting that in [16] the result of such comparison looks very close to a central inclined line which represents the predicted are exact to their targets.