README for MMSEC08-rao-cauchy
MATLAB code implementing and testing the lightweight Rao-Cauchy detector
for additive watermarking proposed in the paper
Roland Kwitt, Peter Meerwald, Andreas Uhl, "A Lightweight Rao-Cauchy
Detector for Additive Watermarking in the DWT-Domain", In Proceedings of
the ACM Multimedia and Security Workshop, MMSEC '08, pp. 33-41, Oxford, UK, ACM,
September 22 - 23, 2008.
See http://wavelab.at/sources.
How to run:
1. Produce Cauchy Q-Q plots of DWT subband coefficients
mmsec_qq_cauchy(num, imagedir, outdir, resizefac, subband, level)
Draw a series of Cauchy Q-Q plots for the wavelet coefficient
statistics of the specified detail subband of the images (*.pgm) in
imagedir. The plot (*.eps) will be written to outdir. num gives
the number of sample quantile comparisons and resizefac
determines the downsampling of the input images. subband specifies
the selected subband orientation (i.e. 'h', 'v', 'd') and level
the decomposition level.
Example:
mmsec_qq_cauchy(20, '../images', '/tmp', 0.5, 'h', 2)
2. Compute the detection performance of the linear correlation
(LC), Rao-Cauchy (RC), LRT-GGD (GG) and LRT-Cauchy detectors
on a series of test images.
mmsec_testruns(attack_type, test_type, options)
attack_type can be 'noattack', 'jpeg', 'jpeg2000'.
test_type can be 'experimental' or 'theoretical' (the plots in
the paper were produced using the experimental model). By the parameter
options you can specify the concrete settings for the testrun, such as
the image directory, or the number of experiments. For further details type
'help mmsec_testruns' on the MATLAB command prompt.
Example using default settings:
mmsec_testruns('jpeg', 'experimental')
mmsec_testruns('noattack', 'experimental')#
Example using custom settings:
myoptions.imagedir = 'img/';
myoptions.num_attacks = 1000;
myoptions.jpeg_qualities = 10:10:50;
mmsec_testruns('noattack', 'experimental',myoptions)
The output is a rich MATLAB structure storing the experimental
detection responses obtained during test runs under the hypothesis
H0 and H1 and the theoretically derived expected mean and variance
(see mmsec_test.m and mmsec_theo.m, resp.).
ROC plots can be produced using this data.
3. Produce ROC plots
The package contains three files for plotting ROC curves. These files
are 'mmsec_noattack_plots', 'mmsec_attack_plots' and 'mmsec_roc_plot'.
The first two files both make calls to the third one and plot EPS
graphics. The actual computation of the ROC curves is done in
mmsec_roc_plot, which we will explain briefly: Lets assume you have already
called mmsec_testruns like 'mmsec_testruns('noattack','experimental')' and
have a MATLAB variable 'results' which contains the detector responses.
Further, we assume you have the theoretical detector response stats under H0
ready (by calling 'mmsec_testruns('noattack','theoretical')) in another variable,
say 'theoretical'. Unless you have changed the standard settings for the options
variable, the vertical detail subband on the second level has been watermarked
only (i.e. where = [0 0 0; 0 1 0]) for DWRS 20,23 and 25 for all images.
To draw the ROC curve for the classic LC detector, just type the following:
Example:
pfa = logspace(-1,-5);
mmsec_roc_plot('classic',results{1,1}.classic1,s,'r',theoretical{1,1},2,2);
This will produce a nice ROC curve (in red, since we specified 'r') for the first
image and the first DWR (here 20 dB).
4. Approximate the Parameter Estimation Cost
In order to get a feeling for the computational runtime of the maximum-likelihood
parameter estimation procedures, we have included another file named
'mmsec_estimation_cost', which uses the MATLAB statements 'tic' and 'toc' to measure
the runtime of both ML estimation of the GGD parameters and ML estimation of the
Cauchy shape parameter. The Cauchy MLE procedure is based on the original MATLAB
code available from Minh Do for GGD MLE and has been modified for the Cauchy case.
Hence, we can use this for a first study of the runtime performance. The routine generates
a large number of either GGD or Cauchy random variables and estimates the parameters. This
is done NUM times and the average of the runtime is computed.
Example:
Tcauchy = mmsec_estimation_cost(100,'cauchymle');
Tggd = mmsec_estimation_cost(100,'ggmle');
Dependencies:
The following programs and libraries need to be installed and in the
execution path (shell or MATLAB):
* Jasper JPEG2000 codec 1.900.1, available from
http://www.ece.uvic.ca/~mdadams/jasper/
* Minh N. Do's MATLAB implementation of the moment matching and
maximum likelihood estimators for the generalized Gaussian
density, http://www.ifp.uiuc.edu/~minhdo/software/
* Pedar Axensten's Cauchy distribution MATLAB code,
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11749
* Nikola Sprljan's MATLAB Quality Assessment toolbox,
http://sprljan.com/nikola/matlab/qassessment.html
The code has been tested under Debian and Ubuntu Linux and MATLAB 7.4.
Disclaimer:
This material is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
to anyone for the consequences of using it or for whether it serves
any particular purpose or works at all.
The material is prepared strictly for research use only, commercial use
is prohibited. Do not distribute the material without written permission.
If you publish any work based on this code, please cite the original
paper.
Contact:
Please address any technical questions to
Roland Kwitt (rkwitt@cosy.sbg.ac.at), or
Peter Meerwald (pmeerw@cosy.sbg.ac.at)
or write to
Andreas Uhl
Department of Computer Sciences
Universität Salzburg
Jakob-Haringer-Str. 2
A-5020 Salzburg
AUSTRIA
Telephone: ++43 (0)662 8044 6303
Fax: ++43 (0)662 8044 172
Email: uhl@cosy.sbg.ac.at