Classification Of Pet And Dog Images Using Famous CNN Architecture.
Project submitted to: AWS Nanodegree Summer Program on Udacity
- Classified images folder: *pet_images *
- Uploaded images folder: uploaded_images
- Results: results_uploaded_images / results_pet_images
- Dog names (breed) file: dognames.txt
- Labels file: imagenet1000_clsid_to_human.txt
- AlexNet
- VGG16
- ResNet18
- Classify uploaded images command line
$ sh run_models_batch_uploaded.sh --dir pet_images --arch vgg|alexnet|resnet --dogfile dognames.txt
- Classify default images command line
$ sh run_models_batch.sh --dir pet_images --arch vgg|alexnet|resnet --dogfile dognames.txt
- Help with arguments
$ sh run_models_batch_uploaded.sh --help
- True label: teddy Predicted label: teddy, teddy bear
- This image is not a dog image. The classifier Predicted it as not a dog image.
- VGG16 prediction is Correct.
- True label: teddy Predicted label: teddy, teddy bear
- This image is not a dog image. The classifier Predicted it as not a dog image.
- ResNet18 prediction is Correct.
- True label: teddy Predicted label: teddy, teddy bear
- This image is not a dog image. The classifier Predicted it as not a dog image.
- AlexNet prediction is Correct.
- True label: dog Predicted label: bow tie, bow-tie, bowtie
- This image is a dog image. The classifier predicted it as not a dog image.
- VGG16 prediction is False.
- True label: dog Predicted label: cowboy hat, ten-gallon hat
- This image is a dog image. The classifier predicted it as not a dog image.
- ResNet18 prediction is False.
- True label: dog Predicted label: sombrero
- This image is a dog image. The classifier predicted it as not a dog image.
- AlexNet prediction is False.
- True label: gray whale Predicted label: grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
- This image is not a dog image. The classifier predicted it as not a dog image.
- VGG16 prediction is Correct.
- True label: gray whale Predicted label: grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
- This image is not a dog image. The classifier predicted it as not a dog image.
- ResNet18 prediction is Correct.
- True label: gray whale Predicted label: grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
- This image is not a dog image. The classifier predicted it as not a dog image.
- AlexNet prediction is Correct.
- True label: dog Predicted label: bow tie, bow-tie, bowtie
- This image is a dog image. The classifier predicted it as not a dog image.
- VGG16 prediction is False.
- True label: dog Predicted label: cowboy hat, ten-gallon hat
- This image is a dog image. The classifier predicted it as not a dog image.
- ResNet18 prediction is False.
- True label: dog Predicted label: sombrero
- This image is a dog image. The classifier predicted it as not a dog image.
- AlexNet prediction is FALSE.
Full summaries in folder : results_uploaded_images/
| Percentage VGG16 | Percentage ResNet18 | Percentage AlexNet | |
|---|---|---|---|
| Pct match | 50.0% | 50.0% | 50.0% |
| Pct correct dogs | 0.0% | 0.0% | 0.0% |
| Pct correct breed | 0.0% | 0.0% | 0.0% |
| Pct correct notdogs | 100.0% | 100.0% | 100.0% |
Full summaries in folder : results_images/
| Percentage VGG16 | Percentage ResNet18 | Percentage AlexNet | |
|---|---|---|---|
| Pct match | 87.5% | 82.5% | 75.0% |
| Pct correct dogs | 100.0% | 100.0% | 100.0% |
| Pct correct breed | 93.33% | 90.0% | 80.0% |
| Pct correct notdogs | 100.0% | 90.0% | 100.0% |
Questions regarding Uploaded Image Classification:
-
Did the three model architectures classify the breed of dog in Dog_01.jpg to be the same breed? If not, report the differences in the classifications.
Answer: The three models could not classify the dog correctly because of the hat the dog was wearing.
-
Did each of the three model architectures classify the breed of dog in Dog_01.jpg to be the same breed of dog as that model architecture classified Dog_02.jpg? If not, report the differences in the classifications.
Answer: The models gave the same wrong answer.
-
Did the three model architectures correctly classify Animal_Name_01.jpg and Object_Name_01.jpg to not be dogs? If not, report the misclassifications.
Answer: Yes
-
Based upon your answers for questions 1. - 3. above, select the model architecture that you feel did the best at classifying the four uploaded images. Describe why you selected that model architecture as the best on uploaded image classification.
Answer: The three models could not recognize the dog but recognized the hat
Conclusion: VGG16 gave the best results with the pet images but with uploaded images the models gave the same results.