WEEK 5: Malaria Parasite Classification

Source: Deep Learning on Medium

WEEK 5: Malaria Parasite Classification

Hi everyone! This week, we have implemented ResNet18 model and we had some results. Last week, we implemented VGG-16 model. You can find last week here. In the previous weeks, we explained some of the models based on Convolutional Neural Network. But we didn’t explain ResNet-18. So we will give some short information about ResNet-18 and show our results.

We still have reserved for using 80% of the data set of Malaria cells
for training, 10% for verification and the rest for testing.


ResNet 18 is a convolutional neural network trained with more than one million images divided into nearly a thousand categories in the ImageNet database. It is 18 layers deep. This network has learned to represent many features for images in many different categories. The network has an image input size of 224-by-224.

Our Results

We tested our dataset with pre-tranied ResNet-18 model. And the result as following:

First outputs of pre-trained model.

Later, we have trained ResNet-18 model with our dataset. Our hyperparameters are same as last week. Batchsize is 8, optimizer is SGD. And we decided CrossEntropyLoss as loss function. The epoch number is 7. After the 7th epoch, the accuracy does not change too much.

In the training process, the best accuracy is 0.7879. It is in the first epoch.

In the third epoch, there is an anomaly. We thought it is about we didn’t allocate the files properly. We did not apply shuffle to the data set. We believe that this may be due to the mismatch between the data in the training process and the data in the validation file. Actually, last week we had used the same file for Vgg-16 model. And we didn’t encounter this problem.

After train the model with Malaria cells dataset, an example of the results from the test file is as follows:

Final outputs of the trained model.

For test file:

  • Average loss: 0.0477
  • Average accuracy: 0.8443

For our dataset, the accuracy of the Vgg-16 model is larger than that of the ResNet-18 model. So we saw that Vgg-16 is more fit than ResNet-18 for our project.

See you next week…

Reference :