This project aims at determinig the genre of the movie using its posters for image classifications CNNs are the most effective types of neural network in this project we try to create a CNN which would predict the genres of these movies.
We used a dataset containing 15000 movie posters which were classified into drama, thriller, action, comedy, biography or documentary or a combination of these posters were downloaded from IMDB using web scrapping and a csv file was generated containg the title and its genres. The dataset was divided into 3 sets with 80% for training 10% for test and validation set.
The images were resized using the skimage module
img = skimage.transform.resize(img,size)
The opencv module can also be used to achieve the same goal of resizing
img = cv2.resize(img,size)
We used the keras module to make our convolutional neural network.the model has the architecture is given below:
- 2 convolutional layers with 32 filters
- Max poooling and dropout
- 2 convolutional layer with 64 filters
- Dense layer with 128 neurons
- Output neuron with 6 neurons
Some movie posters were fed to our trained model and the following were the outputs. There are six output neurons each one corresponding to a particular genre and each neuron gives a real number output. The three highest value for each poster is given below:
Prediction:
Action 0.5179066 | Crime 0.19378987 | Horror 0.2179066
Prediction:
Romance 0.5043122 | Drama 0.34689817 | Biography 0.1913521
Prediction:
Thriller 0.4531901 | Drama 0.2649131 | Action 0.2391053
Made a simple flask webapp for demonstration.