This is a CNN code for classifying a photo as meme or not meme. I made this as a side project to further integrate it with a scrapper so that it can auto identify the memes on my wall and re share it . It's a personal project made for fun. The accuracy isn't technical accuracy isn't great but somehow it works pretty well with real life examples. About 8/10 success rate while trying this classifier for new formats of memes without retraining.
2.5k in training set and 800 in testing set. Dataset link: https://www.kaggle.com/sayangoswami/reddit-memes-dataset
I used a normal CNN for this.A working classifier is saved in that can be directly used to classify without retraining.
Data about the classifier:
1/0 [============================================================================================================================================================================================================================================================================================================] - 3s 3s/step - loss: 0.7221 - acc: 0.2000 - val_loss: 1.4974 - val_acc: 0.4200 Epoch 2/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 0.8528 - acc: 0.6000 - val_loss: 3.2315 - val_acc: 0.5400 Epoch 3/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 2.6961 - acc: 0.6000 - val_loss: 1.3316 - val_acc: 0.5600 Epoch 4/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 0.5283 - acc: 0.8000 - val_loss: 0.7655 - val_acc: 0.4000 Epoch 5/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 0.8411 - acc: 0.2000 - val_loss: 2.0194 - val_acc: 0.5400 Epoch 6/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 2.6170 - acc: 0.4000 - val_loss: 1.9352 - val_acc: 0.5000 Epoch 7/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 2.0182 - acc: 0.4000 - val_loss: 1.0799 - val_acc: 0.5600 Epoch 8/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 0.7382 - acc: 0.6000 - val_loss: 0.7491 - val_acc: 0.4400 Epoch 9/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 0.6662 - acc: 0.8000 - val_loss: 1.0440 - val_acc: 0.4800 Epoch 10/10 1/0 [============================================================================================================================================================================================================================================================================================================] - 2s 2s/step - loss: 0.9439 - acc: 0.6000 - val_loss: 1.3676 - val_acc: 0.3200 Saved model to disk
conv2d_1 (Conv2D) (None, 62, 62, 32) 896
max_pooling2d_1 (MaxPooling2 (None, 31, 31, 32) 0
flatten_1 (Flatten) (None, 30752) 0
dense_1 (Dense) (None, 128) 3936384
Total params: 3,937,409 Trainable params: 3,937,409 Non-trainable params: 0
More work needs to be done.