Convolutional Neural Network Animal Classificator

The goal of this kernel was to build a clean image classificator that includes Data Augmentation as well as Model Evaluating and Fine-Tuning. I tried to create a general approach of solving this kind of problems for image classifications which can be reused for different kind of image data.

The Dataset

The Dataset can be found and downloaded here on Kaggle.

Local Installation

Clone the repo (or simply download it)

git clone https://github.com/JanMarcelKezmann/Animal-Classificator-Convolutional-Neural-Network.git

Install requirements

(go into the new folder)
pip install -r requirements.txt

Run with JupyterNotebook or JupyterLab

Just open the .ipynb code in a Notebook of your choice and run it.

Run the Code via the Google Colab

Because the code was written in the colaboratory of Google you can simply open it in there and run it after uploading the data to the drive.

Results

Evaluated were two different convolutional neural networks: The Inception V3 and the Inception ResNet V2.

The best result was achieved even before trying to fine-tune the models.

Model Inception V3 Inception ResNet V2
Loss: 0.9624 0.8385
Accuracy: 85.29 % 89.33 %

Problems with the Accuracy

<Checking out a couple of images I found out that some pictures were put into the wrong folder in the original dataset. This means that for example a dog picture is put into the horse folder.

This could potentially result in a worse accuracy for about 1 % which is not huge but still relevant.

References

[1] https://www.kaggle.com/alessiocorrado99/animals10