Skip to content

sushovanjena/Pattern-Recognition-IIT-Mandi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pattern-Recognition-Assignments

Pattern Recognition at IIT Mandi

Assignment 1

There are 3 types of datasets given below. The details of these three datasets are:

a) ​Linearly separable:​These are 2-dimensional artificial data of 2 classes that are linearly separable. Each class has 1000 data points.

b) ​Non-linearly separable​: These are 2-dimensional artificial data of 2 classes that are non-linearly separable. Each class has 1000 data points.

c) ​Real-world: ​Real-world data of 3 classes. (Number of data points for class1 = 2388, class2 = 2164 & for class3 = 2291)

Perform

  1. Classification using Bayesian classifier (including parameter estimation and decision)
  2. Classification (only for the 2 artificial datasets) when you approximate the pdfs via normalized histograms (considering independence between features - thus, involving 1D histogram computations for each of the two features) In both cases, do the following: For each task, you can divide the data into training and testing parts. Build the model with the training data and evaluate its performance using the test data. A typical training testing ratio can be 80% - 20% Make a confusion matrix to show your results. For the artificial datasets, also show a 2D scatter plot for the training data and test data with different colours. Also, points for different classes should also be shown in different colours.

SOLUTION

(a)

Boundary Plot of Linearly Separable data using Bayesian Classifier

Boundary_Plot_LS

Boundary Plot of Linearly Separable data using Normalised Histograms

Boundary_Plot_Histogram_LS

(b)

Boundary Plot of Non-Linearly Separable data using Bayesian Classifier Boundary_Plot_NLS

Boundary Plot of Non-Linearly Separable data using Normalised Histograms Boundary_Plot_Histogram_NLS

(c)

Boundary Plot of Real-world data using Bayesian Classifier Boundary_Plot_RealData

Boundary Plot of Real-world data using Normalised Histograms Boundary_Plot_Histogram_RealData

Assignment 2

Classification and Segmentation with clustering You have to perform the given tasks:

a) For the dataset of Assignment 1, perform classification using k-means clustering for the non-linearly separable case.

b) Perform k-means clustering-based segmentation of the given image.

I) When using only pixel colour values as features

II) When using both pixel colour and location values as features

(In both cases, display the segmentation output as a colour​ ​image, with different colours assigned pixels belonging to different clusters, and same colours assigned to pixels belonging to the same cluster)

SOLUTION

(a) Classification of Non-linearly seprable data with K-Means Clustering

kmeans_nls

Accuracy of Test-data = 0.935

(b) K-Means Clustering based Segmentation of the given image

Given Image Image

(I) When using only pixel colour values as features

k-means_pixel_k=3 k-means_pixel_k=10 kmeans_pixel_k=20

(II) When using both Pixel colour and Location as features

kmeans_pixel loc_k=3 kmeans_pixel loc_k=10 kmeans_pixel loc_k=50

Assignment 3

Build Bayes classifier using GMM for the given data a) Non-Linearly Separable data of assignment 1 b) Another set of non-seperable data (with 2000 points in each class)

SOLUTION

(a) GMM CLustering for classification of Non-linearly separable data

GMM_NLS

Classification Accuracy = 100.00 %

(b) GMM Clustering for classification of Non-Linearly separable data with 2000 points in each class

GMM_NLS_2000

Classification Accuracy = 100.00 %

Assignment 4

In this assignment, two types of datasets are given: 1. Linearly separable data 2. Non-linearly separable data For both of the datasets, perform classification using: 1. Perceptron 2. Multi-layer perceptron 3. SVM You can use inbuilt functions for SVM only. Take the train-test ratio as 70-30. Also find out the confusion matrix and compare the performance of each classifier. Also plot the decision boundaries in each case.

SOLUTION

(1) Perceptron Decision Boundary

Linearly-Separable Data

decision_boundry_LS_Perceptron

Non-Linearly Separable Data

decision_boundry_NLS_Perceptron

(2) SVM Decision Boundary

Linearly-Separable Data

decision_boundry_SVM_LS

Non-linearly Separable Data

decision_boundry_SVM_NLS

(3) MLP Decision Boundary

Linearly-Separable Data

decision_boundry_LS_MLP

Non-Linearly Separable Data

decision_boundry_NLS_MLP

About

Pattern Recognition at IIT Mandi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published