Homework Assignment #2

NOTE: For each of the following problems, please discuss the robustness, invisibility and security issues of your implementation.

  1. [30 pts] Implement the LSB-based watermarking methods:

    1) Change the least significant bits in the spatial domain.
    2) Change the least significant bits in the Block-base DCT domain before quantization
    3) Change the least significant bits in the Block-based DCT-domain after quantization

    Image Files:
    Files
    Image
    Data Source
    Image
    Watermark
    Text
    Watermark
    Preview
    Download

    The text watermark is part of one article appeared in New York Times talking about digitial watermarking . Interested students can read the full article.


    Notes: [0] There is a typo in the course slides (Lecture 4, Page 10). In the provided example of embedding watermark in LSB, the changed value was not correct. E.g, 158 should became 159, instead of f157, after embedding bit value 1.
    [1] Use the graysclae lena image as the data source.
      [2] For problem 1.1, use the Columbia logo watermark image, which is of binary format with pixel value 1 for white and 0 for black. Use a same way during your embedding. I.e., embed bit 1 for white and 0 for black.
      [3] For problem 1.2 and 1.3, apply the text watermark. The text watermark has 4096 ASCII characters in total. Each ASCII character contains one byte (8 bits). During DCT transform the lena image has (64x64=) 4096 blocks with size of 8x8. Apply one character for each 8x8 DCT block. Embed the 8-bit watermark following the zig-zag order:

    1 2 6 7 0 0 0 0
    3 5 8 0 0 0 0 0
    4 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0

    I.e., change the last bit of the numbered coefficients to the bits corresponding to the ASCII value. Number 1 to 8 is for highest bit to lowest bit respectively.
     

    [4] When applying the watermark, just replace the least significant bits using the watermark bits. For problem 1.2, round the DCT coefficients into the nearest integer values before applying the watermark.
    [5] How to map the character into a 8-bit watermark: each ASCII character is 8-bit long and can be explained as a digit value. Here is a full list of ASCII values. E.g., "A" is 65. In binary mode this value is "01000001". Use these 8 bits as the watermark symbols. In order to get the digit values of ASCII characters, remember to use binary mode to open the text file (do NOT use text mode, otherwise you will miss some invisible symbols such as carriage return). Read each character into one byte (unsigned char), and what you obtain is the desired digit values. E.g., For the text "Columbia", what you get is:

    In decimal "67, 111, 108, 117, 109, 98, 105, 97".
    In binary "01000011, 01101111, 01101100, 01110101, 01101101, 01100010, 01101001, 01100001"

    [6] In your submission, generate a document and report the following results:

    Original image
    Watermarked images
    A short discussion about the results.


  2. [30 pts] Implement the Spread Spectrum watermarking techniques as mentinoed in Cox et al. in the paper IEEE Trnas. on Image Processing, Dec. 1997

    Notes: [1] The paper reference:
    Cox IJ, Killian J, Leighton T, Shamoon. T. Secure spread spectrum watermarking for multimedia. IEEE Trans. on Image Processing, 1997,6(12):1673-1687. [PDF]
     

    [2] Pesudo Noise (PN) Generation: There are several PN sequence generation methods. Some typical ones are: Maximal Length Sequences (M-Sequence), Gold Codes, and Kasami Sequences. Here is a good tutorial of PN (PDF). For more information, refer to this tutorial site.
    [3] For your convenience, a sample code package in Matlab about generating M-sequence can be downloaded here, which is a .zip package. If you are not using Matlab, you can use the mseqdata.txt file to get the M-sequences.
    [4] mseqdata.txt is a 256x1023 matrix. Use the first 1000 columns. Therefore you have 256 sets of 1000-bit sequences as your watermark data. Choose one of the 256 sets as your personal ID. Embed this personal ID into the image using Cox's method. Draw the watermark detector response to validate your watermarking.
    [5] Suggested implementation steps:

    Load in the source image, namely LENA.
    Run DCT on the whole image and get the DCT image, namely LENA_DCT. For your convenience, you can run a 512x512 DCT on the whole image.
    In LENA_DCT locate the 1000 coefficients C_i (i=1,2,...1000) with the largest magnitudes.
    Store the coefficient C_i and their positions, namely P_i.
    Apply your personal ID (see note [4]), namely W, on C_i using equation (2) in tha paper. Choose alpha = 0.1.

    What you get now is a watermarked DCT image, namely LENA_DCT_W.
    Run IDCT on LENA_DCT_W, you get watermarked image, namely LENA_W.
    Apply the following attacks on LENA_W, getting the attacked iamge LENA_W_A:
       (You can use whatever software or tools to apply the following attacks.)
    Resize the image by half in both width and height, and then rescale it to original size.
    Compress the image using JPEG 10% quality and 0% smoothing. If you can't find tools to do so, apply the method you did in HW#1 Problem 2.3) on LENA_DCT_W. Remember to run inverse quantization and IDCT to get LENA_W_A.
    For LENA_W and each LENA_W_A, apply the folloing validation steps:
    Run DCT on the image and get the DCT image, namely LENA_W_DCT.
    Pick out the coefficients C_W_i, whose positions are given in P_i.
    Using C_i and C_W_i to restore your distorted personal ID, say W_A, by applying equation (2) in the paper.
    Calculate Sim(X, X*) applying equation (4) in the paper.
    In your submission, generate a document and report the following results:
    Image LENA
    Image LENA_W
    Each image LENA_W_A
    Sim(X,X*) figure, i.e., watermark detector response. Refer to Fig. 6 in the paper.
    A short discussion about the results.



  3. [40 pts] Embed Watermarks in video sequences using: (1) Cox Spread Spectrum Method and (2) (Optional, 10 extra points) Visible Watermark

    Resources:
    [1] Video Sequences (Please use .m2v files for this homework. Using .mov files is optional.)
    [2] MPEG encoder/decoder for MPEG-1,2 video stream (Recommend using mpeg2v12.zip)
    [3] MPEG demultiplexer/multiplexer for MPEG-1,2 system stream (Currently, many links in this webpage are broken. If you want to deal with the system stream (as in .mov), please look for other freeware.)
    Notes:
    [1] Decode the video file into Y, U, and V frame. Each frame is raw data.
    [2] Embed spread spectrum watermarks in the Y domain only. The process is the same as in Question 2.
    [3] Re-encode the frames into .m2v file format. Play the video to see whether watermarks are invisible.
    [4] Decode the video file again. Compare the watermark strength of each frame, before and after MPEG re-encoding.
    [5] For the visible watermark work, please replace the step [2] by a visible watermark technique that uses either (1) keep the low-frequency components of Y frames and substitute the high-frequency components of a watermark mask image; or (2) use the Braudaway-Mintzer technique as described in Lecture #1.