Assignment Tasks
Part 1.
Section A.
Give a brief description of the perceptual hashing technology and discuss its applications.
Explain how robust and fragile watermarking can be used to solve legal and ethical issues related to digital images and videos.
Guide length: no more than 300 words each.
Section B.
You are provided with a test image saved as TIF file named ‘peppers.tif'. For the purpose of image copyright protection, you are required in this section to implement a one-bit watermarking system in the wavelet domain and a similar watermarking system in the DCT domain as follows:
Wavelet domain watermarking:
Embedding: The input image is wavelet transformed with two levels of decomposition. The second level sub-bands H2, D2 and V2 are used to hold three watermarks w1, w2, and w3 respectively. These watermarks are of size (128 x 128) each and are saved in a MAT file named ‘watermark.mat'. The embedding rule is multiplicative with a watermark strength α = 0.3. For instance, the ith wavelet coefficient in H2 is updated as
Y' (i)=Y(i)+α w1 (i)Y(i)
where Y'(i) is the watermarked coefficient in H2. Y(i) is the original coefficient in H2. Once the coefficients are updated, the inverse wavelet transform is performed to obtain the watermarked image. This programme should produce the watermarked image in a TIF file.
Detection: [9 marks]. This programme verifies the presence of the watermarks w1, w2, and w3 in the previously saved picture. First, two wavelet decompositions are performed as before. Then, three similar watermark detectors are used for detecting w1, w2, and w3 which are stored in ‘watermark.mat'. For example, for H2 where w1 is verified, the detector calculates
?1 = ∑(i=1)N(|(37.5 × Y' (i))/σ1 | )c (1-1/(1+ α w1 (i) )c )
μ1 = ∑(i=1)N1/c (1-1/(1+α w1 (i) )c )
λ1 = ∑(i=1)N1/c (1-1/(1+α w1 (i) )c )2
where N is the number of samples. |.| represents the absolute operation. c=0.4 is called the shape parameter. σ1 is the standard deviation of the sub-band H2(use std if the matrix is converted into a column vector and std2 otherwise). The decision for watermark w1 is made as follows
if ?1 > 4.75 × √(λ1) + μ1 then w1 exists in H2. Otherwise, w1 does not exist.
Similarly, the second detector calculates ?2 ,λ2,and μ2 from w2, σ2 , and the coefficients in D2 to decide on the presence of w2 in D2. The third detector calculates ?3 ,λ3,and μ3 from w3, σ3 , and the coefficients in V2 to decide on the presence of w3 in V2
Hints:
a-For the insertion of the watermark (Embedding),you may create a functionwhich has two arguments (set of coefficients, watermark) and outputs the set of watermarked coefficients. Then, this function can be called in the main Embedding programme three times for the insertion of w1, w2, and w3, respectively. As for the detection, you may also need to create a function which has two arguments (set of coefficients, candidate watermark) and outputs a binary decision (1 if watermark exists, 0 otherwise). Once the function is created, it can be called in the main detection programme three times with different parameters.
b- You may convert a matrix into a column vector (or into a row vector) to perform the insertion and detection of the watermark. The syntax in matlab to convert a matrix A of M rows and N columns into a column vector is
column_vector=A(:);
The inverse process (conversion from column vector into matrix) can be obtained by the following syntax
Reconstructed_matrix=reshape(column_vector,M,N);
DCT domain watermarking:[15 marks]
Embedding: The input image is DCT-transformed. Three square regions are selected from the transformed image to hold w1, w2 and w3 (see figure) using the same multiplicative rule as before. Then, the inverse DCT is applied to get the watermarked image. This programme should output the watermarked image in a TIF file.
Detection: This programme verifies the presence of the watermarks w1, w2, and w3 in the previously saved picture. First, the DCT is applied on the watermarked image. Then, three similar watermark detectors as described earlier are used for detecting w1, w2, and w3 which are stored in ‘watermark.mat'. For example, for the region where w1 is verified, the detector calculates ?1 ,λ1,and μ1 from w1, σ1 , and the coefficients in that region to decide on the presence of w1.
Codes work perfectly without errors. Excellent use of matrix manipulation inMatlab. Very good understanding and implementation of the embedding and detection equations. Good understanding of the watermarking systems. >10
Problems with the understanding and implementation of some equations. Hard coded implementation. However, it includes correct parts on embedding, detection, and image transforms. 6- 10
Poor understanding of the different parts of watermarking systems. Unable to link and analyse the main parts of the system. Incorrect implementation and the code does not compile/work properly. 0 - 6
Section C.
In this section, you are required to apply the following manipulations on the watermarked image in both wavelet and DCT domains and check the detection of the watermarks. Complete the following table and interpret the results.
Wavelet-Based DCT-Based
Manipulation W1 W2 W3 W1 W2 W3
Circular shifting [1,1] use ‘circshift.m'
Average filtering 77
Guide length: no more than 50 words for the interpretation of the results.
Part 2. LO1 & LO3
Section A.
Discuss the main similarities and differences between Artificial Neural Networks and Decision Trees.
Guide length: no more than 500 words.
Marking criteria.
Good work in this question will:
Show good understanding of both Atrificial Neural Networks (ANNs) and Decision Trees (C&RT) in terms of their use, applications and training.
Give a sound analysis of the two systems and possibly discuss their weaknesses/strengths if this is relevant.
Section B.
Explain why, in supervised machine learning, multiple samples from each class are required in the training phase.
Guide length: no more than 300 words.
Marking criteria.
Good work in this question will:
Show good understanding of supervised learning and classification.
Section C.
The implementation of a gender classification system using an Artificial Neural Network is given in Matlab. The Matlab function ‘getFeatureVector.m' extracts 64 features from any inputcolour image by using the grey scale plane only in the Discrete Cosine Transform (DCT) domain. There are two types of training images: male and female images which are stored in two folders ‘Male' and ‘Female', respectively. The extracted features for both male and female images will be used to train the classifier with ‘ANN_training.m'. Once the classifier is trained, it can be evaluated on test images stored in folder ‘test_gender'. This is implemented via the Matlab code ‘ANN_testing.m' where the default image is ‘male01.jpg'. The idea is to verify the gender each face image according to the trained classifier. If a female image is classified, the system will display a message ‘female'. Otherwise, the message ‘male' is displayed.
Based on the existing Matlab codes (‘ANN_training.m' and ‘ANN_testing.m'), create new codes that implement the linear perceptron, the Naive Bayes classifier, and a classification tree. You should submit only the part of codes which are different from the current ones. [3]
The false positive rate (FPR) is defined as the proportion of falsely classifying a maleimage as ‘female'. The false negative rate (FNR) is the proportion of misclassifying female images. For instance, if the system is applied on 20 male images and there are 2 incorrect classifications (i.e. classified as female), FPR=2/20. If the system shows 5incorrect classifications on 20female images, FNR=5/20. Run the Matlab codes on all test images and complete the following table [6].
Linear Perceptron ANN Decision Tree Naive Bayes
FPR
FNR
Error = (FPR+FNR)/2
Analyse and interpret the results.
Guide length: no more than 500 words.
Marking criteria.
Good work in this question will:
Show good analysis of the results and a reasonable justification of the performance of each classifier. The complexity cost for each algorithm should be discussed as part of the experimental analysis.
Explain how the performance of the gender classification system can be improved.