Week 5 — DeepNutrition: Be Aware Of Your Macronutrients

Muhammed Aydoğan
bbm406f19
Published in
3 min readDec 31, 2019

Facilitating the dietary assesment process by detecting multiple foods from a single image

Hello Everyone,
In our last blog we have talked about neural networks,convulational neural networks and also we have mentioned different variations of CNN models.
This week we have implemented some of the models to test which gives best result for our problem. We have ran some experiments on our data. We will demonstrate the results we got during these experiments.

One of the models We have decided to use is GoogleNet(Inception).

GoogleNet is a complex model as we learned from our teacher Aykut Erdem. But it came first in ImageNet 2014. So we have decided to use that. GoogleNet has different versions, we have decided to use Inception3 in our experiment. If you want to learn more about GoogleNet you can check our last weeks blog here.

At first we have decided to use all of our data but during execution, we saw that it takes too much time because our data is 5GB and it has 101000 images, each image is 512x512 and it has 101 labels.
We are using Google Colab but even Google Colab was not enough so we have decided to resize our data, run on mini version of our data. For this experiment we have decided to use 11 label, 299x299 images, and batch size of 16 we have also run 10 epoch and training / batch size number of steps in our each epoch.(Each epoch was taking more than one our using our full data)

Our training with Inception3 started with 0.3289 accuracy, 0.6743 validation accuracy and ended in 0.8942 accuracy, 0.9346 validation accuracy after 10 epoch.This is our result.

Inception3 test results with 11 class. (batch size=16, epoch=10 and picture size=299x299)

The reason why Inception3 and ResNet50 starts with high accuracy is it uses pre-trained model using ImageNet.

ResNet50 test results with 11 class. (batch size=16, epoch=10 and picture size=299x299)

As you can see above ResNet50’s loss values and validation accuracy is not stable for now. There must be an easy mistake. We will focus on this and figure out what was happenned.

VGG16

VGG16 gave 0.52 accuracy in 50epohcs. Its accuracy is bad for 50 epoch but its accuracy increases monotonically by epoch. Maybe we will try VGG16 again when we evaluate the models with large epoch sizes. VGGNet needs more time to get a high accuracy like Inception. Considering this long and hard training phase, we decided it’s not a wise choice for us.

Conclusion

These plots show that accuracy is increased with epochs and loss has decreased with epocs.
Our validation accuracy is bigger than training accuracy in GoogleNet this shows that our model is not overfitting our data. By the way loss is still decreasing so our models can be trained with more epochs for better accuracy. We will expand our epochs to 20,50,100 and evalueate our outcomes. Of course we will also try to train our model on the full dataset which includes 101 classes (Food-101 Dataset). You can access full dataset from here.

--

--

Muhammed Aydoğan
bbm406f19

Computer Science Student at University of Hacettepe