## 7 Conclusions  
In this paper, we designed a moisture content detection system for Yinghong No. 9 tea leaves based on machine vision and used the improved BP neural network model to realize the rapid nondestructive detection of the moisture content of Yinghong No. 9 tea leaves. This method for the moisture content detection of Yinghong No. 9 tea leaves changed the traditional detection method and improved production efficiency.  
The PCA and the LDA methods were used to preprocess the data, and the GA and PSO were employed to optimize the BP neural network. After cross-combining and comparing the nine models, it can be concluded that using the GA and PSO algorithms in the optimization algorithm can improve the accuracy of the BP neural network prediction of moisture content. In the preprocessing stage, PCA was more accurate than LDA in predicting the moisture content of the tea leaves. After selecting the three models with the highest accuracy in the test set for comparison, it was found that each index of PCA-PSO-BP was better than that of the other models when the moisture content was higher than 64%, and PCA-GA-BP had fewer outliers and higher accuracy when the moisture content was lower than 64%. Therefore, we combined PCA-GA-BP and PCA-PSO-BP to construct an improved BP neural network model and to predict the moisture content of the Yinghong No. 9 tea leaves.  
On the test set, after comparing the improved BP neural network model and the PLS and SVR models, it was found that the improved BP neural network model was better than the PLS and SVR models in all indicators; therefore, the improved BP neural network model was more suitable for the Yinghong No. 9 tea leaves moisture content detection.  
After verifying the improved BP neural network model, it was found that the model had strong robustness and high accuracy compared with PLS and SVR. Using the verification data, the model predicted that the R\({}^{2}\) of the moisture content was 94.1073%, the RMSE was 1.1490%, and the MAE was 0.9982%, which met the actual production needs.  
The moisture content detection system for Yinghong No. 9 tea leaves based on machine vision used the image recognition method to solve the problems brought by the traditional method of measuring moisture content, which has a positive and guiding significance for promoting smart tea factories.  
Methodology, F.W.; Resources, C.M.; Writing--original draft, B.X.; Writing--review & editing, E.L., B.X. and C.M.; Visualization, C.M.; Project administration, F.W. and E.L.; Software, F.W. and S.M.; Formal analysis, Z.Z., S.M. and C.M.; Investigation, Z.Z., S.M. and C.M.; Funding acquisition, Z.Z.; Validation, S.M.; Supervision, J.G.; Data curation, J.G.; All authors have read and agreed to the published version of the manuscript.  
This research was funded by independent scientific research project of Maoming Laboratory, improve the tea science and technology capabilities of cities and counties to promote industrial development projects, 2019 Provincial Agricultural Science and Technology Innovation and Promotion Project of Guangdong Province, R&D and innovation team for common key technologies of agricultural product fresh keeping logistics under the grant number 2021 ZZ003, 403-2018-XMZC-0002-90, 2021 KJ101 and 2021 KJ145.  
Not applicable.  
The authors declare no conflict of interest.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **R\({}^{2}\) (\%)** & **RMSE (\%)** & **MAE (\%)** \\ \hline Improved BP neural network & 94.1073 & 1.1490 & 0.9982 \\ SVR & 65.9294 & 1.9818 & 1.8604 \\ PLS & 42.1799 & 3.3023 & 2.7059 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Validation metrics for the different models.