# Prediction of Grain Porosity Based on WOA-BPNN and Grain Compression Experiment
## 6 Conclusions  
In this paper, three hybrid models (GA-BPNN, PSO-BPNN, and WOA-BPNN) and two classical models (BPNN and RF) were established to predict the porosity of grains using machine learning algorithms with data from the experiments and collected data. The prediction results of the five models were compared using four evaluation indices. The generalization ability of the best prediction model was verified by conducting the grain cell box experiment. The following conclusions can be drawn:  
(1) All three hybrid models in this study significantly outperformed the BPNN model and the random forest model in predicting porosity. (2) The prediction accuracies of the five machine learning models were, in descending order, the WOA-BPNN model, GA-BPNN model, PSO-BPNN model, BPNN model, and RF model. Among them, the WOA-BPNN model exhibited the best overall performance among the three hybrid models and two single models. (3) The generalization ability of the WOA-BPNN model was verified through the grain cell box experiment, and the model's prediction results were largely consistent with \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Methods for** & \(a\) & \(b\) & \(n_{0}\) & \(\text{R}^{2}\) **(Curve Fitting)** \\ \hline WOA–BPNN model & \(-\)0.0011 & 0.7509 & 0.418 & 0.9968 \\ \hline Grain cell box experiment & \(-\)0.0014 & 0.6736 & 0.429 & 0.9973 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Values of each fitted parameter in the equation for wheat pile porosity. Figure 13: Predicted porosity values from the WOA–BPNN model vs. grain cell box experiment values. Note: \(\text{R}^{2}\) in the figure represents the coefficient of determination for curve fitting. the experimental results. This indicates that the model can be used to predict the porosity of a grain cell with a larger size (600 mm \(\times\) 600 mm \(\times\) 600 mm), demonstrating the strong generalization ability of the WOA-BPNN model. (4) Based on the prediction results of the WOA-BPNN model and the findings of the grain cell box experiment, an equation describing the relationship between the porosity of wheat and the vertical pressure of the grain pile was derived through additional analysis and data fitting. In this study, the grain porosity prediction model based on the WOA-BP algorithm, obtained through big data training, could provide the porosity of a specific grain type promptly when the water content and vertical pressure are known. Under the condition that the distribution of the bulk pressure of the grain pile in the silo and the water content are known, the distribution pattern of the porosity of the grain pile in the silo can be determined over time. The porosity distribution law of the grain pile in a grain silo is fundamental to several key research problems. More accurate results or conclusions can be derived by considering the actual distribution law of porosity. In the study of mechanical ventilation in grain silos as well as the temperature field, humidity field, and multi-field coupling of grain piles, previous studies typically treated the grain piles as a homogeneous medium and considered the porosity as a constant value. However, in fact, the porosity in the grain pile is spatially variable. Based on the grain porosity prediction model obtained in this study, we can first determine the distribution pattern of grain pile porosity in the silo. Based on the distribution law of grain pile porosity in the grain silo, more accurate results or conclusions can be obtained for the aforementioned research issues. For instance, analyzing the distribution of wind resistance in the grain pile during mechanical ventilation can help guide grain custodians in conducting mechanical ventilation to enhance ventilation efficiency and effectiveness. Conceptualization, J.C. and J.L. ; Methodology, J.C. and J.L. ; Software, J.L. ; Validation, J.L., Q.Z. and J.Z. ; Formal analysis, J.C. and J.L. ; Investigation, J.L. and Q.Z. ; Resources, J.C. and D.Z. ; Data curation, J.L. and C.L. ; Writing--original draft preparation, J.L.