Principal Components Analysis

Similar documents
Principal Components Analysis (PCA)

Signal and Information Processing. Alejandro Ribeiro

Eigenfaces. Face Recognition Using Principal Components Analysis

CS4495/6495 Introduction to Computer Vision. 8B-L2 Principle Component Analysis (and its use in Computer Vision)

1 Principal Components Analysis

Contents. Acknowledgments

Dimensionality Reduction: PCA. Nicholas Ruozzi University of Texas at Dallas

Principal Component Analysis

Principal Component Analysis -- PCA (also called Karhunen-Loeve transformation)

Principal Component Analysis (PCA)

Principal Component Analysis (PCA)

What is Principal Component Analysis?

Data Preprocessing Tasks

(a)

Introduction to Machine Learning. PCA and Spectral Clustering. Introduction to Machine Learning, Slides: Eran Halperin

COMP 551 Applied Machine Learning Lecture 13: Dimension reduction and feature selection

Discrete Fourier transform

Lecture: Face Recognition and Feature Reduction

1 Matrices and vector spaces

Covariance and Correlation Matrix

Lecture: Face Recognition and Feature Reduction

Principal Component Analysis (PCA) CSC411/2515 Tutorial

Compressing a 1D Discrete Signal

PCA, Kernel PCA, ICA

Lecture 24: Principal Component Analysis. Aykut Erdem May 2016 Hacettepe University

Linear Algebra in Hilbert Space

Advanced Introduction to Machine Learning CMU-10715

Linear Algebra Review. Fei-Fei Li

Machine Learning - MT & 14. PCA and MDS

System 1 (last lecture) : limited to rigidly structured shapes. System 2 : recognition of a class of varying shapes. Need to:

Unsupervised Machine Learning and Data Mining. DS 5230 / DS Fall Lecture 7. Jan-Willem van de Meent

Machine Learning: Basis and Wavelet 김화평 (CSE ) Medical Image computing lab 서진근교수연구실 Haar DWT in 2 levels

We use the overhead arrow to denote a column vector, i.e., a number with a direction. For example, in three-space, we write

Lecture 6 Sept Data Visualization STAT 442 / 890, CM 462

Numerical Methods I Singular Value Decomposition

Singular Value Decompsition

Lecture: Face Recognition

FSAN/ELEG815: Statistical Learning

5. Orthogonal matrices

Deriving Principal Component Analysis (PCA)

Principal Component Analysis

Lecture 3: Review of Linear Algebra

Lecture 3: Review of Linear Algebra

CS 340 Lec. 6: Linear Dimensionality Reduction

Dimensionality Reduction and Principle Components Analysis

Compressing a 1D Discrete Signal

Introduction to Machine Learning

Robot Image Credit: Viktoriya Sukhanova 123RF.com. Dimensionality Reduction

Lecture 7 MIMO Communica2ons

Linear Algebra: Matrix Eigenvalue Problems

ECE Lecture Notes: Matrix Computations for Signal Processing

Image Analysis. PCA and Eigenfaces

The Mathematics of Facial Recognition

Two-Dimensional Signal Processing and Image De-noising

18.06 Problem Set 8 - Solutions Due Wednesday, 14 November 2007 at 4 pm in

Dimensionality Reduction Using PCA/LDA. Hongyu Li School of Software Engineering TongJi University Fall, 2014

CS181 Midterm 2 Practice Solutions

Quantum Computing Lecture 2. Review of Linear Algebra

The Singular Value Decomposition (SVD) and Principal Component Analysis (PCA)

Principal Component Analysis

Probabilistic Latent Semantic Analysis

PCA and LDA. Man-Wai MAK

1 Singular Value Decomposition and Principal Component

Vectors To begin, let us describe an element of the state space as a point with numerical coordinates, that is x 1. x 2. x =

7. Variable extraction and dimensionality reduction

The Singular Value Decomposition

Maximum variance formulation

ECE 661: Homework 10 Fall 2014

Lecture 8. Principal Component Analysis. Luigi Freda. ALCOR Lab DIAG University of Rome La Sapienza. December 13, 2016

Face Recognition and Biometric Systems

11 a 12 a 21 a 11 a 22 a 12 a 21. (C.11) A = The determinant of a product of two matrices is given by AB = A B 1 1 = (C.13) and similarly.

2.3. Clustering or vector quantization 57

Linear Algebra Review. Fei-Fei Li

Numerical Linear Algebra Homework Assignment - Week 2

Unsupervised Learning: Dimensionality Reduction

Principal Component Analysis

A = 3 B = A 1 1 matrix is the same as a number or scalar, 3 = [3].

A VERY BRIEF LINEAR ALGEBRA REVIEW for MAP 5485 Introduction to Mathematical Biophysics Fall 2010

Designing Information Devices and Systems II Fall 2018 Elad Alon and Miki Lustig Homework 9

Multivariate Statistical Analysis

Linear Algebra for Machine Learning. Sargur N. Srihari

Karhunen-Loève Transform KLT. JanKees van der Poel D.Sc. Student, Mechanical Engineering

Probabilistic & Unsupervised Learning

Exercises * on Principal Component Analysis

PY 351 Modern Physics Short assignment 4, Nov. 9, 2018, to be returned in class on Nov. 15.

Math Assignment 3 - Linear Algebra

Mathematical foundations - linear algebra

Here is an example of a block diagonal matrix with Jordan Blocks on the diagonal: J

Econ 204 Supplement to Section 3.6 Diagonalization and Quadratic Forms. 1 Diagonalization and Change of Basis

PCA & ICA. CE-717: Machine Learning Sharif University of Technology Spring Soleymani

Cheng Soon Ong & Christian Walder. Canberra February June 2017

3.024 Electrical, Optical, and Magnetic Properties of Materials Spring 2012 Recitation 1. Office Hours: MWF 9am-10am or by appointment

Coding the Matrix Index - Version 0

Two-Dimensional Signal Processing and Image De-noising

Tutorial on Principal Component Analysis

Eigenface-based facial recognition

Designing Information Devices and Systems II Fall 2015 Note 5

Notes on basis changes and matrix diagonalization

EECS490: Digital Image Processing. Lecture #26

Multivariate Statistics Fundamentals Part 1: Rotation-based Techniques

Transcription:

Principal Components Analysis Santiago Paternain, Aryan Mokhtari and Alejandro Ribeiro March 29, 2018 At this point we have already seen how the Discrete Fourier Transform and the Discrete Cosine Transform can be written in terms of a matrix product The main idea is to multiply the signal by a specific unitary matrix Let us remind ourselves of the definition of unitary matrix Definition 1 (Unitary matrix) Let M C N N be a matrix with complex entries Denote by M the conjugate of M, ie, for each entry i, j we have that (M ) ij = Mij Then, we say M is unitary if (M ) T M = M H M = I, (1) where I is the N N identity matrix and ( ) T denotes the transpose of a matrix Note that we have defined the superscript symbol H to denote conjugate and transposition (this operation is called the Hermitian operation) For the Discrete Fourier transform we can define the following matrix e H 0N 1 1 1 e1n H F = = 1 1 e j2π(1)(1)/n e j2π(1)(n 1)/N N 1 e j2π(n 1)(1)/N e j2π(n 1)(N 1)/N e H (N 1)N Then, if we consider a signal x(n) for n = 0,, N 1 as a vector x = x(0) x(1) x(n 1) (2), (3) 1

we can write the DFT as the product between F and the vector x ie 1 1 1 Fx = 1 1 e j2π(1)(1)/n e j2π(1)(n 1)/N N 1 e j2π(n 1)(1)/N e j2π(n 1)(N 1)/N = 1 n=1 N 1 x(n)e 2πj N 0 n X(0) N n=1 N 1 x(n)e 2πj N 1 n = X(1) N 1 n=1 N 1 x(n)e 2πj N n X(N 1) x(0) x(1) x(n 1) In PCA decomposition we define a new unitary matrix based on the eigenvectors of the covariance matrix of a dataset Before defining the covariance matrix we need to define the sample mean signal Definition 2 (Sample mean) Let x 1, x 2, x M be M different signals in a dataset Then, the sample mean of the dataset is x = 1 M We next define the sample covariance matrix (4) M x m (5) m=1 Definition 3 (Sample covariance matrix) Let x 1, x 2, x M be M different signals in a dataset Then, the sample covariance matrix of the dataset is Σ = 1 M M (x m x)(x m x) H (6) m=1 Now that we know how to get the sample covariance matrix, we can define a unitary matrix that is adapted to our signals Let v 1, v 2,, v N be the eigenvectors of the sample covariance matrix of the dataset Then, as in the discrete Fourier transform, define the unitary matrix P = [v 1, v 2,, v N ] (7) The PCA decomposition can be written as a product between P and the centered signal, ie, the signal minus its sample mean Explicitly, X PCA = P H (x x) (8) 2

Just as with the DFT and the DCT, we can also define the inverse operation to PCA decomposition, which gives us a signal based on X PCA Because P is unitary, its inverse is given by P H Hence, the inverse transformation is given by x = PX PCA + x (9) You can prove this is the case by plugging in (8) into (9) In this Lab we are going to be taking PCA decomposition of faces, so that we need to deal with two-dimensional signals A way of doing this is to vectorize the matrices representing the images Let Z be a N by N matrix Let z k be the k-th column of the matrix, then we can represent the matrix Z as a concatenation of column vectors Z = [z 1, z 2,, z N ] (10) The one dimensional representation of the signal Z can be obtained by stacking its columns as in z = z 1 z 2 z N (11) With this idea we can treat two dimensional signals as if they were one dimensional and use our original definition of the PCA In what follows, we are going to use PCA decomposition for image compression We can compress an image by keeping the eigenvectors associated with the larger eigenvalues of the covariance matrix Next week, we will use a similar idea to build a face recognition system Since we haven t yet covered the concept of covariance matrix we are providing the sample covariance matrix, computed using (6), and the sample mean, computed using (2), of the data set (cf Figure 2b) 1 PCA: Decomposition 11 Decomposition in principal components Build a function that, 11 given Decomposition a covariance matrixinand principal the number components of desired principal components K, returns the K eigenvectors of the covariance matrix corresponding to the K largest eigenvalues Check that the matrix containing the eigenvectors is unitary 3

Figure 1: Dataset 4

(a) An example of the dataset (b) This is the mean face of the dataset 12 Decomposition of a face in the space of eigenfaces Build a function that Decomposition takes as inputs an ofimage a facecontaining the space a face, of theigenfaces mean face, and 12 the eigenfaces and returns the projection in the space of eigenfaces Note that eigenfaces are the eigenvectors represented as images 2 Reconstruction 21 Reconstruction of a face using K principal components Build a 21 function Reconstruction that takes as inputs of athe face mean using face, KKprincipal eigenfaces, components and the K coefficients representing the projection onto those eigenfaces and outputs a reconstructed face Test this function for any of the faces of the data set for 5, 25, and 50 principal components 22 Reconstruction error For any given number K of principal components (eigenfaces), Reconstruction we canerror compute the reconstruction error as X ˆX K, 22 where X is the original image and ˆX K is the image reconstructed using K eigenfaces Compute this error ranging the number of eigenfaces used from K = 0 to the maximum number of eigenfaces (size of the image) How many principal components are needed to obtain a 60% reduction in the reconstruction error (as compared to K = 0)? 5