

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This project involves using a subset of images from the mnist dataset for digit '3' and '7'. The goal is to perform feature extraction, density estimation, and bayesian classification. The data is stored in .mat files, and you'll be working on three tasks: feature extraction and normalization, density estimation using normal distributions, and bayesian decision theory for optimal classification with different prior probabilities. Submit your code and a report summarizing the results.
Typology: Exercises
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Project Part 1 [1 0 points] Feature Extraction, Density Estimation and Bayesian Classification (Due October 6, 11:59pm) This part of the project uses a subset of images (with modifications) from the MNIST dataset. The original MNIST dataset (http://yann.lecun.com/exdb/mnist/) contains 70,000 images of handwritten digits, divided into 60,000 training images and 10, testing images. We use only images for digit “ 3 ” and digit “ 7 ” in this project. The data is stored in “.mat” files. You may use the following piece of code to read the dataset in Python (or you may use the load filename command in Matlab, since these are .mat files): import scipy.io data = scipy.io.loadmat(‘matlabfile.mat’) Following are the statistics for the data you are going to use: Number of samples in the training set: " 3 ": 5713 ; " 7 ": 5835 Number of samples in the testing set : " 3 ": 1428 ; " 7 ": 1458 You will practice doing the following three tasks in this project: Task 1. Feature extraction and normalization In the .mat file, each image is stored as a 28x28 array of pixels. The pixel values range from 0 to 255. For each image i, compute two features:
We assume in the 2-d feature space of Yi defined above, samples from each class follow a normal distribution. Using the MLE method, you will need to estimate the parameters for the 2-d normal distribution for each class/digit, using the respective training data for that class/digit. Note: You will have two distributions, one for each digit. Task 3. Bayesian Decision Theory for optimal classification Use the estimated distributions for doing minimum-error-rate classification, for the following two cases respectively: Case 1: Assume that the prior probabilities are the same (i.e., P( 3 ) = P( 7 ) =0.5). Case 2: Assume that the prior probabilities are: P( 3 ) = 0.3, P( 7 ) = 0.7. For both cases, report the error rate of the optimal classifier, for the training set and the testing set respectively where error rate is defined as ratio of number of incorrect predictions to total number of samples. Task 4. Try different threshold values for the feature ri Do all the above steps for two values of threshold T for ri feature- Case 1: T = 150 Case 1: T = 200 What to submit: