# Tomato Maturity Estimation Using Deep Neural Network
## 4 Results and Discussion
### Maturity Estimation  
The data distribution in each class was learned implicitly using the mean-variance loss, and the tomato maturity for the input images was evaluated as an expected value between 0 and 1. Figure 6 shows the classification results visually, by class, as well as the maturity classification and estimation results. The general classification results were also expressed as the generalized maturity between 0 and 1, where the four maturity stages were matched to approximately 0, 0.33, 0.67, and 1.00 for the green, turning, pink, and red stages, respectively. The white circles indicate the correctly classified samples, the orange circles indicate the incorrectly classified samples, and the box with a dashed boundary line indicates the area equally divided into the four areas of the maturity range. The classification results provide the discrete maturity levels, where the samples were only mapped into one of the four classes, although they also have a continuous color range in each class. Furthermore, some of the incorrectly classified samples had maturation statuses close to the boundary between two maturity stages, making it more difficult to treat them as misclassifications. However, the right part of the figure shows the continuous maturity estimation performance in this study, and the distributions of the samples in each class were observed (expressed within the same class or maturity stage) according to the overall color and red occupancy of the tomato surface. In the intermediate maturity, turning, and pink stages, estimated maturities were distributed widely (over 70% over the entire range), thus affecting the increase in false-negative (FN) samples, which was related to the recall performance. The maturity stages at both ends (green and red) showed that the distribution had only a single-sided boundary with other maturity stages; thus, the performance in these stages was relatively high. This distribution in each class and for incorrectly classified \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Maturity Class** & **Accuracy** & **Recall** & **Precision** & **F1 Score** \\ \hline Green & 0.98 & 0.98 & 0.91 & 0.94 \\ Turning & 0.98 & 0.77 & 0.94 & 0.85 \\ Pink & 0.95 & 0.83 & 0.92 & 0.87 \\ Red & 0.97 & 0.98 & 0.95 & 0.97 \\ \hline Average & 0.97 & 0.89 & 0.93 & 0.91 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Classification performance analysis of tomato maturity estimation model. Figure 5: Confusion matrix for tomato maturity classification. samples could be due not only to the continuous maturity characteristics of tomato growth, but also the mislabeled data caused by various factors such as the ambiguity of the image itself, capture conditions, the annotator's proficiency, and the number of classes used in model training. For this reason, it is difficult to verify the maturity stages presented in these results; thus, the validity of continuous maturity estimation was evaluated using an indirect method, as detailed in the following results. Figure 7 shows a comparison of the distribution between estimated maturity and hue value for the test samples, where the results are expressed by class. In a previous study, hue value in the HSV color model was shown to have a high linear correlation with the accumulated temperature, with a coefficient of determination (R\({}^{2}\)) of 0.96 [20]. The accumulated temperature is the integrated excess of the deficiency in temperature for fixed data, which is usually used in crop growth modeling [28]. It is hard to validate estimated maturity using the actual value, as this is hard to provide due to the ambiguity of the maturity; thus, we compared our results with the hue value of relevant input samples, referring to the above studies. In particular, the hue value was averaged over the tomato area in the images, and the value was normalized to the range of 0-1. Each graph consists of a probability distribution, expressed as both a histogram and a Gaussian distribution.