An image classification application using a deep learning model called a convolutional neural network (often abbreviated as CNN) to identify dog breeds.
CNNs work particularly well for detecting features in images like colors, textures, and edges; then using these features to identify objects in the images. You'll use a CNN that has already learned the features from a giant dataset of 1.2 million images called ImageNet.
There are different types of CNNs that have different structures (architectures) that work better or worse depending on your criteria. With this application you can use the three different architectures (AlexNet, VGG, and ResNet) and determine which is best for your results.
- Open your terminal.
- cd to the application folder.
- Run Python file called check_images.py using three arguments
--dir
,--arch
,--dogfile
and use>
symbol, where:--dir
: Images Folder - ex: pet_images.--arch
: CNN Model Architecture - ex: vgg.--dogfile
: Text File with Dog Names - ex: dognames.txt.>
: Pipe to print output into a file.
python check_images.py --dir pet_images/ --arch resnet --dogfile dognames.txt > resnet_pet-images.txt
python check_images.py --dir pet_images/ --arch alexnet --dogfile dognames.txt > alexnet_pet-images.txt
python check_images.py --dir pet_images/ --arch vgg --dogfile dognames.txt > vgg_pet-images.txt
After testing the sample images you can put your images instead of them in pet_images folder.
- Images are in jpeg format with extension jpg.
- Images are approximately square in shape (their height and width are approximately the same number of pixels).
- Dog Image - named Dog_01.jpg. This name is formatted such that if more than one word makes up the dog name those words are separated by an underbar ( _ ).
- For example:
- Image of a Field Spaniel is named Field_Spaniel_01.jpg.
- Make sure you know the breed of dog that the image is of.