Parallel Nonnegative Matrix Factorization Algorithms for Hyperspectral Images
A Masters Thesis Lukasz Grzegorz Maciak
Montclair State University Department of Computer Science
1
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
A Masters Thesis Lukasz Grzegorz Maciak
Montclair State University Department of Computer Science
1
2
The study of Earth’s surface and atmospheric features from a distance.
Applications in:
3
Visible Light: 0.4µm to 0.7µm Hyperspectral Lens: 0.4µm and 2.4µm
4
5
Reduce dimensionality of the data sample without data loss Source Separation Spectral Unmixing
6
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
(1)
7
m
(2)
m
(3)
8
No training data available Extraction must be performed algorithmically Nonnegative Matrix Factorization
9
10
Relatively Fast Straightforward Algorithm Good Source Separation
11
Given a nonnegative matrices
and a positive integer
find W and H which minimize the function:
F
(4)
12
Unrolling the hyperspectral image cube into an array of bandvectors
13
Start with random W and H and repeatedly update them using following rules:
(5)
(6) where ǫ is a very small positive quantity (ǫ ≤ 10−9)
14
Y ∈ Rmxn ≥ 0, k > 0 and k ≪ min(m, n)
(7) randomly initialize matrices W ∈ Rmxk and H ∈ Rkxn with nonnegative values
W and ¯
(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
Alternatively fix one matrix and update another.
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
Update H and W using following rules:
k (WkHk − Y )
(10)
k − αHk+1(HT k+1W T k − Y T )
(11)
17
Substitute H or W for X as necessary:
(12) where ∇f(H) = W T (WH − Y ) and ∇f(W) = H(HT W T − Y T )
18
if αk satisfies 12 then repeatedly increase α
as long as it still satisfies 12. else repeatedly decrease α
until it satisfies 12. in our case we used β = 0.1
19
(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
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
50 100 150 200 250 300 350 400 450 100 200 300 400 500 600 700 Average Accuracy Iterations P-NMF
22
23
24
SMP - Symmetric Multiprocessor
25
26
27
There also exist hybrid systems - clusters of SMP’s
28
29
(16)
An ideal speedup is linear:
30
using spectral data partitioning
31
32
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
Spatial and Spectral Partitioning Strategies NOT APPROPRIATE instead each CPU evaluates one α value
34
35
Initialize a single thread with α = 1 and evaluate it
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
Initialize all the threads with α = βie
36
a) Hyperspectral Digital Imagery Collection Experiment (HYDICE) b) Photo taken using SOC 700 hyperspectral sensor
37
(a) 85x185 pixels and 40 bands
(a) 160x160 pixels and 120 (b) only 40 bands used
38
39
40
41
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
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
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
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
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
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
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
640000 650000 660000 670000 680000 690000 700000 710000 720000 730000 740000 750000 1 2 3 4 5 6 7 8 9
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
Number of Threads SOC 700 PPG-NMF
48
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
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
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
52
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
a) each band displayed separately as a grayscale image b) 3 bands combined to form a single RGB image
54
Pixels can be in big endian or little endian.
55
56
57
58
59
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
Proceedings IEEE LISAT, 2006, 7 pgs. on CD.
SPIE Intelligent Robots and Computer Vision XXIV, vol. 6384, 2006, 10pgs., in print
Factorization, Proceedings IEEE LISAT 2007, 8 pgs on CD
Hyperspectral Images, submitted to IEEE IGARSS 2007
61