# Prediction of Grain Porosity Based on WOA-BPNN and Grain Compression Experiment
## 5 Analysis of Prediction Results
### Experimental Validation of the WOA-BPNN for Porosity Prediction Model
#### 5.3.2 Comparison of Predicted and Experimental Results  
The experimental data on wheat piles from the grain cell box experiment were input into the developed WOA-BPNN model for prediction. A comparison between the model's prediction results and the experimental results is presented in Figure 13. As depicted in the figure, the porosity predicted by the WOA-BPNN model was slightly lower than the porosity in the grain cell box experiment. Both the predicted and experimental porosity values gradually decreased with increasing vertical pressure. The model prediction and experimental values were fitted to obtain two curves. The trend of these two curves was essentially the same, and the difference between the two in the longitudinal coordinates was approximately constant. The initial porosity predicted by the WOA-BPNN model and the initial porosity measured in the grain cell box experiment were 0.418 and 0.429, respectively, differing by only 2.56%. When the vertical pressure was 150 kPa, the WOA-BPNN model predicted a porosity of 0.373, while the porosity measured by the grain cell box experiment was 0.389, resulting in a difference of only 4.11%.  
According to Equations (17) to (20), the R\({}^{2}\) between the predicted values of the WOA-BPNN model and the experimental values of the grain cell box was found to be 0.9928. The RMSE was 0.0139, the MAE was 0.0137, and the MAPE was 3.3917%. These results indicate that the WOA-BPNN model in this study had high prediction accuracy and a good training effect. It also indicates that the error between the model's predicted values and the experimental values was within the permissible range. This suggests that the WOA-BPNN model can be used to predict the porosity in the grain cell box, demonstrating its strong generalization ability. The feasibility of using the WOA-BPNN model to predict the porosity of a grain pile was confirmed by comparing the results of the WOA-BPNN model with those of the grain cell box experiment.  
According to the variation rule depicted in Figure 13, the data were fitted using OriginPro version 2021 software to determine the relationship between the porosity of the wheat pile and the vertical pressure. The fitting formula is:  
\[n=n_{0}+ap_{v}^{b} \tag{21}\]  
where \(n\) is the porosity of the grain cell, \(p_{v}\) is the vertical pressure on the top surface of the grain cell in kPa, \(n_{0}\) is the porosity of the grain cell when the vertical pressure is 0 kPa, and  
Figure 12: Grain cell box experiment: (**a**) Experimental equipment; (**b**) Loading schematic.  
\(a\) and \(b\) are the parameters to be fitted. The parameters obtained by fitting are shown in Table 6.  
From Table 6, it can be seen that the parameter a values of the wheat heap porosity expressions obtained from the WOA-BPNN model and the grain cell box experiment were approximately equal, and the parameter b values did not differ much. This indicates that the fitting curves obtained from these two methods had a similar trend of change. The results demonstrate that the WOA-BPNN model can accurately predict the porosity of the larger-sized (600 mm \(\times\) 600 mm \(\times\) 600 mm) grain cell under varying vertical loads.