Learn practical skills, build real-world projects, and advance your career

Multi label Image Classification using PyTorch

The aim of the project is to predict different genres of a movie simply by its poster. Since a movie can have more than 1 genres, this is a multi label image classification problem.

For this assignment, the dataset we’ll be using contains the poster images of several multi-genre movies.

Wei-Ta Chu and Hung-Jui Guo, “Movie Genre Classification based on Poster Images with Deep Neural Networks,” Proceedings of International Workshop on Multimodal Understanding of Social, Affective and Subjective Attributes, pp. 39-45, 2017. (in conjunction with ACM Multimedia 2017)

https://www.cs.ccu.edu.tw/~wtchu/projects/MoviePoster/index.html

The structured and the modified dataset can be downloaded from here

https://drive.google.com/file/d/1iQV5kKF_KGZL9ALx9MMXk_Lg7PklBLCE/view

First, import all the required Python libraries:

import pandas as pd
import numpy as np
from tqdm import tqdm
import os

import matplotlib.pyplot as plt
%matplotlib inline

import torchvision
from torchvision import transforms
from torchvision.utils import make_grid

import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
from torch.utils.data import Dataset

from PIL import Image
!pip install jovian --upgrade -q
import jovian

project_name = 'zerotogans-project'
WARNING: You are using pip version 20.3.1; however, version 20.3.3 is available. You should consider upgrading via the '/opt/conda/bin/python3.7 -m pip install --upgrade pip' command.