# Clover Dry Matter Predictor Based on Semantic Segmentation Network and Random Forest
## 2 Methods
### Experimental Workflow  
The framework illustrated in Figure 1 amalgamates the strengths inherent in both deep learning and machine learning paradigms, culminating in the accurate prognosis of clover dry matter content. The DeepLabv3+ network, revevered as a state-of-the-art model extensively harnessed for tasks entailing semantic segmentation, excels in its capacity to discern semantic information within images. Leveraging its hollow-space convolutional pooling pyramid structure, the network adeptly captures image features across varying scales, thereby exhibiting remarkable proficiency in semantic segmentation undertakings. Through the stratification of image features into high-level and low-level components within the encoder module, this methodology astutely exploits multi-scale features, amplifying its acumen in extracting semantic information from images. This strategic framework not only lays a robust groundwork for the subsequent prediction of dry matter content but also underscores the dynamic synergy between image analysis and predictive modeling.  
Crucially, the program explores how the features extracted by the DeepLabv3+ network in semantic segmentation can be transformed into useful information for dry matter prediction. In this process, firstly by training on a semantic segmentation dataset, the DeepLabv3+ network learns the semantic distribution of different regions in an image and thus extracts rich image features. These features not only contain information about the appearance of the object, but also capture the relationship between the object and its surroundings.  
Subsequently, using the extracted features, this paper designs a dry matter prediction model. The key part of this model is the random forest model, which is widely used in the machine learning field for regression and classification tasks. By learning the relationship between features and dry matter content on a training dataset, the random forest model is able to build a mapping from the features of an input image to the corresponding dry matter content. This predictive model building process is essentially a learning process that allows the model to generalize to unseen images and accurately predict the dry matter content of clover.  
Here, the framework of the dry matter predictor based on DeepLabv3+ and random forests can be summarized as Algorithm 1.  
```
Input: The target sample at the clover image \(X[x,y]\); Output: Predicted dry matter of clover M; Segmented image of clover; for each \(t\) ranging from 1 to the last clover image \(N\)  1. Image preprocessing, standardization, resize;  2. Implementing encoder feature extraction on the basis of the upper part of Figure 2;  3. **Introduction of feature extraction network for SE**  4. Implementing a featured decoder based on the bottom half of Figure 2;  5. Implementing pixel-level segmentation of clover images, counting the number of pixels;  6. Number of pixels combined with real dry matter to construct random forest models;  7. **Constructing a Random Forest Regression Model**  8. Construct a random forest regression based on Figure 5;  9. Predict dry matter in target image; endfor
```  
**Algorithm 1** Dry matter predictor based on DeepLabv3+ and random forests