Skip to content

NUS EE5907 Pattern Recognition Semester1 AY21/22: project1 for SPAM, project2 for face recognition.

Notifications You must be signed in to change notification settings

jjjllxx/NUS-EE5907-Pattern-Recognition-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 

Repository files navigation

NUS-EE5907-Pattern-Recognition-Projects

NUS Pattern Recognition course: project1 for SPAM, project2 for face recognition.

Project1: Spam

Each Matlab files includes one Machine Learning method, consisting of Beta-binomial Naive Bayes, Gaussian Naive Bayes, Logistic regression, K-Nearest Neighbors. The detail of each requirement is shown in EE5907_EE5027_SPAM.pdf.The raw data of spam is in spamData.mat.

Original README

This is EE5907 Programming Assignment.

  1. Assignment1 to Assignment4 indicates Beta-binomial Naive Bayes,Gaussian Naive Bayes, Logistic regression and K-Nearest Neighbors respectively.
  2. Before running any code, spamData.mat should be placed in the same folder with them.
  3. The results of Assignment1,3,4 also includes a picture of training and testing error rate, which are also included in this folder,named by their assignment.
  4. Assignment4 may take about 1min to run, thank you for your time and patience.
    Jin Lexuan 23.Sept.2021

Beta-binomial Naive Bayes

image

Gaussian Naive Bayes

In Gaussian Naive Bayes question, ML estimation of mean and variance of training set are calculated for testing set and training to fit in.From the Matlab code, it can be calculated that training error rate and testing error rate are 0.1657 and 0.1602 respectively.

Logistic regression

image

K-Nearest Neighbors

image

Project2: Face Recognition

Includes PCA,LDA,SVM,GMM,CNN algorithm.

Original README

This is the second assignment of EE5907.

  1. For each part, they are seperated in folders with name of the content.And PIE is the original face image and my selfie.
  2. The information of images is saved as .mat file and can be loaded automatically in each part. The original selfie are saved in 'PIE/selfie'. PCA,LDA and SVM part are completed in Matlab, which can be run directly. Since LIBSVM is not suitable for Mac system with M1 core, Matlab function fitcsvm is applied for SVM part.
  3. GMM and CNN are completed by python, which should be imported with required library before running. GMM is based on sklearn,while CNN is based on tensorflow.
  4. Each code need about 20s to run, CNN require few minutes to train its model. Then results will be shown. They are also saved as .fig or .png files in each folder respectively, which are convienent to see without running the code.

PCA for Feature Extraction, Visualization and Classification

imageimage

image

LDA for Feature Extraction and Classification

imageimage

imageimage

imageimage

GMM for clustering

Raw image

image

imageimageimage

PCA = 80

image

imageimageimage

PCA = 200

image

imageimageimage

SVM for Classification

C parameter raw image PCA 80 PCA 200
C=0.01 98.44% 92.88% 96.09%
C=0.1 98.75% 95.38% 97.18%
C=1 98.83% 96.40% 97.89%

Neural Networks for Classification

imageimage

About

NUS EE5907 Pattern Recognition Semester1 AY21/22: project1 for SPAM, project2 for face recognition.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published