Data source: dphi
Train a model to recognize 5 classes of animals
- Training: 6558 images, validation: 1638 images, testing: 901 images
- Used ImageDataGenerator for image augmentation, resizing, and normalization
- Use Accuracy as the metrics, and categorical_crossentropy as the loss function
Several different models are trained
Models | Description | Accuracy | Notes |
---|---|---|---|
Model1: MLP | 4-layer Dense, image size [256x256], optimizer= adam | 40% | Not bad for an MLP |
Model2: MLP | 5-layer Dense with 2-layer dropout, tried both [256x256] and [100x100], optimizer tried both adam and sgd | stuck at 23% | MLP can't handle this problem |
Model3: CNN | 5-layer CNN + Maxpooling + dropout + Dense, [256x256], optimizer ='adam' | stuck at 23% | Not sure why CNN is preforming poorly, local minimum? |
Model4: CNN | 4-layer CNN + Maxpooling + dropout + Dense, [100x100], optimizer ='adam', 20 epochs | 69% | better! |
Model5: CNN | 4-layer CNN + Maxpooling + dropout + Dense, [100x100], optimizer ='adam', 50 epochs | 77% | better with more epochs! |
Model6: CNN | 4-layer CNN + Maxpooling + dropout + Dense, [100x100], optimizer ='sgd', learning rate decay starting with 0.02, 20 epochs | 23% | Learning rate too large! |
Model7: CNN | 4-layer CNN + Maxpooling + dropout + Dense, [100x100], optimizer ='sgd', with learning rate decay starting 0.01, 50 epochs | 81% | better with sgd and learning rate decay! |
Model8: VGG-19 | VGG-19 + 3 Dense + 2 dropout, image size [100x100], optimizer ='adam', 100 epochs with early stopping, stopped at epoch 10 | 91% | transfer learning has the best performance |
## Model2 ## Model3 ## Model4 ## Model5 ## Model7 ## Model8