Parallel Nonnegative Matrix Factorization Algorithms for - - PowerPoint PPT Presentation

parallel nonnegative matrix factorization algorithms for
SMART_READER_LITE
LIVE PREVIEW

Parallel Nonnegative Matrix Factorization Algorithms for - - PowerPoint PPT Presentation

Parallel Nonnegative Matrix Factorization Algorithms for Hyperspectral Images A Masters Thesis Lukasz Grzegorz Maciak Montclair State University Department of Computer Science 1 Objectives 1. Background 2. Investigate Novel Feature Extraction


slide-1
SLIDE 1

Parallel Nonnegative Matrix Factorization Algorithms for Hyperspectral Images

A Masters Thesis Lukasz Grzegorz Maciak

Montclair State University Department of Computer Science

1

slide-2
SLIDE 2

Objectives

  • 1. Background
  • 2. Investigate Novel Feature Extraction methods (NMF)
  • 3. Design, implement and test parallel NMF algorithms
  • 4. Initiate development of Java based hyperspectral imaging toolkit

2

slide-3
SLIDE 3

What is Remote Sensing?

The study of Earth’s surface and atmospheric features from a distance.

  • direct observation • reconnaissance • aerial and/or satellite photography/video •

Applications in:

  • agriculture and forestry • meteorology • military surveilance •

3

slide-4
SLIDE 4

Hyperspectral Images

Visible Light: 0.4µm to 0.7µm Hyperspectral Lens: 0.4µm and 2.4µm

4

slide-5
SLIDE 5

Hyperspectral Images

  • spectra • mixed pixels •

5

slide-6
SLIDE 6

Feature Extraction

Reduce dimensionality of the data sample without data loss Source Separation Spectral Unmixing

6

slide-7
SLIDE 7

Linear Mixing Model

Each pixel p is composed of d endmembers Each endmember has a natural intensity e Each endbember contributes fractional amount a to the total pixel intensity

p =

  • e1

e2 ... ed

  • ×

       a1 a2 ... ad       

(1)

7

slide-8
SLIDE 8

Linear Mixing Model

X =

m

  • i=1

aisi + w = Sa + w

(2)

where ai ≥ 0, i = 1, ..., m and

m

  • i=1

ai = 1

(3)

8

slide-9
SLIDE 9

Unsupervised Feature Extraction

No training data available Extraction must be performed algorithmically Nonnegative Matrix Factorization

9

slide-10
SLIDE 10

Objectives

  • 1. Background
  • 2. Investigate Novel Feature Extraction methods (NMF)
  • 3. Design, implement and test parallel NMF algorithms
  • 4. Initiate development of Java based hyperspectral imaging toolkit

10

slide-11
SLIDE 11

Nonnegative Matrix Factorization

Relatively Fast Straightforward Algorithm Good Source Separation

11

slide-12
SLIDE 12

The NMF Problem

Given a nonnegative matrices

Y ∈ Rmxn, W ∈ Rmxk, H ∈ Rkxn

and a positive integer

k ≤ min{m, n}

find W and H which minimize the function:

f(W, H) := 1 2Y − WH2

F

(4)

12

slide-13
SLIDE 13

Applying NMF to Hyperspectral Data

Unrolling the hyperspectral image cube into an array of bandvectors

13

slide-14
SLIDE 14

How does NMF work?

Start with random W and H and repeatedly update them using following rules:

W = W (Y HT ) (WHHT ) + ǫ

(5)

H = H (W T Y ) (W tHWH) + ǫ

(6) where ǫ is a very small positive quantity (ǫ ≤ 10−9)

14

slide-15
SLIDE 15

NMF Algorithm

  • 1. Given

Y ∈ Rmxn ≥ 0, k > 0 and k ≪ min(m, n)

(7) randomly initialize matrices W ∈ Rmxk and H ∈ Rkxn with nonnegative values

  • 2. Scale the columns of W to sum up to one
  • 3. Create temporary variables ¯

W and ¯

  • H. Sent their contents to be equal to H and W respectively.
  • 4. Repeatedly apply the following steps until convergence criteria are met:

(a) Update ¯

W and ¯ H by using: ¯ Hij ⇐ Hcj (W T Y )cj (W T W H)cj + ǫ (1 ≤ c ≤ k) (1 ≤ j ≤ n)

(8)

¯ Wic ⇐ Wic (Y HT )ic (W HHT )ic + ǫ 1 ≤ i ≤ m) (1 ≤ c ≤ k)

(9) (b) Set W = ¯

W and H = ¯ H

(c) Scale the columns of W to sum up to one 15

slide-16
SLIDE 16

Projected Gradient NMF (PG-NMF)

Alternatively fix one matrix and update another.

  • r

find Wk+1 such that f(Wk+1, Hk) ≤ f(Wk, Hk) and find Hk+1 such that f(W k+1, Hk+1) ≤ f(W k+1, Hk)

16

slide-17
SLIDE 17

PG-NMF

Update H and W using following rules:

Hk+1 = Hk − αW T

k (WkHk − Y )

(10)

Wk+1 = W T

k − αHk+1(HT k+1W T k − Y T )

(11)

17

slide-18
SLIDE 18

PG-NMF: Finding α

Substitute H or W for X as necessary:

f(Xk+1) − f(Xk) ≤ α∇f(Xk)T (Xk+1 − Xk)

(12) where ∇f(H) = W T (WH − Y ) and ∇f(W) = H(HT W T − Y T )

18

slide-19
SLIDE 19

PG-NMF: α Updates

if αk satisfies 12 then repeatedly increase α

αk ← αk/β

as long as it still satisfies 12. else repeatedly decrease α

αk ← αk ∗ β

until it satisfies 12. in our case we used β = 0.1

19

slide-20
SLIDE 20

PPG-NMF: α Updates rewritten by Chih-Jen Lin

(1 − σ)W T

k (WkHk − Y ), Hk+1 − Hk + 1

2 Hk+1 − Hk, (W T

k Wk)(Hk+1 − Hk) ≤ 0

(13)

(1−σ)Hk+1(HT

k+1W T k −Y T ), W T k+1−W T k + 1

2 Wk+1−Wk, (Hk+1HT

k+1)(W T k+1−W T k ) ≤ 0

(14)

where , denotes the sum of component wise products of two matrices

20

slide-21
SLIDE 21

PG-NMF Algorithm

1. Given

Y ∈ Rmxn ≥ 0, k > 0, k ≪ min(m, n), α = 1, β = 0.1, σ = 0.01

(15) randomly initialize matrices W ∈ Rmxk and H ∈ Rkxn with nonnegative values. 2. Find Hk+1 using Equation 10 3. Evaluate Equation 10 and: (a) if Equation 13 is satisfied then: i. if at the last iteration Equation 13 was not satisfied set Hk+1 ← ¯

Hk+1 and goto 4

ii. else save the value of Hk+1 in a temporary buffer ¯

Hk+1

iii. save the outcome of Equation 13 iv. update α ← α/β v. go back to 2. (b) if Equation 13 is not satisfied then: i. if at the last iteration Equation 13 was satisfied set Hk+1 ← ¯

Hk+1 and goto 4

ii. else save the value of Hk+1 in a temporary buffer ¯

Hk+1

iii. save the outcome of Equation 13 iv. update α ← α ∗ β v. go back to 2. 4. Find Wk+1 using Equation 11 5. Evaluate Equation 10 and perform steps analogous to 3a and 3b for W. 6. Set H = Hk+1 and W = Wk+1 7. Go back to 2 until convergence criteria are met.

21

slide-22
SLIDE 22

Convergence Criteria

50 100 150 200 250 300 350 400 450 100 200 300 400 500 600 700 Average Accuracy Iterations P-NMF

  • 1. Change in f(W, H)
  • 2. Desired Value of f(W, H)
  • 3. Number of Iterations
  • 4. Execution Time

22

slide-23
SLIDE 23

Objectives

  • 1. Background
  • 2. Investigate Novel Feature Extraction methods (NMF)
  • 3. Design, implement and test parallel NMF algorithms
  • 4. Initiate development of Java based hyperspectral imaging toolkit

23

slide-24
SLIDE 24

Need For Parallelization

  • 1. Large Image Resolution
  • 2. Many Bands
  • 3. Large Image Size
  • 4. Computational Complexity

24

slide-25
SLIDE 25

Shared Memory: SMP

SMP - Symmetric Multiprocessor

25

slide-26
SLIDE 26

SMP Features

  • 1. CPU Scheduling transparent to the user
  • 2. Java Threads leverage SMP architecture
  • 3. No communication overhead
  • 4. Not very scalable

26

slide-27
SLIDE 27

Distributed Memory

27

slide-28
SLIDE 28

Distributed Memory Features

  • 1. Communication between nodes is slow
  • 2. Data must be distributed manually
  • 3. Unlimited scalability
  • 4. Require 3rd party libraries

There also exist hybrid systems - clusters of SMP’s

28

slide-29
SLIDE 29

Data Partitioning

  • 1. Spectral Data Partitioning
  • 2. Spatial Data Partitioning
  • 3. Other Approaches

29

slide-30
SLIDE 30

Speedup

Sp = Tp Ts

(16)

Ts time of sequential execution Tp time of parallel execution with p processors.

An ideal speedup is linear:

Sp = p

30

slide-31
SLIDE 31

Parallel NMF (P-NMF)

using spectral data partitioning

31

slide-32
SLIDE 32

P-NMF Parallel Execution

32

slide-33
SLIDE 33

Data Distribution

int start, end; NMFThread[] tmp = new NMFThread[number_of_threads]; for(int i=0; i<number_of_threads; i++) { start = i*(k/number_of_threads); end = (i+1)*(k/number_of_threads); if(tt == (number_of_threads -1)) end = k; tmp[tt] = new NMFThread(start, end, times); tmp[tt].start(); }

33

slide-34
SLIDE 34

Parallel Projected Gradient NMF (PPG-NMF)

Spatial and Spectral Partitioning Strategies NOT APPROPRIATE instead each CPU evaluates one α value

34

slide-35
SLIDE 35

PPG-NMF Execution

35

slide-36
SLIDE 36

PPG-NMF Distribution

  • 1. If we do not have a previous sum (ie. this is the first run):

Initialize a single thread with α = 1 and evaluate it

  • 2. if we do have a previous sum S then:

Let i be the number of threads such that i ∈ {1, 2, ..., n} where n is the total number of threads; Let e be an integer such that

e = 1 if S <= 0 or e = −1 if S > 0.

Initialize all the threads with α = βie

36

slide-37
SLIDE 37

Experimental Data

a) Hyperspectral Digital Imagery Collection Experiment (HYDICE) b) Photo taken using SOC 700 hyperspectral sensor

37

slide-38
SLIDE 38

Experimental Data

  • 1. HYDICE

(a) 85x185 pixels and 40 bands

  • 2. SOC 700

(a) 160x160 pixels and 120 (b) only 40 bands used

38

slide-39
SLIDE 39

HYDICE Data Set

39

slide-40
SLIDE 40

SOC 700 Data Set

40

slide-41
SLIDE 41

Testing Platform

  • 1. SunFire v880
  • 2. 4 UltraSparc9 750MHz CPU’s
  • 3. 8 GB of RAM
  • 4. Solaris 8
  • 5. Publicly Accessible Server

41

slide-42
SLIDE 42

Test Procedure

5 P-NMF and 5 PPG-NMF tests per sample Each test: run 1-8 threads until converges Convergence Criteria: change in f(W, H) ≤ 0.001 All runs in a test initialized with same seed value

42

slide-43
SLIDE 43

P-NMF Accuracy

50 100 150 200 250 300 350 400 450 100 200 300 400 500 600 700 Average Accuracy Iterations P-NMF 5 10 15 20 25 30 500 1000 1500 2000 Accuracy Iterations SOC 700 P-NMF

43

slide-44
SLIDE 44

P-NMF Execution Time

1.2e+06 1.4e+06 1.6e+06 1.8e+06 2e+06 2.2e+06 2.4e+06 2.6e+06 2.8e+06 1 2 3 4 5 6 7 8 9

  • Avg. Execution Time (Milliseconds)

Number of Threads HYDICE PPG-NMF HYDICE P-NMF 2.5e+07 3e+07 3.5e+07 4e+07 4.5e+07 5e+07 5.5e+07 6e+07 1 2 3 4 5 6 7 8 9 Average Execution Time (Milliseconds) Number of Threads SOC 700 P-NMF

44

slide-45
SLIDE 45

P-NMF Average Time Per Iteration

3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 1 2 3 4 5 6 7 8 9 Average Time per Iteration (Milliseconds) Number of Threads HYDICE P-NMF 5000 10000 15000 20000 25000 30000 35000 1 2 3 4 5 6 7 8 9 Average Time per Iteration (Milliseconds) Number of Threads SOC 700 P-NMF

45

slide-46
SLIDE 46

P-NMF Speedup

0.8 1 1.2 1.4 1.6 1.8 2 2.2 1 2 3 4 5 6 7 8 9 Speedup Number of Threads HYDICE PPG-NMF Speedup HYDICE P-NMF Speedup 0.8 1 1.2 1.4 1.6 1.8 2 2.2 1 2 3 4 5 6 7 8 9 Speedup Number of Threads SOC 700 P-NMF

46

slide-47
SLIDE 47

PPG-NMF Accuracy

50 100 150 200 250 300 350 400 50 100 150 200 250 300 Average Accuracy Iterations PPG-NMF 2 4 6 8 10 12 14 16 20 40 60 80 100 Accuracy Iterations SOC 700 - PG-NMF

47

slide-48
SLIDE 48

PPG-NMF Execution Time

640000 650000 660000 670000 680000 690000 700000 710000 720000 730000 740000 750000 1 2 3 4 5 6 7 8 9

  • Avg. Execution Time (Milliseconds)

Number of Threads HYDICE PPG-NMF HYDICE PPG-NMF 6.6e+06 6.8e+06 7e+06 7.2e+06 7.4e+06 7.6e+06 7.8e+06 8e+06 8.2e+06 8.4e+06 8.6e+06 1 2 3 4 5 6 7 8 9

  • Avg. Execution Time (Milliseconds)

Number of Threads SOC 700 PPG-NMF

48

slide-49
SLIDE 49

PPG-NMF Average Time Per Iteration

10500 11000 11500 12000 12500 13000 13500 1 2 3 4 5 6 7 8 9 Average Time per Iteration (Milliseconds) Number of Threads HYDICE PPG-NMF 54000 56000 58000 60000 62000 64000 66000 68000 70000 72000 1 2 3 4 5 6 7 8 9 Average Time per Iteration (Milliseconds) Number of Threads SOC 700 PPG-NMF

49

slide-50
SLIDE 50

PPG-NMF Speedup

0.98 1 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1 2 3 4 5 6 7 8 9 Speedup Number of Threads HYDICE PPG-NMF Speedup HYDICE PPG-NMF Speedup 0.95 1 1.05 1.1 1.15 1.2 1.25 1.3 1 2 3 4 5 6 7 8 9 Speedup Number of Threads SOC 700 Speedup

50

slide-51
SLIDE 51

PPG-NMF Rounds per Iteration

1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 Rounds per Iteration Number of Threads Rounds per Iteration "rounds"

for SOC 700 Data

51

slide-52
SLIDE 52

Objectives

  • 1. Background
  • 2. Investigate Novel Feature Extraction methods (NMF)
  • 3. Design, implement and test parallel NMF algorithms
  • 4. Initiate development of Java based hyperspectral imaging toolkit

52

slide-53
SLIDE 53

Hyperspectral Java Toolkit

Read and Write Hyperspectral files Convert between different data types Convert between big endian and little endian Launch various feature extraction algorithms and collect the results Load and display hyperspectral images on the screen

53

slide-54
SLIDE 54

Visualization

a) each band displayed separately as a grayscale image b) 3 bands combined to form a single RGB image

54

slide-55
SLIDE 55

I/O Encoding

  • 1. byte (signed or unsigned)
  • 2. 32 bit integer (signed or unsigned)
  • 3. 64 bit integer (signed or unsigned)
  • 4. 32 or 64 bit float

Pixels can be in big endian or little endian.

55

slide-56
SLIDE 56

Hyperspectral Java Toolkit: Visualization

56

slide-57
SLIDE 57

Hyperspectral Java Toolkit: I/O

57

slide-58
SLIDE 58

Hyperspectral Java Toollit: GUI

58

slide-59
SLIDE 59

Hyperspectral Java Toollit: GUI

59

slide-60
SLIDE 60

Future Work

More testing on a dedicated 6-8 CPU SMP Develop a distributed memory version of P-NMF Optimize the memory requirements Plugin support for the toolkit Better GUI support

60

slide-61
SLIDE 61

Publications

  • S. A. Robila, L. Maciak, Novel Approaches for Feature Extraction in Hyperspectral Images,

Proceedings IEEE LISAT, 2006, 7 pgs. on CD.

  • S. A. Robila, L. Maciak, Parallel Unmixing Algorithms for Hyperspectral Image Processing,

SPIE Intelligent Robots and Computer Vision XXIV, vol. 6384, 2006, 10pgs., in print

  • S. A. Robila, L. Maciak, Sequential and Parallel Feature Extraction using Nonnegative Matrix

Factorization, Proceedings IEEE LISAT 2007, 8 pgs on CD

  • S. A. Robila, L. Maciak, Parallel Projected Gradient Nonnegative Matrix Factorization for

Hyperspectral Images, submitted to IEEE IGARSS 2007

61