Watermarking algorithms for JPEG 2000 lossy compressed images V Fedoseev1,2, T Androsova1 1 Samara National Research University, Moskovskoe Shosse 34А, Samara, Russia, 443086 2 Image Processing Systems Institute of RAS - Branch of the FSRC "Crystallography and Photonics" RAS, Molodogvardejskaya street 151, Samara, Russia, 443001 e-mail: vicanfed@gmail.com Abstract. In the paper, we propose two watermarking algorithms for semi-fragile data hiding in JPEG 2000 lossy compressed images. Both algorithms are based on the concept of quantization index modulation. These methods have a property of semi-fragility to the image quality. It means that the hidden information is preserved after high-quality compression, and is destroyed in the case of significant degradation. Experimental investigations confirm this property for both algorithms. They also show that the introduced embedding distortions in terms of PSNR and PSNR-HVS are in almost linear dependence on the quantization parameter. It allows us to control the quality at an acceptable level when information embedding. 1. Introduction The JPEG 2000 image compression format, despite being less popular compared to JPEG, can provide better compression and is therefore widely used in remote sensing systems, medical imaging, and some other areas [1]. This fact underscores the importance of the task of protecting JPEG 2000 images from unauthorized changes. For example, the recipient of remote sensing data must have confidence in the absence of their falsification, as well as the doctor who makes the diagnosis based on the digital image must be convinced of its authenticity and in the absence of distortions caused by lossy data compression. One of the common approaches for the problem of protecting images from changes is embedding of semi-fragile digital watermarks, which are preserved in images while minor changing and destroyed after significant modifications. However, only a small number of semi-fragile watermarking methods for JPEG 2000 can be found in the literature [2]-[4]. Specifically, such class of methods includes one by Sun et al. [2] based on the EBCOT encoding procedure and the two algorithms by Maeno et al. [3], which do not allow to control quality factor. One more algorithm by Preda [4] is not linked with JPEG 2000 parameters. In this paper, we propose such a method for lossy JPEG 2000 compression mode, based on the quantization index modulation technique (QIM) [5]. The paper is organized as follows. In Section 2, we briefly describe the quantization procedure specified in the JPEG 2000 lossy compression standard. Section 3 presents the developed watermarking method while Section 4 investigates it. V International Conference on "Information Technology and Nanotechnology" (ITNT-2019) Image Processing and Earth Remote Sensing V Fedoseev, T Androsova 2. JPEG 2000 lossy compression procedure The flowchart of the compression algorithm is shown in Figure 1. At the first stage of compression, the brightness of each component is reduced by 128 [6]. Then the image color space is converted from RGB to YCbCr. The resulting image is subjected to discrete wavelet transform (DWT) with the Daubechies filter bank (9, 7) for the partition of the image into low-frequency and high-frequency areas (subbands), also called as the approximation and the details [6]. Figure 1. JPEG 2000 coding flowchart. After the transformation, each coefficient π‘Žπ‘ (𝑒, 𝑣) of subband 𝑏 is quantized by the formula: π‘Žπ‘ (𝑒, 𝑣) π‘žπ‘ (𝑒, 𝑣) = οΏ½οΏ½ οΏ½οΏ½ βˆ— 𝑠𝑖𝑔𝑛(π‘Žπ‘ (𝑒, 𝑣)), (1) βˆ†π‘ where ab (u, v) are quadrant coefficients and βˆ†b is the quantization step. The quantization step is represented by two bytes: 11-bit mantissa Β΅b and 5-bit exponent Ξ΅b and is determined by the following formula: πœ‡π‘ βˆ†π‘ = 2𝑅𝑏 βˆ’πœ€π‘ οΏ½1 + 11 οΏ½, (2) 2 where 𝑅𝑏 is the nominal dynamic range of subband 𝑏. According to [7, 8], two modes of calculating the values βˆ†π‘ for various 𝑏 are possible, which are expounded quantization and derived quantization. In the first mode, the values (πœ€πœ€π‘ , πœ‡π‘ ) are explicitly transmitted by the way similar to q-table in JPEG coding. In the second mode, which is considered in this paper, (πœ€πœ€π‘ , πœ‡π‘ ) values are calculated from the given values (πœ€πœ€0 , πœ‡0 ) β‰œ (πœ€πœ€, πœ‡), defined for the LL- subband, using the following equations: πœ€πœ€π‘ = πœ€πœ€ βˆ’ 𝑁𝐿 + 𝑛𝑏 ; πœ‡π‘ = πœ‡, (3) where 𝑁𝐿 is the total number of decomposition levels and 𝑛𝑏 is the level number corresponding to subband 𝑏 [8]. The final step of the compression process is the error-free coding of quantized coefficients using the arithmetic coding based on bit-planes. The JPEG 2000 decoder reverses the given operations. 3. Embedding information based on QIM To embed the watermark, we modified the quantization operation (1) according to the QIM concept. Specifically, we used two forms of QIM embedding rules: Simple-QIM [9] π‘₯(π‘˜) 𝑦(π‘˜) = 2βˆ† οΏ½ οΏ½ + βˆ† βˆ™ π‘Š(π‘˜), (4) 2βˆ† where π‘₯(π‘˜) are quantized values, and π‘Š(π‘˜) are the embedded bits, and DM-QIM (Dither Modulation – Quantization Index Modulation) [5]. The latter one assumes the use of two dither vectors 𝑑0 (π‘˜), 𝑑1 (π‘˜) that are consistent with each other and used when embedding bits β€œ0” and β€œ1”: βˆ† βˆ† 𝑑0 (π‘˜), 𝑑1 (π‘˜)πœ– οΏ½βˆ’ ; βˆ’ 1οΏ½ , π‘˜ ∈ [0, 𝐾 βˆ’ 1], 2 2 where 𝐾 is the number of quantized values. Information embedding in DM-QIM is carried out as follows: π‘₯(π‘˜) + π‘‘π‘Š(π‘˜) (π‘˜) 𝑦(π‘˜) = βˆ† β‹… π‘Ÿπ‘œπ‘’π‘›π‘‘ οΏ½ οΏ½ βˆ’ π‘‘π‘Š(π‘˜) (π‘˜). (5) βˆ† To use (4)-(5) in our adaptations for JPEG 2000, the embedded watermark should be robust against the JPEG 2000 quantization operation (1). To achieve the robustness, we modified (4) to |π‘₯(π‘˜)| 𝑦(π‘˜) = sign(π‘₯(π‘˜)) βˆ™ οΏ½2βˆ† οΏ½ οΏ½ + βˆ† βˆ™ π‘Š(π‘˜)οΏ½, (6) 2βˆ† and (6) – to V International Conference on "Information Technology and Nanotechnology" (ITNT-2019) 367 Image Processing and Earth Remote Sensing V Fedoseev, T Androsova π‘₯(π‘˜) + 0.5 β‹… βˆ† β‹… 𝑠𝑖𝑔𝑛�π‘₯(π‘˜)οΏ½ + π‘‘π‘Š(π‘˜) (π‘˜) 𝑦(π‘˜) = 𝑠𝑖𝑔𝑛�π‘₯(π‘˜)οΏ½ β‹… οΏ½βˆ† β‹… οΏ½ οΏ½ βˆ’ π‘‘π‘Š(π‘˜) (π‘˜)οΏ½, (7) βˆ† In the compression process, the values π‘Žπ‘ (𝑒, 𝑣) are used as π‘₯(π‘˜), and βˆ†π‘ are used as the quantization steps βˆ† (see (1)). The obtained quantized values 𝑦(π‘˜) would be the values π‘žπ‘ (𝑒, 𝑣). The dependence of the embedding rule on the quantization step βˆ† makes it possible to provide semi-fragility of the embedded information: it will be preserved under compression with quantization steps smaller than βˆ† and lost for steps greater than βˆ†. 4. Experiments To verify the developed watermarking techniques, we embedded a watermark in the Lenna image. Figure 2 shows the original image on the left and images with hidden information in the center and on the right. Visual distortions caused by embedding are not noticeable. Figure 2. Original image (left), and watermarking results: by the modified Simple-QIM (center, PSNR=64.94) and by the modified DM-QIM (right, PSNR=68.69); quantization parameters πœ‡ = 8.5, πœ€πœ€ = 9. Next, we should make sure that the watermark has the property of semi-fragility. Let π‘Š be the embedded information and π‘Š 𝑅 be the extracted information. Then the extraction accuracy will be calculated by the formula: 1 πΎβˆ’1 𝜌 = 1 βˆ’ 𝐡𝐸𝑅 = 1 βˆ’ οΏ½ 𝑋𝑂𝑅(π‘Š(π‘˜), π‘Š 𝑅 (π‘˜)), (8) 𝐾 π‘˜=0 where 𝐡𝐸𝑅 is Bit Error Rate. 1 Simple-QIM 0,9 DM-QIM 0,8 ρ 0,7 0,6 0,5 0,4 8,00 9,00 10,00 11,00 12,00 13,00 14,00 15,00 Ξ΅ 16,00 Figure 3. Dependence of the extraction accuracy from πœ€πœ€ (the embedding parameters are πœ‡ = 8.5, πœ€πœ€ = 12). In the second experiment, we compressed images with embedded information (similar to one shown in Figure 2) using JPEG 2000 standard with different quantization steps βˆ†π‘ determined by πœ€πœ€ values according to the formulas (2)-(3) (at the fixed πœ‡ = 8.5). After compression, we attempted to V International Conference on "Information Technology and Nanotechnology" (ITNT-2019) 368 Image Processing and Earth Remote Sensing V Fedoseev, T Androsova extract information and to estimate the accuracy using expression (8). The results illustrated in Figure 3 show that the hidden data is preserved at a smaller quantization step (corresponding to a larger value of πœ€πœ€ than that used in compression). Thus, both algorithms have shown their efficiency in terms of providing semi-fragility to JPEG 2000 lossy compression. But if we compare two algorithms, we may conclude that the Simple-QIM graph jump is sharper, i.e., it is closer to the ideal shape. Therefore, the Simple-QIM modification is more accurate than DM-QIM at the acceptable quantization step border. Next, we investigated the distortions introduced by information hiding. For this purpose, we used PSNR and PSNR-HVS metrics. The second one measures image quality from its perception by the person [10]. Figures 4-5 show the results of this experiment for the image β€œLenna” at various πœ€πœ€ (πœ‡ is fixed and equal to 8.5). The results confirm that the image does not undergo significant degradation, and also that image quality is directly related to πœ€πœ€ (the dependence is approximately linear). Thus, the achieved semi-fragility by πœ€πœ€ can be expressed as semi-fragility by the specified level of PSNR or PSNR-HVS. 100 80 PSNR 60 Simple-QIM 40 DM-QIM 20 0 8,00 9,00 10,00 11,00 12,00 13,00 14,00 15,00 16,00 πœ€πœ€ Figure 4. Dependence of PSNR of images with embedded information on the parameter πœ€πœ€ that determines the quantization step when embedding a watermark (πœ‡ = 8.5). 120 110 100 90 PSNR-HVS 80 70 60 50 Simple- 40 QIM 30 20 10 0 8,00 9,00 10,00 11,00 12,00 13,00 14,00 15,00 16,00 πœ€πœ€ Figure 5. Dependence of PSNR-HVS of images with embedded information on the parameter πœ€πœ€ that determines the quantization step when embedding a watermark (πœ‡ = 8.5). 5. Conclusion In this paper, we proposed two watermarking algorithms for semi-fragile data hiding in JPEG 2000 based on QIM concept: Simple-QIM and DM-QIM. Our investigations have shown that both algorithms provide semi-fragililty property to JPEG 2000: a watermark is preserved under compression with quality parameters greater than the specified one and is deleted when the compression quality is reduced. Visually, the distortions caused by embedding the CEH are not noticeable. Moreover, the measurements of these distortions using PSNR and PSNR-HVS show that the values are in almost linear dependence on the parameter πœ€πœ€. It is a very important property which allows us to control the quality at an acceptable level when information embedding. V International Conference on "Information Technology and Nanotechnology" (ITNT-2019) 369 Image Processing and Earth Remote Sensing V Fedoseev, T Androsova 6. References [1] Gonzalez R C and Woods R E 2009 Digital Image Processing (Pearson Education) [2] Sun Q, Chang S-F, Kurato M and Suto M 2002 A quantitative semi-fragile JPEG2000 image authentication system Proceedings International Conference on Image Processing 2 II–II [3] Maeno K, Sun Q, Chang S-F and Suto M 2006 New semi-fragile image authentication watermarking techniques using random bias and nonuniform quantization IEEE Transactions on Multimedia 8 32-45 [4] Preda R O 2013 Semi-fragile watermarking for image authentication with sensitive tamper localization in the wavelet domain Measurement 46 367-373 [5] Chen B and Wornell G 2001 Quantization Index Modulation: A Class of Provably Good Methods for Digital Watermarking and Information Embedding IEEE Transaction on Information Theory 47 1423-1443 [6] Schelkens P, Skodras A and Ebrahimi T 2009 The JPEG 2000 suite (John Wiley & Sons) [7] Rabbani M and Joshi R 2002 An overview of the JPEG 2000 still image compression standard Signal Processing: Image Communication 17 3-48 [8] Marcellin M W, Lepley M A, Bilgin A, Flohr T J, Chinen T T and Kasner J H 2002 An overview of quantization in JPEG 2000 Signal Processing: Image Communication 17 73-84 [9] Mitekin V A and Fedoseev V A 2018 New secure QIM-based information hiding algorithms Computer Optics 42(1) 118-127 DOI: 10.18287/2412-6179-2018-42-1-118-127 [10] Egiazarian K, Astola J, Ponomarenko N, Lukin V, Battisti F and Carli M 2006 New full- reference quality metrics based on HVS Proceedings of the Second International Workshop on Video Processing and Quality Metrics 4 Acknowledgments This work was supported by the Russian Science Foundation under grant 18-71-00052. V International Conference on "Information Technology and Nanotechnology" (ITNT-2019) 370