A Tour of Image Denoising

Download Report

Transcript A Tour of Image Denoising

Indoor – low light
IR
US
Can we (humans) denoise?
Indoor – low light
IR
US
Sources of Noise
Multiplicative Noise
(shot noise)
Additive Noise
(read+amplifier noise)
Gain
0101010101
0101010101
0101010101
0101010101
0101010101
Problem Definition
π‘₯
MSE / PSNR
Visual Quality
π‘₯
Mean Square Error
MSE = π‘₯ βˆ’ π‘₯ 22
Peak Signal-to-Noise ratio
255
PSNR = 20π‘™π‘œπ‘”10
MSE
𝑦 =π‘₯+𝑛
𝑛
Noise?
𝑛 =π‘¦βˆ’π‘₯
Outline
β€’ Classical Denoising
– Spatial Methods
– Transform Methods
β€’ State-of-the-art Methods
– GSM – Gaussian Scale Mixture
– NLM – Non-local means
– BM3D – Block Matching 3D collaborative filtering
Denoising in the Spatial Domain
β€’ The β€œclassical” assumption:
Images are piecewise constant
β€’ Neighboring pixels are highly correlated
β‡’ Denoise = β€œAverage nearby pixels” (filtering)
Gaussian Smoothing
*h
*
*h
*h
=
h
1
π‘₯ 𝑖 =
𝐢𝑖
𝑦(𝑗)𝑒
𝑗
π‘–βˆ’π‘— 2
βˆ’
2𝜎 2
Toy Example
How can we preserve the fine details?
Local adaptive smoothing
β€’ Non uniform smoothing
Depending on image content:
– Smooth where possible
– Preserve fine details
*h3
*h1
How?
Anisotropic Filtering
β€’ Edges β‡’ smooth only along edges
β€’ β€œSmooth” regions β‡’ smooth isotropically
gradient
Perona and Malik (1990)
Bilateral Filtering
1
π‘₯ 𝑖 =
𝐢𝑖
𝑦(𝑗)𝑒
βˆ’
π‘–βˆ’π‘—
2𝜌2
2
𝑒
𝑦 𝑖 βˆ’π‘¦(𝑗) 2
βˆ’
2𝜎 2
𝑗
Intensity
𝜎
𝜌
Space
Smith and Brady (1997)
Slides taken from Sylvain Paris, Siggraph 2007
Gaussian Smoothing
input
*
output
*
*
Same Gaussian kernel everywhere
Averages across edges β‡’ blur
Slides taken from Sylvain Paris, Siggraph 2007
Bilateral Filtering
input
*
output
*
*
Kernel shape depends on image content
Avoids averaging across edges
Denoising in the Transform Domain
β€’ Motivation – New representation where signal
and noise are more separated
β€’ Denoise = β€œSuppress noise coefficients while
preserving the signal coefficients”
Fourier Domain
β€’ Noise
White β‡’ spread uniformly in Fourier domain
β€’ Signal
Spread non-uniformly in the Fourier domain
signal
noise
πœ”
Low-Pass Filtering
β€’ Low pass with some cut-off frequency
β€’ Keeps most of the signal energy
×
1
=
Low pass filter
Equivalent to Global Smoothing
Looking for an Optimal Filter
𝑋 πœ” =π‘Œπœ”π» πœ”
×
𝑋 =
π‘Œ
𝐻𝑂𝑃𝑇 = ?
Assumption: Signal and Noise are
Stationary independent random processes
The Fourier Wiener Filter
𝑋 πœ” 2
𝑋 πœ” =
𝑋 πœ” 2+ 𝑁 πœ”
2
π‘Œ(πœ”)
𝐻𝑂𝑃𝑇 πœ”
β€’ 𝑋 πœ” ≫ 𝑁 πœ” β‡’ 𝐻 πœ” β‰ˆ 1 = Keep
β€’ 𝑋 πœ” β‰ͺ 𝑁 πœ” β‡’ 𝐻 πœ” β‰ˆ 0 = Suppress
β€’ Soft and adaptive thresholding
Optimal Linear Mean Square Error Estimator
Fourier Wiener Filter in Practice
β€’ Use a model for 𝑋 πœ”
or
β€’ Use π‘Œ πœ”
2
2
- for example:
𝑋 πœ”
2
=
𝐴
(𝛼 2 + πœ” 2 )1+πœ‚
instead (empirical approach)
𝑋 πœ”
2
=𝑔 π‘Œ πœ”
2
Ramani et al. (2006)
β€œβ€¦ the Stochastic Matern Model”
Why isn’t it enough?
β€’ We assumed stationarity:
β€œstatistics of all image windows is the same”
β€’ But natural images are not stationary
Why isn’t it enough?
β€’ Mismatches and errors β‡’ global artifacts
The Windowed Fourier Wiener Filter
β€’ Image has a local structure
β‡’ Denoise each region based on its own statistics
Approximated Spectrum per block (factor 2) - using Matern unisotropic model
Resized image (factor 2) - using Matern unisotropic model
Perform Wiener filtering in image windows
Can we do better?
β€’ Why restrict ourselves to a Fourier basis?
β€’ Other representations can be better:
– Sparsity β‡’ Signal/Noise separation
– Localization of image details
Wavelets
Fourier Decomposition
=
k(1)
+
k(2)
+
k(3)
+
···
Windowed Fourier Decomposition
=
k(1,1)
+
k(1,2)
+ ···
k(2,1)
+
k(2,2)
+ ···
k(3,1)
+
k(3,2)
+ ···
···
···
Wavelet Decomposition
mother wavelet
=
+ ···
k(1,1)
+ k(2,2)
k(2,1)
+ k(3,2)
k(3,1)
scaled & translated
versions
+ ···
+ k(3,3)
+···
···
···
···
Space-Frequency Localization
Windowed Fourier
Uniform tiling
Wavelets
Non-uniform tiling
frequency
f
coefficients
space
(time)
x
Better distribution of the β€œCoefficient Budget”
Discrete Wavelet Transform (DWT)
β€’ Recursively, split to
Signal
– Approximation
– Details
2↓
2↓
LPF
HPF
Details
2↓
2↓
LPF
HPF
Details
2↓
2↓
Approx
Details
Coarse
HPF
Fine
LPF
Wavelet Transform - Example
Original image
1 level DWT
Wavelet Transform - Example
Original image
2 level DWT
Wavelet Pyramid
Low-pass residual
(approximation)
Sub-band
(detail)
scale
orientation
Wavelet Thresholding (WT)
β€’ Wavelet β‡’ Sparser Representation
β€’ Improved separation between signal and noise
at different scales and orientations
Thresholding (hard/soft) is more meaningful
A Probabilistic Perspective
β€’ Learn or assume statistical model of image
and noise - 𝑝 π‘₯ , 𝑝 𝑛
β€’ Use Bayesian inference to obtain π‘₯
Which image do you prefer?
A Probabilistic Perspective
β€’ With some prior knowledge about images
β€’ Denoise = β€œfind an optimal explanation”:
– MAP – Maximum a posterior
π‘₯ = argmaxπ‘₯ 𝑝 π‘₯ 𝑦
– MMSE – Minimum Mean Square Error
π‘₯ = argminπ‘₯ 𝐸 π‘₯ 𝑦 βˆ’ π‘₯ 2 = 𝐸 π‘₯ 𝑦
Performance Evaluation
Denoised Images
Original
𝜎 = 20
Gaussian
Smoothing
Anisotropic
Filtering
Bilateral
Filtering
Windowed
Weiner
Hard WT
Soft WT
Buades et al. (2005)
Performance Evaluation
Method Noise
Gaussian
Smoothing
Anisotropic
Filtering
Bilateral
Filtering
Windowed
Weiner
Hard WT
Soft WT
Buades et al. (2005)
Conclusions
Denoised Image
Spatial Methods
Transform Methods
Method Noise
Taking it up a notch...
State of the art Methods
BLSGSM
BM3D
NLM
Spatial Methods
Transform Methods
BLS-GSM-Wavelet Denoising
Bayes Least Squares Gaussian Scale Mixture
Wavelet Denoising
(Portilla et al. 2003)
β€’ Transform to Wavelet domain
β€’ Assume GSM model on neighborhoods
β€’ Denoise using BLS estimation
Over Complete Wavelets
β€’ BLS-GSM uses over-complete wavelets
Classical (orthogonal) Wavelets:
#coefficients = #pixels
…
Over-complete Wavelets:
#coefficients > #pixels
Representation is redundant
β‡’ Combined estimates may improve denoising
Local Neighborhoods
β€’ Spatial-Scale Neighborhood
For example:
– Scale parent of central coef
– 3x3 in space
x
β€’ Such neighborhoods are highly structured
The GSM model
𝑃 𝑧 ~
1
𝑧
𝐢𝑁
πΆπ‘ˆ
π‘Œ = π‘π‘ˆ + 𝑁
𝑋
GSM
Gaussian
The GSM model
𝑧0 πΆπ‘ˆ + 𝐢𝑁
known
πΆπ‘ˆ
𝐢𝑁
π‘Œπ‘Œ== π‘§π‘π‘ˆ
0π‘ˆ + 𝑁
Gaussian Gaussian Gaussian
Everything is Gaussian!
2-Step GSM Denoising
β€’ The Naive approach
For each neighborhood π‘Œ:
1. Estimate 𝑍 => 𝑋, π‘Œ are jointly Gaussian
2. Denoise= optimal estimation of 𝑋|Y, Z = 𝑧0
In MMSE sense:
𝑋 π‘Œ = 𝐸 𝑋 π‘Œ, 𝑍 = 𝑧0 = 𝑧0 πΆπ‘ˆ 𝑧0 πΆπ‘ˆ + 𝐢𝑁
This is the Wiener estimate of 𝑋
βˆ’1
π‘Œ
Joint GSM Denoising
β€’ 2-Step is sub-optimal…
β€’ For each neighborhood π‘Œ:
Find the MMSE estimator -> 𝐸 𝑋 π‘Œ
𝐸 π‘‹π‘Œ =
𝑝 𝑧 π‘Œ 𝐸 𝑋 π‘Œ, 𝑧 𝑑𝑧
?
The local Wiener
estimate
(shown last slide)
Posterior distribution of multiplier
β€’ Bayes’ rule:
𝑝 π‘π‘Œ =
𝑝 π‘Œ 𝑍 𝑝𝑧 𝑍
𝑝 π‘Œ 𝛼 𝑝𝑧 𝛼 𝑑𝛼
Gaussian
(given 𝑍)
Known
(Prior)
Weighted sum of Wiener estimates
𝑋 =𝑋𝐸=𝑋 π‘Œπ‘€π‘§=π‘Œ 𝑝
βˆ™ Wiener
𝑧 π‘Œ 𝐸 π‘§π‘‹π‘Œπ‘Œ,𝑑𝑧
𝑧 𝑑𝑧
Weighted sum of local Wiener estimates
All 𝑧-explanations contribute to the estimate!
BLS-GSM-Wavelet Denoising
Local
neighborhood
Decompose to
Wavelet
sub-bands
β€œsophisticated”
Wiener Filter
GSM
Local
neighborhood
β€œsophisticated”
Wiener Filter
GSM
.
.
.
Local
neighborhood
β€œsophisticated”
Wiener Filter
GSM
β€œClean”
Wavelet
sub-bands
State of the art Methods
BLSGSM
BM3D
NLM
Spatial Methods
Transform Methods
Motivation - Drawback of Locality
β€’ Previous methods perform some local filtering
β‡’ mixing of pixels from different statistics
β‡’ blur
β€’ Goal:
Reduce the mixing ⇔ β€œsmarter” localization
Motivation - Temporal perspective
β€’
β€’
β€’
β€’
Assume a static scene
Consider multiple images y(𝑑) at different times
The signal π‘₯(𝑑) remains constant
𝑛(𝑑) varies over time with zero mean
β€œTemporal Denoising”
Average multiple images over time
β€œTemporal Denoising”
Average multiple images over time
β€œTemporal Denoising”
Average multiple images over time
Redundancy in natural images
Glasner et al. (2009)
Single image β€œtime-like” denoising
Unfortunately, patches are not exactly the same
β‡’ simple averaging just won’t work
Non Local Means (NLM)
Baudes et al. (2005)
Use a weighted average based on similarity
1
π‘₯ 𝑖 =
𝐢𝑖
𝑦(𝑗) 𝑒
βˆ’
𝐺𝑆𝑆𝐷 y 𝑁𝑖 βˆ’y 𝑁𝑗
2𝜎 2
𝑗
𝑀 𝑖, 𝑗
𝑀(𝑝, π‘ž)
𝑀(𝑝, π‘Ÿ)
𝑀(𝑝, 𝑠)
From Bilateral Filter to NLM
π‘₯ 𝑖
π‘₯ 𝑖
𝐡𝐿
𝑁𝐿𝑀1π‘₯1
1
=
𝐢𝑖
1
=
𝐢𝑖
𝑦 𝑖 βˆ’π‘¦(𝑗) 2
π‘–βˆ’π‘— 2
βˆ’
βˆ’
2
2𝜎 2
2𝜌
𝑦(𝑗)𝑒
𝑒
𝑗
intensity weight
𝑦(𝑗) 𝑒
𝑗
𝑦 𝑖 βˆ’π‘¦(𝑗) 2
βˆ’
2𝜎 2
πœŒβ†’βˆž
spatial weight
From Bilateral Filter to NLM
π‘₯ 𝑖
𝑁𝐿𝑀1π‘₯1
π‘₯ 𝑖
𝑁𝐿𝑀
1
=
𝐢𝑖
1
=
𝐢𝑖
𝑦(𝑗) 𝑒
𝑗
Patch similarity
𝑦(𝑗) 𝑒
𝑗
𝑦 𝑖 βˆ’π‘¦(𝑗) 2
βˆ’
2𝜎 2
𝐺𝑆𝑆𝐷 y 𝑁𝑖 βˆ’y 𝑁𝑗
βˆ’
2𝜎 2
Why NLM is Better?
Bilateral Filtering
Non Local Means
Mixing β‡’ bias
No Mixing β‡’ Less bias
Performance Evaluation
Method Noise
Gaussian
Smoothing
Anisotropic
Filtering
Bilateral
Filtering
NLM
Windowed
Weiner
Hard WT
Soft WT
Buades et al. (2005)
What’s Next?
β€’ The idea of grouping sounds good
β‡’ reduces mixing
β€’ Denoise = β€œextract the common (the signal)”
β€’ NLM: common = weighted average
β€’ Can a sparser representation do better?
BM3D
Block Matching 3D collaborative filtering
(Dabov et al. 2007)
β€’ Group patches with similar local structure (BM)
β€’ Jointly denoise each group (3D)
β€’ Smart Fusion of multiple estimates
A Single BM3D Estimate
Block matching
Inverse 3D
transform
R
Filter /
thresholding
3D grouping
3D transform
Denoised 3D group
Grouping by Block Matching
β€’ For every noisy reference block:
– Calculate SSD between noisy blocks
– If SSD<thr β‡’ add to group
Dabov et al. (2007)
3D Transform
Sparisity
2D transform
𝛼
Reminder:
naive
approach:
2D transform
π‘˜π›Ό
2D transform
BM3D
approach:
3D transform
𝛼
Collaborative Filtering
β€’ Use hard thresholding or Wiener filter
β€’ Each patch in the group gets a denoised estimate
Filter /
thr
Noisy
patches
Denoised
Patches
β€’ Unlike NLM – where only central pixel in reference
patch got an estimate
Multiple BM3D Estimates
Collaborative filtering
R
thr
R
Collaborative filtering
R
thr
R
Basic BM3D Denoiser
R
t
R
R
t
R
?
Fusion
Fusion
β€’ Each pixel gets multiple estimates from
different groups
β€’ Naive approach
Average all estimates of each pixel
…. not all estimates are as good
β€’ Suggestion
Give higher weight to more reliable estimates
BM3D - Fusion
β€’ Give each estimate a weight according to
denoising quality of its group
β€’ Quality = Sparsity induced by the denoising
Hard thresholding
1
π‘€βˆ
#π‘π‘œπ‘› π‘π‘’π‘Ÿπ‘œ πΆπ‘œπ‘’π‘“π‘“π‘–π‘π‘–π‘’π‘›π‘‘π‘ 
Weiner filtering
1
π‘€βˆ
πΉπ‘–π‘™π‘‘π‘’π‘Ÿ
2
BM3D in Practice
β€’ Noise may result in poor matching
β‡’ Degrades de-noising performance
β€’ Improvements:
1. Match using a smoothed version of the image
2. Perform BM3D in 2 phases:
a. Basic BM3D estimate β‡’ improved 3D groups
b. Final BM3D
Basic BM3D Denoiser
R
t
R
R
t
R
Two phase BM3D Denoising
R
R
t
t
R
R
t
(a)
Basic denoising:
Hard thresholding
R
R
R
(b)
Final denoising:
Wiener filtering
t
R
Results and Comparison
β€’ Comparison:
– Different levels of noise
– Different sets of images
β€’ Evaluation methods:
– MSE/PSNR
– Visual comparison to noisy and/or original images
GSM
original
noisy
denoised
NLM
BM3D
29.8dB
29.5dB
Comparison
Comparison
GSM
BM3D
BLS-GSM
+
Exemplar based x
BM3D
Comments
β€’ Average improvement from naive Gaussian
filtering to NLM – 4-5 dB
β€’ Average improvement of 1 dB over 4 years
(from BLS-GSM(2003) to BM3D(2007))
β€’ Saturation in PSNR over the last 4 years
(BM3D still considered state of the art)