Signal reconstruction from multiscale edges
A wavelet based algorithm
Author
Yen-Ming Mark Lai
Advisor
Dr. Radu Balan
CSCAMM, MATH
Reference
• “Characterization of Signals from Multiscale Edges”
• Stephane Mallat and Sifen Zhong
• IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 14, pp 710-732, July 1992
Motivation
Input Signal (256 points)
Which points to save?
Compressed Signal (37 points)
What else for reconstruction?
Compressed Signal (37 points)
sharp one-sided edge
Compressed Signal (37 points)
sharp two-sided edge
Compressed Signal (37 points)
“noisy” edges
Calculation
Reconstruction:
• edges
• edge type information
Original: (256 points)
(37 points)
(x points)
37
Compression
edges edge type
+ x < 256
Summary
Save edges
Summary
Save edge type
sharp one-sided edge
sharp two-sided edge
“noisy” edges
Summary
edges edge type reconstruct+ =
Algorithm
Decomposition + Reconstruction
Decomposition
Discrete Wavelet
Transform
Save edges e.g. local extrema
Input
“edges+edge type”
Reconstruction
Find approximation
Inverse Wavelet
Transform
Output
local extrema “edges+edge type”
What is Discrete Wavelet Transform?
Discrete Wavelet
Transform
Input
What is DWT?
1) Choose mother wavelet
2) Dilate mother wavelet
3) Convolve family with input
DWT
1) Choose mother wavelet
2) Dilate mother waveletmother wavelet
dilate
2) Dilate mother wavelet
Convolve family with input
input
input
input
wavelet scale 1
wavelet scale 2
wavelet scale 4
=
=
=
Convolve “family”
input
input
input
wavelet scale 1
wavelet scale 2
wavelet scale 4
=
=
=
DWT
multiscale
What is DWT?
(mathematically)
How to dilate?
)2(
2
1)(
2 jj
xxj
mother wavelet
How to dilate?
)2(
2
1)(
2 jj
xxj
dyadic (powers of two)
How to dilate?
)2(
2
1)(
2 jj
xxj
scale
How to dilate?
)2(
2
1)(
2 jj
xxj z
halve amplitude
double support
Mother Wavelet (Haar)scale 1, j=0
Mother Wavelet (Haar)
scale 2, j=1
Mother Wavelet (Haar)
scale 4, j=2
What is DWT?
Convolution of dilates of mother wavelets against original signal.
)()2(
2
1)()(
2xf
xxfx
jjj
What is DWT?
Convolution of dilates of mother wavelets against original signal.
)()2(
2
1)()(
2xf
xxfx
jjj
convolution
What is DWT?
Convolution of dilates of mother wavelets against original signal.
)()2(
2
1)()(
2xf
xxfx
jjj
dilates
What is DWT?
Convolution of dilates of mother wavelets against original signal.
)()2(
2
1)()(
2xf
xxfx
jjj
original signal
What is convolution?(best match operation)
Discrete Wavelet
Transform
Input1)mother wavelet
2)dilation
3)convolution
Convolution (best match operator)
dtgftgf )()()(
dummy variable
Convolution (best match operator)
flip g around y axis
dtgftgf )()()(
dtgftgf )()()(
Convolution (best match operator)
shifts g by t
dtgftgf )()()(
do nothing to f
Convolution (best match operator)
dtgftgf )()()(
Convolution (best match operator)
pointwise multiplication
dtgftgf )()()(
Convolution (best match operator)
integrate over R
)7.7(gf
flip g and shift by 7.7
dgf )7.7()(
Convolution (one point)
)7.7(gf
do nothing to f
dgf )7.7()(
Convolution (one point)
)7.7(gf
multiply f and g pointwise
dgf )7.7()(
Convolution (one point)
)7.7(gf
integrate over R
dgf )7.7()(
Convolution (one point)
)7.7(gf
Convolution (one point)
scalar
Convolution of two boxes
f
Convolution of two boxes
45.1g
Convolution of two boxes
45.1t
Convolution of two boxes
dgfgf )45.1()()45.1( 0
Convolution of two boxes
f
Convolution of two boxes
5.0g
Convolution of two boxes
5.0t
Convolution of two boxes
dgfgf )5.0()()5.0( 5.0
Convolution of two boxes
Convolution of two boxes
gf
Why convolution?
Location of maximum best fit
Where does red box most look like blue box?
Why convolution?
Location of maximum best fit
maximum
Why convolution?
Location of maximum best fit
maxima best fit location
Where does exponential most look like box?
Where does exponential most look like box?
Where does exponential most look like box?
maximum
Where does exponential most look like box?
maximum best fit location
So what?
If wavelet is an edge, convolution detects location of edges
Mother Wavelet (Haar)
Mother Wavelet (Haar)
Mother Wavelet (Haar)
What is edge?
Local extrema of wavelet transform
Summary of Decomposition
Discrete Wavelet
Transform
Save “edges” e.g. local extrema
Input
“edges+edge type”
Summary of Decomposition
input
input
input
edge detection (scale 1)
edge detection (scale 2)
edge detection (scale 4)
=
=
=
How to find approximation?
Find approximation
local extrema“edges+edge type”
Find approximation (iterative)
Alternate projections between two spaces
Find approximation (iterative)
2'2
22:LnLnn ffnf
Find approximation (iterative)
2'2
22:LnLnn ffnf
H_1 Sobolev Norm
Find approximation (iterative)
functions that interpolate given local maxima points
Find approximation (iterative)
dyadic wavelet transforms of L^2 functions
Find approximation (iterative)
intersection = space of solutions
Find approximation (iterative)
Start at zero element to minimize solution’s norm
Q: Why minimize over K?
A: Interpolation points act like local extrema
2'2
22:LnLnn ffnf
Reconstruction
Find approximation(minimization
problem)
Inverse Wavelet
Transform
Output
Example
Input of 256 points
Input Signal (256 points)
Input Signal (256 points)
major edges
Input Signal (256 points)
minor edges (many)
Discrete Wavelet Transform
fW dj2
Dyadic (powers of 2)
= DWT of “f” at scale 2^j
DWT (9 scales, 256 points each)
DWT (9 scales, 256 points each)
major edges
Input Signal (256 points)
major edges
DWT (9 scales, 256 points each)
minor edges (many)
Input Signal (256 points)
minor edges (many)
Decomposition
Discrete Wavelet
Transform
Save “edges” e.g. local extrema
Input
DWT (9 scales, 256 points each)
Save Local Maxima
Local Maxima of Transform
Local Maxima of Transform
low scale most sensitive
Mother Wavelet (Haar)
Local Maxima of Transform
high scale least sensitive
Mother Wavelet (Haar)
Decomposition
Discrete Wavelet
Transform
Save “edges” e.g. local extrema
Input
Local Maxima of Transform
Find approximation (iterative)
Alternate projections between two spaces
Reconstruction
Find approximation(minimization
problem)
Inverse Wavelet
Transform
Output
Mallat’s Reconstruction (20 iterations)
original
reconstruction (20 iterations)
Implementation
Language: MATLAB – Matlab wavelet toolbox
Complexity: convergence criteria
Databases
• Baseline signals
– sinusoids, Gaussians, step edges, Diracs
• Audio signals
Validation
• Unit testing of components
– DWT/IDWT
– Local extrema search
– Projection onto interpolation space (\Gamma)
Testing
• L2 norm of the error (sum of squares)
versus iterations
• Saturation point in iteration (knee)
Schedule (Coding)
• October/November – code Alternate
Projections (8 weeks)
• December – write up mid-year report (2
weeks)
• January – code local extrema search (1
week)
Schedule (Testing)
• February/March – test and debug entire
system (8 weeks)
• April – run code against database (4
weeks)
• May – write up final report (2 weeks)
Milestones
• December 1, 2010 – Alternate Projections
code passes unit test
• February 1, 2011 – local extrema search
code passes unit test
• April 1, 2011 - codes passes system test
Deliverables
• Documented MATLAB code
• Testing results (reproducible)
• Mid-year report/Final report
Summary
Discrete Wavelet
Transform
Save edges e.g. local extrema
Input
Find approximation
Inverse Wavelet
TransformOutput
Questions?
Supplemental Slides
Similar Idea to JPEG
• Discrete Fourier Transform
• Save largest coefficients
• Inverse Discrete Fourier Transform
Comparison of algorithms
• DFT
• Save largest coefficients
• IDFT
• DWT (Redundant)
• Save local maxima on each scale
• Find approximation
• IDWT
Problem Definition
• Given:– positions– values
of local maxima of |W_2^j f(x)| at each scale
• Find:– Approximation h(x) of f(x)– or equivalently W_{2^j} h(x)
Maxima Constraint I
At each scale 2^j, for each local maximum located at x_n^j,
e.g. W h(x) = W f(x) at given set of local maxima points (interpolation problem) at each scale
)()(22
jn
jn xfWxhW jj
Maxima Constraint II
At each scale 2^j, the local maxima of |W_2^j h(x)| are located at the abscissa (x_n^j)_n \in Z
e.g Local maxima of |W h(x)| are local maxima of |W f(x)| at each scale
Maxima Constraint II
• Constraint not convex (difficult to analyze)
• Use convex constraint instead:
local maxima of |W h(x)| at certain points
|W h(x)|^2 and |d W h(x)|^2 small as possible on average
Original Approximation
Maxima Constraint “II”
• Minimize |W h(x)|^2 creates local maxima at specified positions
• Minimize |d W h|^2 minimize modulus maxima outside specified positions
Maxima Constraint “II”
• Solve minimization problem
|||h|||^2= \sum_j ( ||W_{2^j} h ||^2 + 2^{2j} || dW_{2^j}h/ dx ||^2)
Solve minimization problem
Let K be the space of all sequences of fucntions (g_j^(x) )_j \in Z such that
|(g_j(x))_j \in Z|^2 = \sum_j ( \| g_j\| ^2 + 2^{2j} \| \frac{dg_j}{dx} \|^2 < \infty
(inspired by condition “II”)
V space
• Let V be the space of all dyadic wavelet tranforms of L^2(R).
• V \subset K
\Gamma space
Let \Gamma be the affine space of sequences of functions (g_j(x))_j \in Z \in K such that for any index j and all maxima positions x_n^j
g_j(x_n^j)= W_{2^j} f(x_n^j)
(inspired by Condition I)
\Gamma space
• One can prove that \Gamma is closed in K
Recap
• K: sequence of functions whose sum of – norm of each element– norm of each element’s derivative
is finite
• V: dyadic wavelet transform of L^2
• \Gamma: sequences of functions whose value match those of |W f| at local maxima
Condition I in K
Dyadic wavelet transforms that satisfy Condition I
\Lambda = V \cap \Gamma
Condition I + “II” in K
• Find element of \Lambda = V \cap \Gamma whose norm is minimum
• Use alternate projections on V and \Gamma
Projection on V
P_V = W \circ W^{-1}
In other words,
First:W^-1 dyadic inverse wavelet transform
Then:W dyadic wavelet transform
Projection on \Gamma
At each scale 2^j, add discrete signal e_j^d = ( e_j(n))_{1 \leq n \leq N} that is computed from
e_j(x) = \alpha e^{2^{-jx}} + \beta e^{-2^{-jx}}
e.g. Add piecewise exponential curves to each function of sequence
How to compute coefficients?
• Solve system of equations given by equation (110)
Where to start?
Answer:
zero element of K e.g.
g_j(x) = 0 for all j \in Z
Converge to what?
Answer:
Alternate projections converge to – element of \Lambda (Condition I) – whose norm is minimum (Condition “II”)
How fast is convergence?
Answer:
If (\sqrt{2^j} \psi_{2^j}(x_n^j-x)) is frame and there exists constant 0< D <=1 such that at all scales 2^j the distances between any two consecutive maxima satisfy
|x_n^j – x_{n-1}^j | \geq D2^j
then, convergence is exponential
Convex constraint?