README for ISPA09-quant-wm-attack Version 0.1; June 17, 2009 Python code implementing and attacking the image watermarking systems analyzed in the paper Peter Meerwald, Christian Koidl, Andreas Uhl, "Targeted Attacks on Quantization-based Watermarking Schemes", Proceedings of the 6th International Symposium on Image and Signal Processing and Analysis, ISPA '09, pp. 465-470, Salzburg, Austria, September 16 - 18, 2009. See http://wavelab.at/sources. The Python source code implementing the following watermarking schemes according to the description in the original paper is provided, together with Python code to perform the proposed attack: Chen, 2004: T.-S. Chen, J. Chen, and J.-G. Chen, "A simple and efficient watermark technique based on JPEG2000 codec", ACM Multimedia Systems Journal, 10(1), June 2004, pp. 16-26. Kundur, 1998: D. Kundur and D. Hatzinakos, "Digital watermarking using multiresolution wavelet decomposition", Proceedings of the 1998 International Conference on Acoustics, Speech and Signal Processing, ICASSP '98, volume 5, pp. 2969-2972, Seattle, WA, USA, May 1998. Lin, 2008: W.-H. Lin, S.-J. Horng, T.-W. Kao, P. Fan, C.-L. Lee, and Y. Pan, "An efficient watermarking method based on significant difference of wavelet coefficient quantization", IEEE Transactions on Multimedia, 10(5), Aug. 2008, pp. 746-757. Tsai, 2008: M.-J. Tsai, C.-T. Lin, and J. Liu, "A wavelet-based watermarking scheme using double wavelet tree energy modulation", Proceedings of the 2008 IEEE International Conference on Image Processing, ICIP '08, pp. 417-420, San Diego, CA, USA, Oct. 2008. Wang, 2004: S.-H. Wang and Y.-P. Lin, "Wavelet tree quantization for copyright protection watermarking", IEEE Transactions on Image Processing, 13(2), Feb. 2004, pp. 154--165. Wu, 2007: G.-D. Wu and P.-H. Huang, "Image watermarking using structure based wavelet tree quantization", Proceedings of the 6th IEEE/ACIS International Conference on Computer and Information Science, July 2007. pp. 315-319. For each watermarking scheme there exists a separate subdirectory named after the principal author containing the following scripts: embed.py detect.py attack.py test.py The scripts process image files in PIL-compatible format (see below), e.g. Portable Graymap (.pgm) format. All command-line arguments mentioned below are mandatory. Parameters (e.g. to control the embedding strength) are indicated in the source code. embed.py -------- command-line usage: embed.py [input file] [output file] [watermark key] embed.py embeds a watermark in the input image and produces the output image. The integer number given by argument 'watermark key' is used to generate the watermark sequence. detect.py -------- command-line usage: detect.py [input file] [watermark key] detect.py tries to detect the watermark related to the argument 'watermark key' in the input file. The normalized correlation (NC) is output standard output (stdout). attack.py --------- command-line usage: attack.py [input file] [output file] attack.py performs the attack on the input image and creates an output image. test.py ------- command-line usage: test.py test.py performs embedding, attack and detection on a number of images and computes the PSNR and NC of the watermarked and attacked image. Per default, it operates on the common test images Lena, Goldhill, Peppers, Man, Airport, Tank, Truck, Elaine, Boat, Barbara and performs embedding/detection with 10 different watermarks. Output is one line per image/watermark and an average per image. The format is as follows: ... Avg ... Avg denotes the PSNR (dB) for the watermarked vs. the attacked image. denotes the PSNR (dB) for the original vs. the watermarked image. denotes the PSNR (dB) for the attacked vs. the original image. Dependencies: The following programs and libraries need to be installed and in the execution path (shell or Python); the Debian/Ubuntu package names are given in brackets: * Python 2.5.2, http://www.python.org [python2.5] * Python Image Library (PIL) 1.1.6, http://www.pythonware.com/products/pil/ [python-imaging] * numpy 1.0.4, http://numpy.org [python-numpy] * scipy 0.6.0, http://scipy.org [python-scipy] * PyWavelets, http://wavelets.scipy.org [python-pywt] The code has been tested under Debian and Ubuntu Linux. 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 Peter Meerwald (pmeerw@cosy.sbg.ac.at) Christian Koidl (ckoidl@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