# Clover Dry Matter Predictor Based on Semantic Segmentation Network and Random Forest
## 3 Experiments
### Experimental Results of Dry Matter Prediction  
The model trained in the DeepLabv3+ network was used on the dry matter prediction dataset to perform pixel-level segmentation of clover images to obtain semantic information and count the pixels in the image for dry matter information prediction. For the regression fitting of random forest, we carried out two scenarios here: Scheme 1: use all the data in the dataset to construct the random forest fitting model; Scheme 2: in order to show the feasibility of this model in practical applications and to test its generalization performance, the dataset was partitioned into distinct training and test sets, distinguished by an 8-2 ratio, for training as well as validation of the model. According to Figure 1, we constructed a complete dry matter prediction model using the DeepLabv3+ network to output the pixel values of the categories, and processed these statistics by constructing a random forest regression model to further mine the association and contextual information between the categories, as well as between the categories and the dry matter content. We used the root mean square error (RMSE), and the mean absolute error (MAE) for the assessment of the predicted values. It is calculated as where y is the true dry matter content value and is the predicted value predicted by the model. \[RMSE=\sqrt{\frac{1}{N}\sum_{t=1}^{N}{(y-\hat{y})^{2}}} \tag{5}\]  
\[MAE=\frac{1}{N}\sum_{t=1}^{N}{|y-\hat{y}|} \tag{6}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Size** & **mPrecision** & **mIoU** & **mPA** \\ \hline MobileNetV2 & 22.4 MB & 83.69\% & 71.15\% & 82.20\% \\ Xception & 209 MB & 81.82\% & 66.93\% & 78.48\% \\ MobileNetV3 & 15.7 MB & 79.71\% & 64.92\% & 77.81\% \\ MobileNetV2 + SE & 23.2 MB & 85.37\% & 73.50\% & 83.85\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance comparison of DeepLabv3+ across different backbone networks. Figure 9: Local pixel enlargement of each model. DeepLabV3+, built by MobileNetv2+SE, has a clearer recognition boundary and better recognition accuracy in terms of segmentation performance. The random forest linear fitting of the complete dataset has a very high fitting performance, with a considerable improvement in the RMSE as well as the MAE in all categories compared to the collinear first-order linear model designed by [PERSON] et al. The random forest model is able to capture nonlinear relationships by integrating the results of multiple decision trees, and is able to better model complex nonlinear functions, with good performance capabilities in mapping from image pixel values to dry matter content. The training results are shown in Table 3. The comparison of the predicted dry matter scores with the true values obtained is shown in Figure 10.  
In Scheme 2, 80% of the 261 samples are selected as the training set, and 20% of the data are used as the test set, and the random forest regression model for dry matter prediction is reconstructed, and the performance of the test set is shown in Table 4, which shows that, relative to the collinear line, there is a certain degree of improvement in the performance, except for the grass class. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **Grass** & **White Clover** & **Red Clover** & **Clover** & **Weeds** \\ \hline RMSE [\%] & 16.26 & 4.05 & 3.92 & 2.94 & 3.47 \\ MAE [\%] & 10.76 & 3.00 & 2.44 & 2.11 & 2.58 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Scheme 2: Training performance of dry matter prediction on random forest models. Figure 10: Scheme 1 Plot of the points of fit between the true dry matter mass fraction and the predicted mass fraction, and its second-order fit curve.