# Food Classification and Meal Intake Amount Estimation through Deep Learning
## 4 Simulation  
### Simulation Results  
We measure the accuracies of the food type classification and the meal intake amount by the trained Mask R-CNN. In the training of Mask R-CNN, the batch size is set as 64 and the epochs are set as 10,000, 30,000, 50,000, and 70,000. The performances of the proposed method are measured through 65 images with 206 food objects. In addition, Mask R-CNN and YOLOv8 [37] are applied as the food detection network to compare the performances of the proposed method.  
The accuracies of the food existence detection and the food type classification are measured as shown in Table 3. The accuracy of the food existence increases as the epochs increase up to 50,000. All foods are detected with Mask R-CNN trained over 50,000 epochs. The accuracy of the food type classification is improved up to 97.57% until the food detection network is trained with 50,000 epochs. The accuracy of the food type classification hardly increases from the epochs greater than 50,000. Mask R-CNN is better than YOLOv8 for the food existence detection and the food type classification.  
Figure 9: 3D food model for proposed method: (**a**) spherical cap; (**b**) cone.  
Table 4 shows the accuracies of the food type classification by the food categories through Mask R-CNN trained with 50,000 epochs. All foods in the rice category are accurately classified. However, some of the foods in the soup and the side-dishes categories are misclassified as different food types within the same category. The food detection network occasionally classifies foods as different food types with similar color.  
The accuracies of the food region detection are measured by calculating intersection of union (_IoU_) as follows:  
\[IoU=\frac{n(g\cap d)}{n(g)+n(d)-n(g\cap d)} \tag{13}\]  
where \(g\) and \(d\) are the ground truth and the detected regions, respectively. Figure 10 shows the accuracies of the food area detection. Similar to the food type classification, the accuracy of the food area detection is also increased up to 93.6% until the food detection network is trained with 50,000 epochs. Mask R-CNN is also more accurate than YOLOv8 for the food area detection.  
Figure 11 shows the images of the meal plates with average meal intakes of about 40%, 80%, and 90% for the food, respectively. The meal intake amounts for Figure 11  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Food Category** & **No. of Total Objects** & \
\begin{tabular}{c} **No. of Detected** \\ **Objects** \\ **(Accuracy \%)** \\ \end{tabular} &
\begin{tabular}{c} **No. of Correct** \\ **Classification** \\ **(Accuracy \%)** \\ \end{tabular} \\ \hline Rice & 63 & 63 (100\%) & 63 (100\%) \\ Soup & 18 & 18 (100\%) & 17 (94.44\%) \\ Side-dish & 94 & 94 (100\%) & 89 (94.68\%) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Performance of food type classification by food categories.  
Figure 10: Accuracies of food area detection with comparison between Mask R-CNN and YOLOv8.  
are estimated through the proposed method as shown in Table 5. The proposed method estimates the meal intake amounts closely to the actual amounts for most foods except the soup category. For foods in the soup category, the estimated intake amounts are smaller than the actual. The soup bowl has a small curvature, that is, a large slope. Therefore, the change in the food area is excessive small compared to the decrease in the food volume.