What it does

The image classification model classifies 70,000 grayscale images of clothing into 10 categories: T-shirt/top, trouser, pullover, dress, coat, sandal, shirt, sneaker, bag and ankle boot. 60,000 images are used to train the model and 10,000 images are used for testing its accuracy. The text classification model performs sentiment analysis on 50,000 IMDB movie reviews by classifying them as either positive or negative. 25,000 reviews are used for training and 25,000 are used for testing.

How I built it

I built the neural network models by chaining together Keras layers, most of which have parameters that are learned during training. In the image classification model, the first layer flattens the two-dimensional array representation of images (28 by 28 pixels) into a one-dimensional array representing 784 pixels. There are two more layers, known as Dense layers, the first of which contains 128 neurons, and the second 10 neurons. Each of the 10 neurons contains a score that indicates the probability that the current image belongs to one of the 10 classes. I experimented with different optimizers, loss functions, and number of epochs to increase the predictive accuracy of the models. The text classification model contains an Embedding layer which turns each integer-encoded word into a 16-dim vector. As words are found to be more similar in the contexts they are being used, the angle between their vectors decrease. I also tested the models on new data to ensure that they were not simply memorizing output.

What I learned

Using TensorFlow and Keras, I learned how to perform accurate predictive analysis on large datasets. I am interested in applying these skills toward future machine learning projects, such as stock price prediction and sentiment analysis.

Built With

Share this project:

Updates