another take on patch-based image processing

61
Another Take on Patch- Based Image Processing 1 Michael Elad The Computer Science Department The Technion – Israel Institute of technology Haifa 32000, Israel Workshop SIGMA'2012 SIGNAL, IMAGE, GEOMETRY, MODELLING, APPROXIMATION * *Joint work with Idan Ram Israel Cohen The Electrical Engineering department Technion – Israel Institute of Technology

Upload: marty

Post on 24-Feb-2016

44 views

Category:

Documents


0 download

DESCRIPTION

*. Another Take on Patch-Based Image Processing . Michael Elad The Computer Science Department The Technion – Israel Institute of technology Haifa 32000, Israel. *Joint work with Idan Ram Israel Cohen - PowerPoint PPT Presentation

TRANSCRIPT

MULTI-MICROPHONE SPEECH DEREVERBERATION USING LIME AND LEAST SQUARES FILTERING

Another Take on Patch-Based Image Processing 1 Michael Elad The Computer Science Department The Technion Israel Institute of technology Haifa 32000, Israel Workshop SIGMA'2012

SIGNAL, IMAGE, GEOMETRY, MODELLING, APPROXIMATION**Joint work with

Idan Ram Israel CohenThe Electrical Engineering department Technion Israel Institute of Technology

12 Patch-Based Processing of ImagesIn the past decade we see more and more researchers suggesting to process a signal or an image with a paradigm of the form:

Break the given image into overlapping (small) patchesOperate on the patches separately or by exploiting inter-relation between themPut back the resulting patches into a result canvas

Another Take on Patch-Based Image Processing By: Michael Elad 23 Patch-Based Processing of ImagesCommon theme: The image patches are believed to exhibit a highly-structured geometrical form in the embedding space they reside in In the past decade we see more and more researchers suggesting to process a signal or an image with a paradigm of the form: Surprisingly, these methods are very effective, actually leading to todays state-of-the-art in many applications

Another Take on Patch-Based Image Processing By: Michael Elad 344 Patches Patches Patches Various Ideas:

Non-local-meansKernel regressionSparse representationsLocally-learned dictionariesBM3DStructured sparsityStructural clustering Subspace clustering Gaussian-mixture-modelsNon-local sparse rep.Self-similarityManifold learningWho are the researchers promoting this line of work? Many leading scientists from various places Sorry if I forgot YOU

You& You?

Another Take on Patch-Based Image Processing By: Michael Elad 4

55 This Talk is About A different way to treat an image using its overlapped patches

Order to form the shortest possible path

Process the PatchesAnother Take on Patch-Based Image Processing By: Michael Elad 5

66 Surprisingly, This Talk is Also About In the process, we will find ourselves returning to regular signals, handling them differently

Processing of Non-Conventionally Structured Signals Many signal-processing tools (filters, transforms, ) are tailored for uniformly sampled signals Now we encounter different types of signals: e.g., point-clouds and graphs. Can we extend classical tools to these signals?Our goal: Generalize the wavelet transform to handle this broad family of signalsIn fact, this is how this work started in the first place Another Take on Patch-Based Image Processing By: Michael Elad 6Part I GTBWT Generalized Tree-Based Wavelet Transform The Basics7This part is taken from the following two papers: I. Ram, M. Elad, and I. Cohen, Generalized Tree-Based Wavelet Transform, IEEE Trans. Signal Processing, vol. 59, no. 9, pp. 41994209, 2011. I. Ram, M. Elad, and I. Cohen, Redundant Wavelets on Graphs and High Dimensional Data Clouds, IEEE Signal Processing Letters, Vol. 19, No. 5, pp. 291294 , May 2012. Another Take on Patch-Based Image Processing By: Michael Elad 7 Problem Formulation8Another Take on Patch-Based Image Processing By: Michael Elad 89 Our GoalWavelet Transform Sparse (compact) RepresentationWe develop both an orthogonal wavelet transform and a redundant alternative, both efficiently representing the input signal f.Our problem: The regular wavelet transform produces a small number of large coefficients when it is applied to piecewise regular signals. But, the signal (vector) f is not necessarily smooth in general.Another Take on Patch-Based Image Processing By: Michael Elad 9Diffusion WaveletsR. R. Coifman, and M. Maggioni, 2006.

Multiscale Methods for Data on Graphs and Irregular Multidimensional SituationsM. Jansen, G. P. Nason, and B. W. Silverman, 2008.

Wavelets on Graph via Spectal Graph TheoryD. K. Hammond, and P. Vandergheynst, and R. Gribonval, 2010.

Multiscale Wavelets on Trees, Graphs and High Dimensional Data: Theory and Applications to Semi Supervised LearningM . Gavish, and B. Nadler, and R. R. Coifman, 2010.

Wavelet Shrinkage on Paths for Denoising of Scattered DataD. Heinen and G. Plonka, to appear Previous and Related Work

10Another Take on Patch-Based Image Processing By: Michael Elad 1011 The Main Idea (1) - PermutationPTT-1P-1ProcessingPermutation1D WaveletAnother Take on Patch-Based Image Processing By: Michael Elad 1112 The Main Idea (2) - PermutationIn fact, we propose to perform a different permutation in each resolution level of the multi-scale pyramid:

Naturally, these permutations will be applied reversely in the inverse transform. Thus, the difference between this and the plain 1D wavelet transform applied on f are the additional permutations, thus preserving the transforms linearity and unitarity, while also adapting to the input signal. Another Take on Patch-Based Image Processing By: Michael Elad 1213 Building the Permutations (1)Lets start with P0 the permutation applied on the incoming signal.

Recall: the wavelet transform is most effective for piecewise regular signals. thus, P0 should be chosen such that P0f is most regular.

So, for example, we can simply permute by sorting the signal f 050100150200250050100150200250050100150200250050100150200250Another Take on Patch-Based Image Processing By: Michael Elad 1314However: we will be dealing with corrupted signals f (noisy, missing values, ) and thus such a sort operation is impossible.

To our help comes the feature vectors in X, which reflect on the order of the signal values, fk. Recall:

Thus, instead of solving for the optimal permutation that simplifies f, we order the features in X to the shortest path that visits in each point once, in what will be an instance of the Traveling-Salesman-Problem (TSP):

Building the Permutations (2)Another Take on Patch-Based Image Processing By: Michael Elad 1415 Building the Permutations (3)We handle the TSP task by a simple (and crude) approximation:

Initialize with an arbitrary index j; Initialize the set of chosen indices to (1)={j}; Repeat k=1:1:N-1 times:Find xi the nearest neighbor to x(k) such that i; Set (k+1)={i}; Result: the set holds the proposed ordering.Another Take on Patch-Based Image Processing By: Michael Elad 1516 Building the Permutations (4)So far we concentrated on P0 at the finest level of the multi-scale pyramid.

In order to construct P1, P2, , PL-1, the permutations at the other pyramids levels, we use the same method, applied on propagated (reordered, filtered and sub-sampled) feature-vectors through the same wavelet pyramid:

P0LP-Filtering (h) & Sub-sampling P1LP-Filtering (h) & Sub-sampling P2LP-Filtering (h) & Sub-sampling P3LP-Filtering (h) & Sub-sampling Another Take on Patch-Based Image Processing By: Michael Elad 1617 Why Generalized Tree ? Generalized tree Tree (Haar wavelet)

Our proposed transform: Generalized Tree-Based Wavelet Transform (GTBWT).

We also developed a redundant version of this transform based on the stationary wavelet transform [Shensa, 1992] [Beylkin, 1992] also related to the A-Trous Wavelet (will not be presented here).

At this stage we could (or should) show how this works on point clouds/graphs, but we will take a different route and demonstrate these tools for images. Another Take on Patch-Based Image Processing By: Michael Elad 17Part II Handling Images Using GTBWT by Handling Image Patches 18This part is taken from the same papers mentioned before I. Ram, M. Elad, and I. Cohen, Generalized Tree-Based Wavelet Transform, IEEE Trans. Signal Processing, vol. 59, no. 9, pp. 41994209, 2011. I. Ram, M. Elad, and I. Cohen, Redundant Wavelets on Graphs and High Dimensional Data Clouds, IEEE Signal Processing Letters, Vol. 19, No. 5, pp. 291294 , May 2012. Another Take on Patch-Based Image Processing By: Michael Elad 1819

Could Images Fit This Data-Structure? * Not exactly. Actually, if we search the nearest-neighbors within a limited window, some of the spatial proximity remains. * Another Take on Patch-Based Image Processing By: Michael Elad 1920 Lets Try (1)020004000600080001000010152025303540455055# CoefficientsPSNRGTBWT permutationat the finest levelcommon 1D2Ddb4For a 128128 center portion of the image Lenna, we compare the image representation efficiency of the GTBWTA common 1D wavelet transform2D wavelet transform.

We measure efficiency by the m-term approximation error, i.e. reconstructing the image from m largest coefficients, zeroing the rest.

Another Take on Patch-Based Image Processing By: Michael Elad 2021 Lets Try (2)020004000600080001000010152025303540455055# CoefficientsPSNRcommon 1Ddb4common 1D2Ddb4GTBWT permutationsat the finest two levelFor a 128128 center portion of the image Lenna, we compare the image representation efficiency of the GTBWTA common 1D wavelet transform2D wavelet transform.

We measure efficiency by the m-term approximation error, i.e. reconstructing the image from m largest coefficients, zeroing the rest.

Another Take on Patch-Based Image Processing By: Michael Elad 2122 Lets Try (3)020004000600080001000010152025303540455055# CoefficientsPSNRcommon 1D2Ddb4GTBWT permutationsat the finest three levelFor a 128128 center portion of the image Lenna, we compare the image representation efficiency of the GTBWTA common 1D wavelet transform2D wavelet transform.

We measure efficiency by the m-term approximation error, i.e. reconstructing the image from m largest coefficients, zeroing the rest.

Another Take on Patch-Based Image Processing By: Michael Elad 22 Lets Try (4)020004000600080001000010152025303540455055# CoefficientsPSNRcommon 1D2Ddb4GTBWT permutationsat all (10) levels23For a 128128 center portion of the image Lenna, we compare the image representation efficiency of the GTBWTA common 1D wavelet transform2D wavelet transform.

We measure efficiency by the m-term approximation error, i.e. reconstructing the image from m largest coefficients, zeroing the rest.

Another Take on Patch-Based Image Processing By: Michael Elad 23 Comparison Between Different Wavelets

db1 (Haar)db4db8GTBWTcomparison24Another Take on Patch-Based Image Processing By: Michael Elad 24 The Representations Atoms Synthetic Image

Scaling functions Originalimage

waveletswaveletswaveletswaveletswaveletswaveletswaveletswaveletswaveletswaveletswaveletswavelets

25Another Take on Patch-Based Image Processing By: Michael Elad 2526

Scaling functions Originalimagewaveletswaveletswaveletswaveletswaveletswaveletswaveletswaveletswaveletswavelets The Representations Atoms Lenna Another Take on Patch-Based Image Processing By: Michael Elad 26 Image Denoising using GTBWT27

Another Take on Patch-Based Image Processing By: Michael Elad 27 Image Denoising Block-Diagram 28Hardthresholding(GTBWT)-1

Noisy imageReconstructed image

GTBWTAnother Take on Patch-Based Image Processing By: Michael Elad 28 Image Denoising Improvements 29Cycle-spinning: Apply the above scheme several (10) times, with a different GTBWT (different random ordering), and average.

Noisy image GTBWTTHRGTBWT-1Averaging GTBWTTHRGTBWT-1Reconstructed image

Another Take on Patch-Based Image Processing By: Michael Elad 29P1LP-Filtering (h) & Sub-sampling Image Denoising Improvements Sub-image averaging: A by-product of GTBWT is the propagation of the whole patches. Thus, we get n transform vectors, each for a shifted version of the image and those can be averaged. P0LP-Filtering (h) & Sub-sampling P2LP-Filtering (h) & Sub-sampling P3LP-Filtering (h) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling 30Another Take on Patch-Based Image Processing By: Michael Elad 30 Image Denoising Improvements P1LP-Filtering (h) & Sub-sampling P0LP-Filtering (h) & Sub-sampling P2LP-Filtering (h) & Sub-sampling P3LP-Filtering (h) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling Sub-image averaging: A by-product of GTBWT is the propagation of the whole patches. Thus, we get n transform vectors, each for a shifted version of the image and those can be averaged.

Combine these transformed pieces; The center row is the transformed coefficients of f. The other rows are also transform coefficients of n shifted versions of the image.We can reconstruct n versions of the image and average.31Another Take on Patch-Based Image Processing By: Michael Elad 31 Image Denoising Improvements 32Restricting the NN: It appears that when searching the nearest-neighbor for the ordering, restriction to near-by area is helpful, both computationally (obviously) and in terms of the output quality.

Another Take on Patch-Based Image Processing By: Michael Elad 32 Image Denoising Improvements 33Another Take on Patch-Based Image Processing By: Michael Elad 33 Image Denoising Results 34We apply the proposed scheme with the Symmlet 8 wavelet to noisy versions of the images Lena and BarbaraFor comparison reasons, we also apply to the two images the K-SVD and BM3D algorithms.

The PSNR results are quite good and competitive. What about run time? /PSNRImageK-SVDBM3DGTBWT10/28.14Lena35.5135.9335.87Barbara34.4434.9834.9425/20.18Lena31.3632.0832.16Barbara29.5730.7230.75Another Take on Patch-Based Image Processing By: Michael Elad 343D Transform & threshold3D Transform & threshold Relation to BM3D?35

BM3D Our scheme

GTBWT, and thresholdReorder, In a nut-shell, while BM3D searches for patch neighbors and process them locally, our approach seeks one path through all the patches (each gets its own neighbors as a consequence), and the eventual processing is done globally.Another Take on Patch-Based Image Processing By: Michael Elad 35Part III Frame Interpreting the GTBWT as a Frame and using it as a Regularizer36This part is documented in the following draft: I. Ram, M. Elad, and I. Cohen, The RTBWT Frame Theory and Use for Images, working draft to be submitted soon.

We rely heavily on Danielyan, Katkovnik, and Eigiazarian, BM3D frames and Variational Image Deblurring, IEEE Trans. on Image Processing, Vol. 21, No. 4, pp. 1715-1728, April 2012.Another Take on Patch-Based Image Processing By: Michael Elad 36 Recall Our Core Scheme37HardThresholding(GTBWT)-1

Noisy imageReconstructed image

GTBWTOr, put differently, : We refer to GTBWT as a redundant frame, and use a heuristic shrinkage method with it, which aims to approximate the solution of

Synthesis:or Analysis: Another Take on Patch-Based Image Processing By: Michael Elad 37 So, Who is Our Frame? 38P1LP-Filtering (h) & Sub-sampling P0LP-Filtering (h) & Sub-sampling P2LP-Filtering (h) & Sub-sampling P3LP-Filtering (h) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling HP-Filtering (g) & Sub-sampling

Bottom line:

The redundancy of our frame is 64J Lexicographic ordering of the N pixelsArray of overlapped patches of size* 64NApplying a J redundant wavelet of some sort with permutationsWe obtain an array of 64JN transform coefficients* For patches of size 88 pixelsAnother Take on Patch-Based Image Processing By: Michael Elad 38 Our Notations39Another Take on Patch-Based Image Processing By: Michael Elad 39 What Can We Do With This Frame? 40We could solve various inverse problems of the form:

where: x is the original imagev is an AWGN, and A is a degradation operator of any sort

We could consider the synthesis, the analysis, or their combination:

Another Take on Patch-Based Image Processing By: Michael Elad 40 Generalized Nash Equilibrium 41* Danielyan, Katkovnik, and Eigiazarian, BM3D frames and Variational Image Deblurring, IEEE Trans. on Image Processing, Vol. 21, No. 4, pp. 1715-1728, April 2012.and solve iteratively*Instead of minimizing the joint analysis/synthesis problem:

break it down into two separate and easy to handle parts:Another Take on Patch-Based Image Processing By: Michael Elad 41 Deblurring Results42

Original Blurred RestoredAnother Take on Patch-Based Image Processing By: Michael Elad 42 Deblurring Results43ImageInput PSNRBM3D-DEB ISNRIDD-BM3D ISNR init. with BM3D-DEBOurs ISNRInit. with BM3D-DEBOurs ISNR 3 iterations with simple initializationLena27.257.957.978.088.20Barbara23.347.807.648.256.21House25.619.329.959.8010.06Cameraman22.238198.859.198.52Blur PSF =

2=2 Another Take on Patch-Based Image Processing By: Michael Elad 43Part IV Patch (Re)-Ordering Lets Simplify Things, Shall We?44This part is based on the paper: I. Ram, M. Elad, and I. Cohen, Image Processing using Smooth Ordering of its Patches, Submitted to IEEE Transactions on Image Processing.Another Take on Patch-Based Image Processing By: Michael Elad 44

4545 Returning to the Basics

We extract all (with overlaps) patches of size BB (e.g. B=20)Then we order these patches to form the shortest path, as before

Suppose we start with a clean image What should we expect? Another Take on Patch-Based Image Processing By: Michael Elad 45

4646 Spatial Neighbor Euclidean NeighborSpatial neighbors are not necessarily expected to remain neighbors in the new ordering

What should we expect? 010020030040010-410-310-210-1100Sqrt Euclidean DistanceHistogram PeppersBarbaraAnother Take on Patch-Based Image Processing By: Michael Elad 46

47 The Reordered Signal is More RegularConsidering the center (or any other) pixel in each patch, the new path is expected to lead to very smooth (or at least, piece-wise smooth) 1D signal. What should we expect? * Measure of smoothness:

Raster scan: 9.57Hilbert curve: 11.77Sorted (ours): 5.63*

Another Take on Patch-Based Image Processing By: Michael Elad 474848 Processing the Permuted PixelsAssumptions: After a shortest-path reordering of the patches form a clean image, we expect a highly regular signal.Reordering a corrupted image is likely to lead to a good quality sort, due to the robustness brought by the patch-matching.An Idea: Given a corrupted image of the form:where: x is the original imagev is an AWGN, and M is a point-wise degradation operator,Apply this process:

Re-order the pixels to a 1D signalProcess the 1D signal with a simple filterRe-order the pixels back to their location

Another Take on Patch-Based Image Processing By: Michael Elad 484949 Use the Reordering for Denoising Extract all (with overlaps) patches of size 1010Order these patches as before (TSP)Take the center-row it represents a permutation of the image pixels to a regular functionNoisy with =25 (20.18dB)Smooth/filter the values along this row in a simple wayReconstruction: 32.65dB* This result is obtained with (i) cycle-spinning, (ii) sub-image averaging, (iii) two iterations, (iv) learning the filter , and (v) switched smoothing.*

Another Take on Patch-Based Image Processing By: Michael Elad 495050 Intuition: Why Should This Work? Ordering based on the noisy pixels Simple smoothingNoisy with =25 (20.18dB)Reconstruction: 32.65dB

True samplesNoisy samplesAnother Take on Patch-Based Image Processing By: Michael Elad 5051 The Simple Smoothing We DoSimple smoothing works fineoptimize h to minimize the reconstruction MSEOriginal imageNoisy imageCompute the TSP permutationApply the permutation on the pixelsApply the permutation on the pixelsApply a 1D filter h+-We can do better by a training phasebut Naturally, this is done off-line and on other images

Training imageAnother Take on Patch-Based Image Processing By: Michael Elad 515252 Filtering A Further Improvement

Cluster the patches to smooth and textured sets, and train a filter per each separatelyThe results we show hereafter were obtained by: Cycle-spinningSub-image averaging Two iterationsLearning the filter , and Switched smoothing.Based on patch-STDAnother Take on Patch-Based Image Processing By: Michael Elad 525353 Denoising Results Using Patch-ReorderingImage/PSNR [dB]10 / 28.1425 / 20.1850 / 14.16LenaK-SVD35.49 31.3627.821st iteration35.3331.5828.542nd iteration35.4131.8129.00BarbaraK-SVD34.4129.5325.401st iteration34.4830.4627.172nd iteration34.4630.5427.45HouseK-SVD36.0032.1228.151st iteration35.5832.4829.372nd iteration35.9432.6529.93Bottom line: (1) This idea works very well;(2) It is especially competitive for high noise levels; and (3) A second iteration almost always pays off. Another Take on Patch-Based Image Processing By: Michael Elad 535454 What About Inpainting? Extract all (with overlaps) patches of size 99Order these patches as before distance uses EXISTING pixels onlyTake the center-row it represents a permutation of the image pixels to a regular function0.8 of the pixels are missing Fill the missing values in a simple (cubic interpolation) wayReconstruction: 29.71dB** This result is obtained with (i) cycle-spinning, (ii) sub-image averaging, and (iii) two iterations.

Another Take on Patch-Based Image Processing By: Michael Elad 545555 The Rationale0.8 of the pixels are missing Reconstruction: 27.15dBOrderingSimple interpolation

Missing sampleExisting sampleAnother Take on Patch-Based Image Processing By: Michael Elad 555656 Inpainting Results Examples

Given data 80% missing pixels1st iteration of the proposed alg.DCT and OMP recoveryBi-Cubic interpolation3rd iteration of the proposed alg.Another Take on Patch-Based Image Processing By: Michael Elad 565757 Inpainting Results ImageMethodPSNR [dB]LenaBi-Cubic30.25DCT + OMP29.97Proposed (1st iter.)30.25Proposed (2nd iter.)31.80Proposed (3rd iter.)31.96BarbaraBi-Cubic22.88DCT + OMP27.15Proposed (1st iter.)27.56Proposed (2nd iter.)29.34Proposed (3rd iter.)29.71HouseBi-Cubic29.21DCT + OMP29.69Proposed (1st iter.)29.03Proposed (2nd iter.)32.10Proposed (3rd iter.)32.71Reconstruction results from 80% missing pixels using various methods: Bottom line: This idea works very well;It is operating much better than the classic sparse-rep. approach; and Using more iterations always pays off, and substantially so. Another Take on Patch-Based Image Processing By: Michael Elad 57Part IV Time to Finish Conclusions and a Bit More58Another Take on Patch-Based Image Processing By: Michael Elad 5859 Conclusions59We propose a new wavelet transform for scalar functions defined on graphs or high dimensional data cloudsThe proposed transform extends the classical orthonormal and redundant wavelet transforms We demonstrate the ability of these transforms to efficiently represent and denoise imagesWe also show that the obtained transform can be used as a regularizer in classical image processing Inverse-ProblemsFinally, we show that using the ordering of the patches only, quite effective denoising and inpainting can be obtainedAnother Take on Patch-Based Image Processing By: Michael Elad 59Sparse Representations and learned dictionaries in the ordered domain?60 What Next ?60Improving the TSP approximation solverDemonstrating the proposed wavelet on true data clouds/graphsWhy TSP? Who says we cannot revisit patches? Replace the TSP ordering by MDS?Replace sub-image averaging with a sparsifying transform Exploiting the known distances???Lifting scheme for treating clouds? Another Take on Patch-Based Image Processing By: Michael Elad 606161Thank you for your time

and

thanks to the organizers of this lovely event:Tom Lyche (Oslo) Marie-Laurence Mazure (Grenoble)Gabriel Peyr (Paris-Dauphine, France)

Questions?

Another Take on Patch-Based Image Processing By: Michael Elad 61