Code for the paper "Anomaly Detection in Images With Smooth Background via Smooth-Sparse Decomposition".
Here is the Link to the paper. This repository provides a MATLAB implementation of the paper.
-
bsplineBasis.m
: Function to generate bsplineBasis withk
Bspline Basis andn
grids with degreesd
and boundary degreebd
- By default bd=sd-1
- Cubic B-spline, we set sd=3
-
bsplineSmoothDecompauto
: The major function:- Input variable
y
: Signal/image to be decomposedB
: Basis for meanBa
: Basis for anomalieslambda
: Smoothing Parameter, the algorithm will decide if emptygamma
: Sparsity Parameter, the algorithm will decide if empty
- Output variable:
yhat
: meana
: Anomalies
- Input variable
-
main.m
: Test function, use the information indata.mat
to generate a simulation. The result of estimated and true anomalies are quite similar.
Practical Advices:
- Choosing the knot of basis is very important especially on the two parameters
skx
andsky
and these should really come from the domain knowledge. - The current algorithm works better if you use smaller basis
Bs
to cover larger anomaly. Using too large of basis could lead to a bad estimation of the exact shape. - Using small basis is typically not very robust to noise. If you have very noisy image, consider using larger basis (fewer knots B-spline basis. )
Reference: Yan, H., Paynabar, K., & Shi, J. (2017). Anomaly detection in images with smooth background via smooth-sparse decomposition. Technometrics, 59(1), 102-114.