In this assignment you will practice putting together a simple image classification pipeline, based on the k-Nearest Neighbor or the Softmax classifier. The goals of this assignment are as follows:
- understand the basic Image Classification pipeline and the data-driven approach (train/predict stages)
- understand the train/val/test splits and the use of validation data for hyperparameter tuning.
- develop proficiency in writing efficient vectorized code with numpy
- implement and apply a k-Nearest Neighbor (kNN) classifier
- implement and apply a Softmax classifier
- implement and apply a Two layer neural network classifier
- understand the differences and tradeoffs between these classifiers
- get a basic understanding of performance improvements from using higher-level representations than raw pixels (e.g. color histograms, Histogram of Gradient (HOG) features)
Get the code as a zip file from the main page. As for the dependencies:
Virtual environment: We recommend using virtual environment for the project. If you choose not to use a virtual environment, it is up to you to make sure that all dependencies for the code are installed globally on your machine. To set up a virtual environment, run the following
cd assignment1 sudo pip install virtualenv # This may already be installed virtualenv -p python3 .env # Create a virtual environment (python3) # Note: you can also use "virtualenv .env" to use your default python (usually python 2.7) source .env/bin/activate # Activate the virtual environment pip install -r requirements.txt # Install dependencies # Work on the assignment for a while ... deactivate # Exit the virtual environment
Download data: Once you have the starter code, you will need to download the CIFAR-10 dataset. Run the following from the
cd cs231n/datasets ./get_datasets.sh
Start IPython: After you have the CIFAR-10 data, you should start the IPython notebook (more recently known as
Jupyter notebook) server from the
assignment1 directory. If you are unfamiliar with IPython, you can read this IPython tutorial. To start working on this assignment run:
NOTE: If you are working in a virtual environment on OSX, you may encounter errors with matplotlib due to the issues described here. You can work around this issue by starting the IPython server using the
start_ipython_osx.sh script from the
assignment1 directory; the script assumes that your virtual environment is named
Submitting your work:
Once you are done working run the
collectSubmission.sh script; this will produce a file called
assignment1.zip. Upload this file to the eva.
Q1: k-Nearest Neighbor classifier (25 points)
The IPython Notebook knn.ipynb will walk you through implementing the kNN classifier.
Q2: Implement a Softmax classifier (30 points)
The IPython Notebook softmax.ipynb will walk you through implementing the Softmax classifier.
Q3: Two-Layer Neural Network (30 points)
The IPython Notebook two_layer_net.ipynb will walk you through the implementation of a two-layer neural network classifier.
Q4: Higher Level Representations: Image Features (15 points)
The IPython Notebook features.ipynb will walk you through this exercise, in which you will examine the improvements gained by using higher-level representations as opposed to using raw pixel values.