-
Notifications
You must be signed in to change notification settings - Fork 1
Lab Assignment 3
- Ruthvic Punyamurtula (Problems - 3,5)
- Sai Charan Kothapalli (problems - 1,2,4)
This is lab assignment 3 of CS5590 - python/Deep Learning class. This lab specifically consists of several deep learning tasks based on regression, CNN and LSTM.
In this assignment, we used Kaggle datasets & implemented
- Linear Regression
- Logistics Regression
- Image Classification with CNN
- Text Classification with CNN
- Text classification with LSTM
- Compare Text Classification with CNN & LSTM






The dataset used is - https://www.kaggle.com/slothkong/10-monkey-species The initial data had 10 classes/species of monkeys. Due to laptop performance issues, we have reduced the dataset to 3 species of monkeys and loaded the data into /content of google colab - with runtime as GPU.
The code snippet describing the data size is given below
The model used for classification is
Because we had small data & training on 20 epochs the accuracy obtained is low (about 35%)
The plots showing accuracy & loss for train & validation data is shown below



- Text Classification with LSTM
The dataset used is - https://www.kaggle.com/c/sentiment-analysis-on-movie-reviews/data As it is a text data, we used the original dataset and uploaded the content to google colab with runtime as GPU.
The code snippet describing the data is given below
The LSTM model used for Text classification is
We trained the model for 5 epochs, with a batch size of 256 for faster training and got an accuracy of 66%
The plots showing accuracy for train & validation data is shown below
We can clearly see that by comparing the accuracy and the tensorboard results CNN text classification has obtained an accuracy of 71.47% CNN image classification has obtained an accuracy of 31.34% LSTM has obtained a validation accuracy of 61.29%
CNN text classification though is run on 5, 10, 15 epochs has produced different learning rates with a better accuracy for each epoch with an improving accuracy each time it is feed more data. LSTM is a slow learner for which it gives varying accuracies for each time the text is given as input, where it learns for each continuous text data feed.
We can conclude by these accuracies that CNN outperforms LSTM for text classification.