SlideShare a Scribd company logo
1 of 47
Download to read offline
Orthogonal Matching Pursuit
and K-SVD for Sparse Encoding

Manny Ko
Senior Software Engineer, Imaginations Technologies
Robin Green
SSDE, Microsoft Xbox ATG
Outline
●   Signal Representation
●   Orthonormal Bases vs. Frames
●   Dictionaries
●   The Sparse Signal Model
●   Matching Pursuit
●   Implementing Orthonomal Matching Pursuit
●   Learned Dictionaries and KSVD
●   Image Processing with Learned Dictionaries
●   OMP for GPUs
Representing Signals
●   We represent most signals as linear combinations of things
    we already know, called a projection


                      ×    𝛼0 +
                      ×    𝛼1 +   =
                      ×    𝛼2 +
                      ×    𝛼3 + ⋯
Representing Signals
●   Each function we used is a basis and the scalar weights are
    coefficients
                                    𝑁

                     𝑥 𝑡 =               𝑏𝑖 𝑡 𝛼 𝑖
                                  𝑖=0
●   The reconstruction is an approximation to the original 𝑥
                                                      2
    ●   We can measure and control the error   𝑥− 𝑥
Orthonormal Bases (ONBs)
●   The simplest way to represent signals is using a set of
    orthonormal bases

         +∞
                                  0           𝑖≠ 𝑗
               𝑏 𝑖 𝑡 𝑏 𝑗 (𝑡) 𝑑𝑡 =
                                  1           𝑖= 𝑗
        −∞
Example ONBs
●   Fourier Basis                      ●   Gabor Functions
𝑏 𝑘 𝑡 = 𝑒 𝑖2𝑝𝑘𝑡                        𝑏 𝑘,𝑛 𝑡 = 𝜔 𝑡 − 𝑏𝑛 𝑒 𝑖2𝑝𝑘𝑡




●   Wavelets                           ●   Contourlet
𝑏   𝑚,𝑛   𝑡 = 𝑎−𝑚   2   𝑥 𝑎−𝑚 𝑡 − 𝑏𝑚   𝑏 𝑗,𝑘,𝐧 𝑡 = λ 𝑗,𝑘 𝑡 − 2 𝑗−1 𝐒 𝑘 n
Benefits of ONB
●   Analytic formulations

●   Well understood mathematical properties

●   Fast algorithms for projection
Limitations
●   Orthonormal bases are optimal only for specific synthetic
    signals
    ●   If your signal looks exactly like your basis, you only need one
        coefficient


●   Limited expressiveness, all signals behave the same

●   Real world signals often take a lot of coefficients
    ●   Just truncate the series, which leads to artifacts like aliasing
Smooth vs. Sharp
Haar Wavelet Basis   Discrete Cosine Transform
● Sharp edges        ● Smooth signals
● Local support      ● Global support
Overcomplete Bases
●   Frames are overcomplete bases
    ●   There is now more than one way to represent a signal


        Φ = 𝑒1 |𝑒2 |𝑒3                     Φ = 𝑒1 | 𝑒2 |𝑒3

            1 0 1                              2 −1    −1
        =                                  =
            0 1 −1                             0 1     0


●   By relaxing the ONB rules on minimal span, we can better
    approximate signals using more coefficients
Dictionaries
●   A dictionary is an overcomplete basis made of atoms
●   A signal is represented using a linear combination of only a
    few atoms

                           𝑑𝑖 𝛼𝑖 = 𝑥
                     𝑖∈𝐼
                            𝑫𝛼 = 𝑥

●   Atoms work best when zero-mean and normalized
Dictionaries


                       =

                           𝑥
               𝐃
                   α
Mixed Dictionaries
●   A dictionary of Haar + DCT gives the best of both worlds




    But now how do we pick which coefficients to use?
The Sparse Signal Model
                   𝐾


      𝑁                             =              𝑁


           A fixed dictionary
                                           𝑥   resulting



                   𝐃
                                                signal




                                𝛼
                                      Sparse
                                     vector of
                                    coefficients
The Sparse Signal Model
It’s Simple
 ●   Every result is built from a combination of a few atoms


It’s Rich
 ●   It’s a general model, signals are a union of many low dimensional parts


It’s Used Everywhere
 ●   The same model is used for years in Wavelets, JPEG compression,
     anything where we’ve been throwing away coefficients
Solving for Sparsity
What is the minimum number of coefficients we can use?

  1.   Sparsity Constrained
       keep adding atoms until we reach a maximum count
                                        2
             𝛼 = argmin       𝐃𝛼 − 𝑥    2    s. t.   𝛼   0   ≤ 𝐾
                      𝛼
  2.   Error Constrained
       Keep adding atoms until we reach a certain accuracy

                                                         2
             𝛼 = argmin      𝛼   0   s. t.      𝐃𝛼 − 𝑥   2   ≤ 𝜖
                      𝛼
Naïve Sparse Methods
●   We can directly find 𝛼 using Least Squares
        1.   set 𝐿 = 1
        2.   generate 𝑆 = { 𝒫 𝐿 𝑫 }
                                                                       2
        3.   for each set solve the Least Squares problem min 𝐃𝛼 − 𝑥   2
                                                           𝛼
             where 𝑠𝑢𝑝𝑝 𝛼 ∈ 𝑆 𝑖
        4.   if LS error ≤ 𝜖 finish!
        5.   set 𝐿 = 𝐿 + 1
        6.   goto 2


●   Given K=1000 and L=10 at one LS per nanosecond this
    would complete in ~8 million years.
Greedy Methods
Matching Pursuit
1. Set the residual 𝑟 = 𝑥
2. Find an unselected atom             =
   that best matches the
   residual 𝐃𝛼 − 𝑟
                                           𝑥
                               𝐃
3. Re-calculate the residual
   from matched atoms
    𝑟 = 𝑥 − 𝐃𝛼
4. Repeat until 𝑟 ≤ 𝜖
                                   𝛼
Problems with Matching Pursuit (MP)
●   If the dictionary contains atoms that are very similar, they
    tend to match the residual over and over

●   Similar atoms do not help the basis span the space of
    representable values quickly, wasting coefficients in a
    sparsity constrained solution

●   Similar atoms may match strongly but will not have a large
    effect in reducing the absolute error in an error constrained
    solution
Orthogonal Matching Pursuit (OMP)
●   Add an Orthogonal Projection to the residual calculation

    1.   set 𝐼 ∶= ∅ , 𝑟 ≔ 𝑥, 𝛾 ≔ 0
    2.   while (𝑠𝑡𝑜𝑝𝑝𝑖𝑛𝑔 𝑡𝑒𝑠𝑡 𝑓𝑎𝑙𝑠𝑒) do
    3.      𝑘 ≔ argmax 𝑑 𝑘𝑇 𝑟
                    𝑘
    4.     𝐼 ≔ 𝐼, 𝑘
    5.     𝛾𝐼 ≔ 𝐃𝐼 + 𝑥
    6.     𝑟 ≔ 𝑥 − 𝐃𝐼 𝛾𝐼
    7.   end while
Uniqueness and Stability
●   OMP has guaranteed reconstruction (provided the
    dictionary is overcomplete)

●   By projecting the input into the range-space of the atoms,
    we know that that the residual will be orthogonal to the
    selected atoms

●   Unlike Matching Pursuit (MP) that atom, and all similar
    ones, will not be reselected so more of the space is
    spanned per iteration
Orthogonal Projection
●   If the dictionary 𝐃 was square, we could use an inverse
●   Instead we use the Pseudo-inverse 𝐃+ = 𝐃 𝑇 𝐃 −1 𝐃 𝑇


                     −1
         ×    𝐃                       𝑖𝑛𝑣   ×
    𝐃𝑇                      𝐃𝑇   =              𝐃𝑇   =   𝐃+
Pseudoinverse is Fragile
                                                      −1
●   In floating point, the expression 𝐃T 𝐃   is notoriously
    numerically troublesome – the classic FP example

    ●   Picture mapping all the points on a sphere using 𝐃 𝑇 𝐃 then inverting
Implementing the Pseudoinverse
●   To avoid this, and reduce the cost of inversion, we can note that
     𝐃T 𝐃 is always symmetric and positive definite

●   We can break the matrix into two triangular matrices using Cholesky
    Decomposition 𝐀 = 𝐋𝐋 𝑇

●   Incremental Cholesky Decomp reuses the results of the previous
    iteration, adding a single new row and column each time
                      𝐋        0
            𝐋 𝑛𝑒𝑤 =                       where     𝑤 = 𝐋−1 𝐷 𝐼 𝑑 𝑘
                      𝑤𝑇    1 − 𝑤𝑇 𝑤
set 𝐼 ∶= ∅ , 𝐿 ≔ 1 , 𝑟 ≔ 𝑥, 𝛾 ≔ 0,
OMP-Cholesky   1.
                        𝛼 ≔ 𝐃 𝑇 𝑥, 𝑛 ≔ 1
               2.   while (𝑠𝑡𝑜𝑝𝑝𝑖𝑛𝑔 𝑡𝑒𝑠𝑡 𝑓𝑎𝑙𝑠𝑒) do
               3.      𝑘 ≔ argmax 𝑑 𝑘𝑇 𝑟
                               𝑘
               4.     if 𝑛 > 1 then
                          𝑤 ≔ Solve for 𝑤       𝐋𝑤 = 𝐃 𝐼𝑇 𝑑 𝑘
                                        𝐋           𝟎
                                   𝐋≔
                                        𝑤𝑇     1− 𝑤𝑇 𝑤
               5.     𝐼 ≔ 𝐼, 𝑘
               6.     𝛾 𝐼 ≔ Solve for 𝑐      𝐋𝐋 𝑇 𝑐 = 𝛼 𝐼
               7.     𝑟 ≔ 𝑥 − 𝐃𝐼 𝛾𝐼
               8.      𝑛≔ 𝑛+1
               9.   end while
OMP compression of Barbara




 2 atoms        3 atoms      4 atoms
Batch OMP (BOMP)
●   By pre-computing matrices, Batch OMP can speed up OMP
    on large numbers (>1000) of inputs against one dictionary
●   To avoid computing 𝐃 𝑇 𝑟 at each iteration

                  𝐃𝑇 𝑟 =   𝐃 𝑇 (𝑥 − 𝐃 𝐼 (𝐃 𝐈 )+ 𝑥)
                       =    𝐃 𝑇 𝑥 − 𝐆 𝐼 (𝐃 𝐼 )+ 𝑥
                       =   𝐃 𝑇 𝑥 − 𝐆 𝐼 (𝐃 𝐼𝑇 𝐃 𝐼 )−1 𝐃 𝐼𝑇 𝑥
                       =   𝐃 𝑇 𝑥 − 𝐆 𝐼 (𝐆 𝐼,𝐼 )−1 𝐃 𝐼𝑇 𝑥

●   Precompute 𝐃 𝑇 𝑥 and the Gram-matrix 𝐆 = 𝐃 𝑇 𝐃
Learned Dictionaries and K-SVD
●   OMP works well for a fixed dictionary, but it would work
    better if we could optimize the dictionary to fit the data




     𝐗   ⋯        ≈                𝐃                     𝐀⋯
Sourcing Enough Data
●   For training you will need a large number of samples
    compared to the size of the dictionary.
●   Take blocks from all integer offsets on the pixel grid




                                         𝑥=           …
𝐃
1. Sparse Encode
●   Sparse encode all entries
    in 𝐱. Collect these sparse
    vectors into a square
    array 𝐀




                                      ⋯
                                 ⋯
                                 𝐗T   𝐀T
2. Dictionary Update
●   Find all 𝐗 that use atom in
    column 𝒅 𝑘




                                      ⋯
                                  ⋯
2. Dictionary Update
●   Find all 𝐗 that use atom in
    column 𝑑 𝑘

●   Calculate the error without 𝑑 𝑘
    by 𝐄 = 𝐗 𝐼 − 𝑖≠𝑘 𝑑 𝑖 𝐀 𝐢
                                                                𝑎
●   Solve the LS problem:
                                      2
           𝑑, 𝑎 = Argmin 𝐄 − 𝑑𝑎 𝑇      𝐹   𝑠. 𝑡.   𝑑   2   =1
                       𝑑,𝑎
●   Update 𝑑 𝑖 with the new 𝑑
    and 𝐀 with the new 𝑎
Atoms after K-SVD Update
How many iterations of update?
  600000


  550000


  500000


  450000


  400000
                                                  Batch OMP
  350000


  300000                                          K-SVD
  250000


  200000
           0   10   20   30   40   50   60   70
Sparse Image Compression
●   As we have seen, we can control the number of atoms
    used per block

●   We can also specify the exact size of the dictionary and
    optimize it for each data source

●   The resulting coefficient stream can be coded using a
    Predictive Coder like Huffman or Arithmetic coding
Domain Specific Compression
●    Using just 550 bytes
     per image


1.   Original
2.   JPEG
3.   JPEG2000
4.   PCA
5.   KSVD per block
Sparse Denoising
●   Uniform noise is incompressible and OMP will reject it
●   KSVD can train a denoising dictionary from noisy image blocks




                            20
         Source            Noisy image         Result 30.829dB
Sparse Inpainting
●   Missing values in 𝐱 means missing rows in 𝐃
●   Remove these rows and refit α to recover 𝐱
    ●   If 𝛼 was sparse enough, the recovery will be perfect



                                                 =
Sparse Inpainting




  Original    80% missing   Result
Super Resolution
Super Resolution




  The Original   Bicubic Interpolation   SR result
Block compression of Voxel grids
●   “A Compression Domain output-sensitive volume rendering architecture
    based on sparse representation of voxel blocks” Gobbetti, Guitian and
    Marton [2012]

●   COVRA sparsely represents each voxel block as a dictionary of 8x8x8
    blocks and three coefficients

●   The voxel patch is reconstructed only inside the GPU shader so voxels are
    decompressed just-in-time

●   Huge bandwidth improvements, larger models and faster rendering
Thank you to:
●   Ron Rubstein & Michael Elad
●   Marc LeBrun
●   Enrico Gobbetti

More Related Content

What's hot

Forward-Forward Algorithm
Forward-Forward AlgorithmForward-Forward Algorithm
Forward-Forward AlgorithmDong Heon Cho
 
Feed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descentFeed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descentMuhammad Rasel
 
Activation functions
Activation functionsActivation functions
Activation functionsPRATEEK SAHU
 
Neural network
Neural networkNeural network
Neural networkSilicon
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Gaurav Mittal
 
Non Deterministic and Deterministic Problems
Non Deterministic and Deterministic Problems Non Deterministic and Deterministic Problems
Non Deterministic and Deterministic Problems Scandala Tamang
 
Long Short Term Memory
Long Short Term MemoryLong Short Term Memory
Long Short Term MemoryYan Xu
 
Deep Learning from scratch 3장 : neural network
Deep Learning from scratch 3장 : neural networkDeep Learning from scratch 3장 : neural network
Deep Learning from scratch 3장 : neural networkJinSooKim80
 
Autoencoder
AutoencoderAutoencoder
AutoencoderHARISH R
 
Proximal Policy Optimization
Proximal Policy OptimizationProximal Policy Optimization
Proximal Policy OptimizationShubhaManikarnike
 
Chapter 19 Variational Inference
Chapter 19 Variational InferenceChapter 19 Variational Inference
Chapter 19 Variational InferenceKyeongUkJang
 
Brief intro : Invariance and Equivariance
Brief intro : Invariance and EquivarianceBrief intro : Invariance and Equivariance
Brief intro : Invariance and Equivariance홍배 김
 
Convolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in TheanoConvolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in TheanoSeongwon Hwang
 
Counterpropagation NETWORK
Counterpropagation NETWORKCounterpropagation NETWORK
Counterpropagation NETWORKESCOM
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRUananth
 

What's hot (20)

Forward-Forward Algorithm
Forward-Forward AlgorithmForward-Forward Algorithm
Forward-Forward Algorithm
 
Feed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descentFeed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descent
 
Activation functions
Activation functionsActivation functions
Activation functions
 
RNN-LSTM.pptx
RNN-LSTM.pptxRNN-LSTM.pptx
RNN-LSTM.pptx
 
Autoencoders
AutoencodersAutoencoders
Autoencoders
 
Neural network
Neural networkNeural network
Neural network
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
 
Gradient descent method
Gradient descent methodGradient descent method
Gradient descent method
 
Non Deterministic and Deterministic Problems
Non Deterministic and Deterministic Problems Non Deterministic and Deterministic Problems
Non Deterministic and Deterministic Problems
 
Long Short Term Memory
Long Short Term MemoryLong Short Term Memory
Long Short Term Memory
 
Ripple Carry Adder
Ripple Carry AdderRipple Carry Adder
Ripple Carry Adder
 
Deep Learning from scratch 3장 : neural network
Deep Learning from scratch 3장 : neural networkDeep Learning from scratch 3장 : neural network
Deep Learning from scratch 3장 : neural network
 
Autoencoder
AutoencoderAutoencoder
Autoencoder
 
Proximal Policy Optimization
Proximal Policy OptimizationProximal Policy Optimization
Proximal Policy Optimization
 
Chapter 19 Variational Inference
Chapter 19 Variational InferenceChapter 19 Variational Inference
Chapter 19 Variational Inference
 
Brief intro : Invariance and Equivariance
Brief intro : Invariance and EquivarianceBrief intro : Invariance and Equivariance
Brief intro : Invariance and Equivariance
 
LSTM
LSTMLSTM
LSTM
 
Convolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in TheanoConvolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in Theano
 
Counterpropagation NETWORK
Counterpropagation NETWORKCounterpropagation NETWORK
Counterpropagation NETWORK
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRU
 

Similar to omp-and-k-svd - Gdc2013

Dictionary Learning in Games - GDC 2014
Dictionary Learning in Games - GDC 2014Dictionary Learning in Games - GDC 2014
Dictionary Learning in Games - GDC 2014Manchor Ko
 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsSantiagoGarridoBulln
 
Uniform Boundedness of Shift Operators
Uniform Boundedness of Shift OperatorsUniform Boundedness of Shift Operators
Uniform Boundedness of Shift Operatorsiosrjce
 
Learning group em - 20171025 - copy
Learning group   em - 20171025 - copyLearning group   em - 20171025 - copy
Learning group em - 20171025 - copyShuai Zhang
 
MHT Multi Hypothesis Tracking - Part2
MHT Multi Hypothesis Tracking - Part2MHT Multi Hypothesis Tracking - Part2
MHT Multi Hypothesis Tracking - Part2Engin Gul
 
Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!ChenYiHuang5
 
Average Sensitivity of Graph Algorithms
Average Sensitivity of Graph AlgorithmsAverage Sensitivity of Graph Algorithms
Average Sensitivity of Graph AlgorithmsYuichi Yoshida
 
Paper Study: Transformer dissection
Paper Study: Transformer dissectionPaper Study: Transformer dissection
Paper Study: Transformer dissectionChenYiHuang5
 
WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...
WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...
WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...Reddyjanardhan221
 
Generalized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral TransformationGeneralized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral TransformationIJERA Editor
 
Modeling with Recurrence Relations
Modeling with Recurrence RelationsModeling with Recurrence Relations
Modeling with Recurrence RelationsDevanshu Taneja
 
Neural Network
Neural NetworkNeural Network
Neural Networksamisounda
 
Solving Poisson Equation using Conjugate Gradient Method and its implementation
Solving Poisson Equation using Conjugate Gradient Methodand its implementationSolving Poisson Equation using Conjugate Gradient Methodand its implementation
Solving Poisson Equation using Conjugate Gradient Method and its implementationJongsu "Liam" Kim
 
Support vector machines
Support vector machinesSupport vector machines
Support vector machinesJinho Lee
 
Lecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxLecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxSunny432360
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logicYamagata Yoriyuki
 
J. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AI
J. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AIJ. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AI
J. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AIMLILAB
 
Lecture Notes: EEEC4340318 Instrumentation and Control Systems - Root Locus ...
Lecture Notes:  EEEC4340318 Instrumentation and Control Systems - Root Locus ...Lecture Notes:  EEEC4340318 Instrumentation and Control Systems - Root Locus ...
Lecture Notes: EEEC4340318 Instrumentation and Control Systems - Root Locus ...AIMST University
 

Similar to omp-and-k-svd - Gdc2013 (20)

Dictionary Learning in Games - GDC 2014
Dictionary Learning in Games - GDC 2014Dictionary Learning in Games - GDC 2014
Dictionary Learning in Games - GDC 2014
 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methods
 
Uniform Boundedness of Shift Operators
Uniform Boundedness of Shift OperatorsUniform Boundedness of Shift Operators
Uniform Boundedness of Shift Operators
 
Learning group em - 20171025 - copy
Learning group   em - 20171025 - copyLearning group   em - 20171025 - copy
Learning group em - 20171025 - copy
 
MHT Multi Hypothesis Tracking - Part2
MHT Multi Hypothesis Tracking - Part2MHT Multi Hypothesis Tracking - Part2
MHT Multi Hypothesis Tracking - Part2
 
Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!
 
Restricted boltzmann machine
Restricted boltzmann machineRestricted boltzmann machine
Restricted boltzmann machine
 
Average Sensitivity of Graph Algorithms
Average Sensitivity of Graph AlgorithmsAverage Sensitivity of Graph Algorithms
Average Sensitivity of Graph Algorithms
 
Paper Study: Transformer dissection
Paper Study: Transformer dissectionPaper Study: Transformer dissection
Paper Study: Transformer dissection
 
WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...
WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...
WINSEM2022-23_CSI2005_TH_VL2022230504110_Reference_Material_II_22-12-2022_1.2...
 
Generalized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral TransformationGeneralized Laplace - Mellin Integral Transformation
Generalized Laplace - Mellin Integral Transformation
 
Modeling with Recurrence Relations
Modeling with Recurrence RelationsModeling with Recurrence Relations
Modeling with Recurrence Relations
 
Neural Network
Neural NetworkNeural Network
Neural Network
 
Solving Poisson Equation using Conjugate Gradient Method and its implementation
Solving Poisson Equation using Conjugate Gradient Methodand its implementationSolving Poisson Equation using Conjugate Gradient Methodand its implementation
Solving Poisson Equation using Conjugate Gradient Method and its implementation
 
Support vector machines
Support vector machinesSupport vector machines
Support vector machines
 
Lecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxLecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptx
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logic
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
J. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AI
J. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AIJ. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AI
J. Song, H. Shim et al., ICASSP 2021, MLILAB, KAIST AI
 
Lecture Notes: EEEC4340318 Instrumentation and Control Systems - Root Locus ...
Lecture Notes:  EEEC4340318 Instrumentation and Control Systems - Root Locus ...Lecture Notes:  EEEC4340318 Instrumentation and Control Systems - Root Locus ...
Lecture Notes: EEEC4340318 Instrumentation and Control Systems - Root Locus ...
 

More from Manchor Ko

Non-Local Means and its Applications
Non-Local Means and its ApplicationsNon-Local Means and its Applications
Non-Local Means and its ApplicationsManchor Ko
 
ParallelRandom-mannyko
ParallelRandom-mannykoParallelRandom-mannyko
ParallelRandom-mannykoManchor Ko
 
Parallel Random Generator - GDC 2015
Parallel Random Generator - GDC 2015Parallel Random Generator - GDC 2015
Parallel Random Generator - GDC 2015Manchor Ko
 
Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination Manchor Ko
 
Mesh simplification notes
Mesh simplification notesMesh simplification notes
Mesh simplification notesManchor Ko
 
Cache aware hybrid sorter
Cache aware hybrid sorterCache aware hybrid sorter
Cache aware hybrid sorterManchor Ko
 

More from Manchor Ko (6)

Non-Local Means and its Applications
Non-Local Means and its ApplicationsNon-Local Means and its Applications
Non-Local Means and its Applications
 
ParallelRandom-mannyko
ParallelRandom-mannykoParallelRandom-mannyko
ParallelRandom-mannyko
 
Parallel Random Generator - GDC 2015
Parallel Random Generator - GDC 2015Parallel Random Generator - GDC 2015
Parallel Random Generator - GDC 2015
 
Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination Gdc2012 frames, sparsity and global illumination
Gdc2012 frames, sparsity and global illumination
 
Mesh simplification notes
Mesh simplification notesMesh simplification notes
Mesh simplification notes
 
Cache aware hybrid sorter
Cache aware hybrid sorterCache aware hybrid sorter
Cache aware hybrid sorter
 

Recently uploaded

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

omp-and-k-svd - Gdc2013

  • 1. Orthogonal Matching Pursuit and K-SVD for Sparse Encoding Manny Ko Senior Software Engineer, Imaginations Technologies Robin Green SSDE, Microsoft Xbox ATG
  • 2. Outline ● Signal Representation ● Orthonormal Bases vs. Frames ● Dictionaries ● The Sparse Signal Model ● Matching Pursuit ● Implementing Orthonomal Matching Pursuit ● Learned Dictionaries and KSVD ● Image Processing with Learned Dictionaries ● OMP for GPUs
  • 3. Representing Signals ● We represent most signals as linear combinations of things we already know, called a projection × 𝛼0 + × 𝛼1 + = × 𝛼2 + × 𝛼3 + ⋯
  • 4. Representing Signals ● Each function we used is a basis and the scalar weights are coefficients 𝑁 𝑥 𝑡 = 𝑏𝑖 𝑡 𝛼 𝑖 𝑖=0 ● The reconstruction is an approximation to the original 𝑥 2 ● We can measure and control the error 𝑥− 𝑥
  • 5. Orthonormal Bases (ONBs) ● The simplest way to represent signals is using a set of orthonormal bases +∞ 0 𝑖≠ 𝑗 𝑏 𝑖 𝑡 𝑏 𝑗 (𝑡) 𝑑𝑡 = 1 𝑖= 𝑗 −∞
  • 6. Example ONBs ● Fourier Basis ● Gabor Functions 𝑏 𝑘 𝑡 = 𝑒 𝑖2𝑝𝑘𝑡 𝑏 𝑘,𝑛 𝑡 = 𝜔 𝑡 − 𝑏𝑛 𝑒 𝑖2𝑝𝑘𝑡 ● Wavelets ● Contourlet 𝑏 𝑚,𝑛 𝑡 = 𝑎−𝑚 2 𝑥 𝑎−𝑚 𝑡 − 𝑏𝑚 𝑏 𝑗,𝑘,𝐧 𝑡 = λ 𝑗,𝑘 𝑡 − 2 𝑗−1 𝐒 𝑘 n
  • 7. Benefits of ONB ● Analytic formulations ● Well understood mathematical properties ● Fast algorithms for projection
  • 8. Limitations ● Orthonormal bases are optimal only for specific synthetic signals ● If your signal looks exactly like your basis, you only need one coefficient ● Limited expressiveness, all signals behave the same ● Real world signals often take a lot of coefficients ● Just truncate the series, which leads to artifacts like aliasing
  • 9. Smooth vs. Sharp Haar Wavelet Basis Discrete Cosine Transform ● Sharp edges ● Smooth signals ● Local support ● Global support
  • 10. Overcomplete Bases ● Frames are overcomplete bases ● There is now more than one way to represent a signal Φ = 𝑒1 |𝑒2 |𝑒3 Φ = 𝑒1 | 𝑒2 |𝑒3 1 0 1 2 −1 −1 = = 0 1 −1 0 1 0 ● By relaxing the ONB rules on minimal span, we can better approximate signals using more coefficients
  • 11. Dictionaries ● A dictionary is an overcomplete basis made of atoms ● A signal is represented using a linear combination of only a few atoms 𝑑𝑖 𝛼𝑖 = 𝑥 𝑖∈𝐼 𝑫𝛼 = 𝑥 ● Atoms work best when zero-mean and normalized
  • 12. Dictionaries = 𝑥 𝐃 α
  • 13. Mixed Dictionaries ● A dictionary of Haar + DCT gives the best of both worlds But now how do we pick which coefficients to use?
  • 14. The Sparse Signal Model 𝐾 𝑁 = 𝑁 A fixed dictionary 𝑥 resulting 𝐃 signal 𝛼 Sparse vector of coefficients
  • 15. The Sparse Signal Model It’s Simple ● Every result is built from a combination of a few atoms It’s Rich ● It’s a general model, signals are a union of many low dimensional parts It’s Used Everywhere ● The same model is used for years in Wavelets, JPEG compression, anything where we’ve been throwing away coefficients
  • 16. Solving for Sparsity What is the minimum number of coefficients we can use? 1. Sparsity Constrained keep adding atoms until we reach a maximum count 2 𝛼 = argmin 𝐃𝛼 − 𝑥 2 s. t. 𝛼 0 ≤ 𝐾 𝛼 2. Error Constrained Keep adding atoms until we reach a certain accuracy 2 𝛼 = argmin 𝛼 0 s. t. 𝐃𝛼 − 𝑥 2 ≤ 𝜖 𝛼
  • 17. Naïve Sparse Methods ● We can directly find 𝛼 using Least Squares 1. set 𝐿 = 1 2. generate 𝑆 = { 𝒫 𝐿 𝑫 } 2 3. for each set solve the Least Squares problem min 𝐃𝛼 − 𝑥 2 𝛼 where 𝑠𝑢𝑝𝑝 𝛼 ∈ 𝑆 𝑖 4. if LS error ≤ 𝜖 finish! 5. set 𝐿 = 𝐿 + 1 6. goto 2 ● Given K=1000 and L=10 at one LS per nanosecond this would complete in ~8 million years.
  • 18. Greedy Methods Matching Pursuit 1. Set the residual 𝑟 = 𝑥 2. Find an unselected atom = that best matches the residual 𝐃𝛼 − 𝑟 𝑥 𝐃 3. Re-calculate the residual from matched atoms 𝑟 = 𝑥 − 𝐃𝛼 4. Repeat until 𝑟 ≤ 𝜖 𝛼
  • 19. Problems with Matching Pursuit (MP) ● If the dictionary contains atoms that are very similar, they tend to match the residual over and over ● Similar atoms do not help the basis span the space of representable values quickly, wasting coefficients in a sparsity constrained solution ● Similar atoms may match strongly but will not have a large effect in reducing the absolute error in an error constrained solution
  • 20. Orthogonal Matching Pursuit (OMP) ● Add an Orthogonal Projection to the residual calculation 1. set 𝐼 ∶= ∅ , 𝑟 ≔ 𝑥, 𝛾 ≔ 0 2. while (𝑠𝑡𝑜𝑝𝑝𝑖𝑛𝑔 𝑡𝑒𝑠𝑡 𝑓𝑎𝑙𝑠𝑒) do 3. 𝑘 ≔ argmax 𝑑 𝑘𝑇 𝑟 𝑘 4. 𝐼 ≔ 𝐼, 𝑘 5. 𝛾𝐼 ≔ 𝐃𝐼 + 𝑥 6. 𝑟 ≔ 𝑥 − 𝐃𝐼 𝛾𝐼 7. end while
  • 21. Uniqueness and Stability ● OMP has guaranteed reconstruction (provided the dictionary is overcomplete) ● By projecting the input into the range-space of the atoms, we know that that the residual will be orthogonal to the selected atoms ● Unlike Matching Pursuit (MP) that atom, and all similar ones, will not be reselected so more of the space is spanned per iteration
  • 22. Orthogonal Projection ● If the dictionary 𝐃 was square, we could use an inverse ● Instead we use the Pseudo-inverse 𝐃+ = 𝐃 𝑇 𝐃 −1 𝐃 𝑇 −1 × 𝐃 𝑖𝑛𝑣 × 𝐃𝑇 𝐃𝑇 = 𝐃𝑇 = 𝐃+
  • 23. Pseudoinverse is Fragile −1 ● In floating point, the expression 𝐃T 𝐃 is notoriously numerically troublesome – the classic FP example ● Picture mapping all the points on a sphere using 𝐃 𝑇 𝐃 then inverting
  • 24. Implementing the Pseudoinverse ● To avoid this, and reduce the cost of inversion, we can note that 𝐃T 𝐃 is always symmetric and positive definite ● We can break the matrix into two triangular matrices using Cholesky Decomposition 𝐀 = 𝐋𝐋 𝑇 ● Incremental Cholesky Decomp reuses the results of the previous iteration, adding a single new row and column each time 𝐋 0 𝐋 𝑛𝑒𝑤 = where 𝑤 = 𝐋−1 𝐷 𝐼 𝑑 𝑘 𝑤𝑇 1 − 𝑤𝑇 𝑤
  • 25. set 𝐼 ∶= ∅ , 𝐿 ≔ 1 , 𝑟 ≔ 𝑥, 𝛾 ≔ 0, OMP-Cholesky 1. 𝛼 ≔ 𝐃 𝑇 𝑥, 𝑛 ≔ 1 2. while (𝑠𝑡𝑜𝑝𝑝𝑖𝑛𝑔 𝑡𝑒𝑠𝑡 𝑓𝑎𝑙𝑠𝑒) do 3. 𝑘 ≔ argmax 𝑑 𝑘𝑇 𝑟 𝑘 4. if 𝑛 > 1 then 𝑤 ≔ Solve for 𝑤 𝐋𝑤 = 𝐃 𝐼𝑇 𝑑 𝑘 𝐋 𝟎 𝐋≔ 𝑤𝑇 1− 𝑤𝑇 𝑤 5. 𝐼 ≔ 𝐼, 𝑘 6. 𝛾 𝐼 ≔ Solve for 𝑐 𝐋𝐋 𝑇 𝑐 = 𝛼 𝐼 7. 𝑟 ≔ 𝑥 − 𝐃𝐼 𝛾𝐼 8. 𝑛≔ 𝑛+1 9. end while
  • 26. OMP compression of Barbara 2 atoms 3 atoms 4 atoms
  • 27.
  • 28.
  • 29.
  • 30. Batch OMP (BOMP) ● By pre-computing matrices, Batch OMP can speed up OMP on large numbers (>1000) of inputs against one dictionary ● To avoid computing 𝐃 𝑇 𝑟 at each iteration 𝐃𝑇 𝑟 = 𝐃 𝑇 (𝑥 − 𝐃 𝐼 (𝐃 𝐈 )+ 𝑥) = 𝐃 𝑇 𝑥 − 𝐆 𝐼 (𝐃 𝐼 )+ 𝑥 = 𝐃 𝑇 𝑥 − 𝐆 𝐼 (𝐃 𝐼𝑇 𝐃 𝐼 )−1 𝐃 𝐼𝑇 𝑥 = 𝐃 𝑇 𝑥 − 𝐆 𝐼 (𝐆 𝐼,𝐼 )−1 𝐃 𝐼𝑇 𝑥 ● Precompute 𝐃 𝑇 𝑥 and the Gram-matrix 𝐆 = 𝐃 𝑇 𝐃
  • 31. Learned Dictionaries and K-SVD ● OMP works well for a fixed dictionary, but it would work better if we could optimize the dictionary to fit the data 𝐗 ⋯ ≈ 𝐃 𝐀⋯
  • 32. Sourcing Enough Data ● For training you will need a large number of samples compared to the size of the dictionary. ● Take blocks from all integer offsets on the pixel grid 𝑥= …
  • 33. 𝐃 1. Sparse Encode ● Sparse encode all entries in 𝐱. Collect these sparse vectors into a square array 𝐀 ⋯ ⋯ 𝐗T 𝐀T
  • 34. 2. Dictionary Update ● Find all 𝐗 that use atom in column 𝒅 𝑘 ⋯ ⋯
  • 35. 2. Dictionary Update ● Find all 𝐗 that use atom in column 𝑑 𝑘 ● Calculate the error without 𝑑 𝑘 by 𝐄 = 𝐗 𝐼 − 𝑖≠𝑘 𝑑 𝑖 𝐀 𝐢 𝑎 ● Solve the LS problem: 2 𝑑, 𝑎 = Argmin 𝐄 − 𝑑𝑎 𝑇 𝐹 𝑠. 𝑡. 𝑑 2 =1 𝑑,𝑎 ● Update 𝑑 𝑖 with the new 𝑑 and 𝐀 with the new 𝑎
  • 37. How many iterations of update? 600000 550000 500000 450000 400000 Batch OMP 350000 300000 K-SVD 250000 200000 0 10 20 30 40 50 60 70
  • 38. Sparse Image Compression ● As we have seen, we can control the number of atoms used per block ● We can also specify the exact size of the dictionary and optimize it for each data source ● The resulting coefficient stream can be coded using a Predictive Coder like Huffman or Arithmetic coding
  • 39.
  • 40. Domain Specific Compression ● Using just 550 bytes per image 1. Original 2. JPEG 3. JPEG2000 4. PCA 5. KSVD per block
  • 41. Sparse Denoising ● Uniform noise is incompressible and OMP will reject it ● KSVD can train a denoising dictionary from noisy image blocks   20 Source Noisy image Result 30.829dB
  • 42. Sparse Inpainting ● Missing values in 𝐱 means missing rows in 𝐃 ● Remove these rows and refit α to recover 𝐱 ● If 𝛼 was sparse enough, the recovery will be perfect =
  • 43. Sparse Inpainting Original 80% missing Result
  • 45. Super Resolution The Original Bicubic Interpolation SR result
  • 46. Block compression of Voxel grids ● “A Compression Domain output-sensitive volume rendering architecture based on sparse representation of voxel blocks” Gobbetti, Guitian and Marton [2012] ● COVRA sparsely represents each voxel block as a dictionary of 8x8x8 blocks and three coefficients ● The voxel patch is reconstructed only inside the GPU shader so voxels are decompressed just-in-time ● Huge bandwidth improvements, larger models and faster rendering
  • 47. Thank you to: ● Ron Rubstein & Michael Elad ● Marc LeBrun ● Enrico Gobbetti