** Updated with Dropout and Dense layers units from 128 to 256 neurons.
The project is implementation of cat and dog classification using Convolution Neural Networks (CNN). We can predict any images in the datasets/single_prediction
directory, and it is need to put any cat and dog image that we want to predict in this directory.
In the training_set & test_set of the dataset,
- there are 4000 images in the training_set for each cat and dog category,
- there are 1000 images in the test_set for each cat and dog category The dataset is provided in the repository
(64, 64, 3)
-> Convolution2D
-> MaxPooling
-> Convolution2D
-> MaxPooling
-> Flattening
-> Dense
-> Dropout
-> Dense
-> Dropout
-> SIGMOID
- Convolution with
filters=32
andkernel_size=3
andactivations='relu'
- MaxPooling with
pool_size=2
andstrides=2
- The first two Dense layers with
units=256
andactivation='relu'
- Dropout each first two layer (UPDATE!!!)
- The final Dense layer with
units=1
andactivation=SIGMOID
model.fit(x = training_set, validation_data = test_set, epochs = 100)
After training the model with 100 epochs
loss | accuracy | val-loss | val-accuracy |
---|---|---|---|
0.0471 | 0.9835 | 0.8552 | 0.8105 |
When we predict on our custom images, the result is as follow.
**Without dropout and Dense layers units 128 neurons, It has four wrong prediction.
**With dropout and Dense layers units 256 neurons, It just has two wrong prediction.
We need to improve prediction result: by hyperparameter tuning OR by improving model architecture...