A Robust Watermarking Scheme Based on ROI and IWT for Remote Consultation of COVID-19

: In the current dire situation of the corona virus COVID-19, remote consultations were proposed to avoid cross-infection and regional differences in medical resources. However, the safety of digital medical imaging in remote consultations has also attracted more and more attention from the medical industry. To ensure the integrity and security of medical images, this paper proposes a robust watermarking algorithm to authenticate and recover from the distorted medical images based on regions of interest (ROI) and integer wavelet transform (IWT). First, the medical image is divided into two different parts, regions of interest and non-interest regions. Then the integrity of ROI is verified using the hash algorithm, and the recovery data of the ROI region is calculated at the same time. Also, binary images with the basic information of patients are processed by logistic chaotic map encryption, and then the synthetic watermark is embedded in the medical carrier image using IWT transform. The performance of the proposed algorithm is tested by the simulation experiments based on the MATLAB program in CT images of the lungs. Experimental results show that the algorithm can precisely locate the distorted areas of an image and recover the original ROI on the basis of verifying image reliability. The maximum peak signal to noise ratio (PSNR) value of 51.24 has been achieved, which proves that the watermark is invisible and has strong robustness against noise, compression, and filtering attacks.


Introduction
Currently, the outbreak of COVID-19 is worldwide. The pandemic situation is raging wildly around the world. The number of deaths is constantly increasing, and the pandemic situation is very serious. At present, the epidemic has spread to more than 200 countries and regions, and over 80 percent of the countries and regions in the world are facing the

Otsu algorithm
In medical images, the ROI area contains the most important information of the image, which can best reflect the image content and plays a key role in the judgment of the disease. In order to avoid embedding distortion in ROI, the algorithm chooses to embed the watermark in the RONI region of the image. Therefore, the image needs to be divided into ROI and RNOI [Kang, Liu, Yang et al. (2019)].
In the traditional one-dimensional Otsu algorithm, only the grayscale information of the current pixels is considered and the influence of their surrounding pixels is not taken into consideration. As a result, when the image is segmented, segmentation error often occurs.
To reduce the error in image segmentation and improve the accuracy of the algorithm, a two-dimensional Otsu algorithm is used in the present study to build a two-dimensional histogram based on the original image and smoothing information of surrounding pixels [Vala and Baxi (2013)]. The largest inter-class method used in the two-dimensional Otsu algorithm is essentially a threshold segmentation, which sets the image ) , ( y x f , (1≤ x ≤M, 1≤ y ≤N). Assuming that the grayscale of the image is L and the size of the image is M×N. The neighborhood smooth image ) , ( y x g can be obtained by using the average gray value of the neighborhood of pixel n×n, and the gray level of ) , ( y x g is also L. Therefore, a binary group can be formed in each pixel of the image, which is the gray value of the current pixel and its adjacent domain of the image. Using ij f to represent the number of pixels, where i denotes the gray value in the image ) , ( y x f and j denotes the neighborhood gray value in the same spatial position. The resulting data can be used to construct a two-dimensional histogram at that point. The gray level of the image as where k represents the width of the square neighborhood in the pixel, which is generally an odd number. Fig. 2 is a plane projection of the image based on the twodimensional histogram. ) , ( t s can be used to divide the image into two categories, namely background, and target (0≤ s ≤L-1, 0≤ t ≤L-1). Then, the proportion of the background and the target image can be calculated.

Hash algorithm
In order to verify whether the ROI region has been falsified by an intruder after watermark embedding, a hash algorithm is used to calculate the hash value before and after embedding the watermark, and verifies the integrity of the ROI region by comparison. This algorithm uses the SHA-256 algorithm, which generates almost unique fixed-size signatures for text or images. For messages of any length, SHA-256 can generate a 256-bit hash value, which is called the message digest [Guesmi, Farah, Kachouri et al. (2016)]. It digests an array of 32 bytes in length, usually represented by a hexadecimal string of 64-bit length. Specific steps of the SHA-256 algorithm are as follows: (1) Message filling Fill at the end of the message, and this operation causes the remainder of the length after the modulus of 512 to be 448. A 64-bit length block is appended to the message, and its value is the length of the message before filling. Thus, a message packet with an integer multiple of 512 in length is generated, and the length of the filled message is at the most 64 2 bits.
(2) Initialize the linked variables The intermediate and final results of the linked variables are stored in a 256-bit buffer, which can be represented by eight 32-bit registers, denoted by A-H and h0-h7. The output is still in the buffer instead of the old 8 registers.
(3) Manage main loop module The message block is processed in units of 512-bit packets and a 64-step loop operation is required. The input of each round is the value of the currently processed message packet and the A-H value of the 256-bit buffer output in the previous round. In each step, different message words and constants are used.
(4) Obtain the final hash value After 512-bit message block packets are all processed, the processing result of the last packet is regarded as the final output of the 256-bit message digest. In the proposed algorithm, a hash algorithm is used to calculate the Hash value of the ROI region to verify the integrity of the ROI region after the watermark is embedded.

Restore ROI image block data and Huffman compression coding 2.3.1 Restore ROI image block data
If the ROI area does not pass the integrity authentication, the distortion detection of the ROI area will be carried out next. Through the operations such as blocking and gray value calculation, the distorted area can be located and restored [Gu, Wu, Yin et al. (2019)]. In the 3×3 image block, the pixel at the center is adjacent to the 8 pixels around it. The ROI region of the image is divided into 3×3 non-overlapping image blocks. The recovery data is generated according to the difference between the gray value of the central pixel of each image block and the gray values of the remaining 8 adjacent pixels, and each image block can generate 56 bits of recovery data. Since the grayscale difference may be positive or negative, we can use 1 bit to indicate its positive or negative (specify 0 for positive numbers and 1 for negative numbers), and 6 bits to indicate the difference. The ROI area is divided into 3×3 non-overlapping blocks, and each image block generates 56 bits recovery data. The recovered 56 bits data are composed of the binary value of the gray value of the center pixel and the gray difference value between the center pixel point and the remaining 8 adjacent pixel points. For example, a 3×3 image block in the region of interest is shown in Fig. 3 and each pixel number in the image block is shown in Fig. 4, the recovery data calculated in the binary form of the image block is 10000100 000110 010011 100011 001100 101001 101111 100111 001110. The specific process is as follows: the first 8 bits (10000100) represent the value of the center pixel (132), and the next 6 bits (000110) indicate that the difference between the center pixel (132) and pixel 1 (126) is 6. In the same way, the remaining data is also divided into 6 bits, which represents the difference between the center pixel and the remaining seven pixels of the image block. By connecting the recovered data of all 3×3 image blocks in the ROI, the recovered data of the entire ROI in the image can be obtained. At the receiving end, the specific process of obtaining block pixel values from the restored data of the image block is as follows: the restored data of the image block is divided into nine small segments, including the first 8 bits segment and the remaining 8 small segment data (each segment is 6 bits). The center pixel value is equivalent to the 8bit decimal of the first segment, 6-bit of the second segment is used to obtain the value of pixel 1, the third segment is used to obtain the value of pixel 2, and the ninth segment is used to get the value of pixel 8. To obtain the value of the first pixel, the first bit of the second segment is checked. If the first bit is 0, then the remaining 5 bits of the equivalent decimal value and the gray value of center pixel are used to get the gray value of the first pixel. If the first bit is 1, then the equivalent decimal value of the remaining 5 bits is added to the gray value of the center pixel to obtain the gray value of the first pixel. The gray values of the remaining 7 pixels are obtained by repeating this process.

Huffman compression coding
Research shows that Huffman coding is an efficient coding method that can approach the upper limit of the compression ratio. Therefore, this method has become a mainstream method in data compression, and it is widely used in video, image, and text [Wang and Zhang (2017)]. The principle of Huffman compression coding is to use a Huffman binary tree, which is recursively constructed from leaves to roots [Li, Cao, Chen et al. (2017)]. The coding steps are as follows: (1) Take the compressed characters and calculate their probabilities, then arrange them in the order of probability; (2) Then add the two minimum probabilities, put the result and the previous probabilities together, and repeat Steps (1) and (2) until the final probability is 1; (3) In Step (2), the greater the probability of each pair of combinations is designated as 1, and the smaller is designated as 0; (4) Draw the path of each source symbol probability to 1, and record the 1 and 0 of the path; (5) Finally, for each source symbol, write a sequence of 1 and 0 from right to left, and the result is the corresponding Huffman compression code.

Logistic chaotic map
The watermark information embedded in the medical image is the feature information extracted from the original image and the watermark extraction algorithm is public. If the extracted watermark is distorted maliciously, the consequences will be unimaginable. Therefore, scrambling and encrypting the watermark information can be necessary before embedding it in the carrier image. The logistic map is a simple chaotic map, which is widely used in the field of secure communications [Pan, Lei and Jian (2018)]. Its mathematical expression is as follows: where µ is the parameter of Logistic. When x ∈[0,1], the logistic map works in a chaotic state. Furthermore, under the condition that the initial condition 0 x , the logistic map generates a sequence that has no period and does not converge. If 3.5699456< µ <=4, especially when it is close to 4, the value in a pseudo-random distribution state is iteratively generated. First, the pseudo-random sequence obtained by the Logistic chaotic system is binarized, and then the one-dimensional sequence is converted into a twodimensional matrix whose size is equal to the size of the watermark image. Finally, the chaotic sequence matrix is XOR with the binary matrix of the watermark.

Integer wavelet transform (IWT)
Because IWT can directly convert the image pixel value into an integer, it avoids the rounding error of floating-point generated in the traditional wavelet transform. And IWT is completely reversible, so the image can achieve lossless compression. The main idea of the algorithm is to decompose the existing wavelet filter to gradually complete the wavelet transform for obtaining the basic construction modules [Xiong, Xu and Shi (2018)]. In this paper, the wavelet transform based on the lifting scheme is adopted, which mainly composed of three steps: decomposition, prediction, and update. The details of the steps are as follows: (1) Decomposition The initial data ) (n s j is divided into two parts, denoted as even sequence ) (n x e and odd sequence ) (n x o . The decomposition process effectively uses the local correlation of the signals. The expression is as follows: (2) Prediction According to the correlation between the original signals, using the predicted value of the data in the even sequence ) (n x e and the predicted value of the data in the odd sequence ) (n x o , the prediction error is the difference between the actual value of the odd sequence signal and the predicted value. The expression is as follows: is the high frequency part of the signal.

Proposed algorithm 3.1 Watermark embedded in RONI
Due to the particularity of medical images, doctors basically judge the condition based on ROI in the image. Any changes in ROI are likely to cause misdiagnosis. Therefore, this algorithm chooses to embed the watermark information into RONI of the medical image to avoid any modification of ROI. In order to embed the watermark into RONI of the medical image, RONI is divided into 8×8 non-overlapping image blocks, and then the two-layer IWT is applied to each image block to generate 7 sub-bands (LH1, HL1, hH1, LH2, HL2, HH2 and LL2) of low, medium and high frequency. Two-bit watermark data is embedded in each coefficient of the intermediate frequency sub-band (HL2, HL1, LH2 and LH1), which makes the watermark invisible. If one of the medium frequency coefficients of a certain sub-band is 27 (binary 11011), and the watermark data information to be embedded is 0 and 1, the coefficient is replaced by 25 (11011), the two least significant bits of 11 in the binary representation are replaced by 01. If one of the medium frequency sub-band coefficients is negative, for example negative 15, and the two bit watermark data to be embedded are 1 and 0, the coefficient negative 15 (1111) is replaced by negative 14 (1110). According to the calculation method, in this embedding process, each RONI image block can embed 80 bits watermark data (64 bits embedding in LH1, HL1 sub-band and 16 bits embedding in LH2, HL2 sub-band). The detailed embedding process is shown below.
(1) The RONI of the medical image is divided into blocks, and the size of each image block is 8×8; (2) Two layers of IWT decomposition to each image block is applied; (3) For the coefficients in the medium frequency sub-bands (LH1, HL1, LH2 and HL2) of each image block, each coefficient embeds 2 bits watermark information; (4) Step (3) is repeated until all the watermark information is embedded in RONI of the medical image.

Watermark generation and embedding process
(1) Using the above Otsu algorithm, the original medical image is divided into ROI and RONI. Because the ROI region generated by the algorithm may be irregular, the top, bottom, left and right vertex coordinates are confirmed according to the coordinates of the ROI region, thus the ROI region with regular rectangle shape is constructed. As shown in Fig. 5, the gray area is the adjusted ROI area.

Figure 5: Schematic diagram of ROI and RONI segmentation
(2) The SHA-256 algorithm is used to calculate the Hash value of the ROI area and record it as H1. The Hash value of different images is unique, and the value H1 is used as the authentication information of ROI region.
(3) The ROI region of medical image is divided into 3×3 non-interlaced image blocks. According to the earlier mathematical method, the recovery data sequence of the entire ROI region is calculated, and the calculation result is recorded as R. Since the recovered data R is large, the amount of data can be reduced by compressing the recovered data R with Huffman code, which is denoted as Rcomp.
(4) Binary image D1 record patient data information (such as name, age, illness, etc.) is converted into binary data after logistic chaotic mapping (improving the security of the watermark) according to the keys µ and 0 x , and the result is recorded as D2. After linearly connecting and synthesizing binary data of H1, Rcomp, and D2 in sequence, a synthetic watermark W is generated. (5) According to the details of the above watermark embedding process, the synthetic watermark W is embedded in RONI region of the medical image. (6) ROI and RONI are combined after embedding a watermark to obtain a watermark medical image. During the step one, the vertex coordinates information of the rectangular ROI region needs to be recorded and transmitted to the receiving end through a network or a telephone, so as to facilitate the division of ROI and RONI at the receiving end. The flow chart of watermark generation and embedding is shown in Fig. 6

Watermark extraction and authentication process
(1) According to the vertex coordinates of the ROI rectangular area, the watermark image is divided into ROI and RONI.
(2) Calculate the Hash value of ROI based on the SHA algorithm and express it with H2.
(3) According to the size of the watermark data W, calculate the number of image blocks in RONI to extract the watermark. RONI is divided into 8×8 image blocks, and each image block is transformed by two-layer IWT. Two-bit watermark information is extracted from the lowest two bits of the medium frequency coefficients of the four subbands LH1, HL1, LH2 and HL2, and reverse two-layer IWT is applied to image block B.
(4) The W binary string is divided into three parts: ROI hash value (H1), ROI recovery data (Rcomp) and the patient information after the logistic chaotic mapping (D2).
(5) Huffman decodes and decompresses Rcomp to produce the decoded recovered data R.
According to the keys µ and 0 x , logistic chaotic mapping is applied to D2 to obtain the original binary image D1.
(6) If H1==H2, then the ROI is certified, otherwise proceed to the next step.
(7) Segment R and recover the pixel values of 3×3 blocks in the ROI from each 56-bit data segment. ROI is divided into 3×3 non-overlapping blocks. In order to determine the image blocks that have been distorted in ROI, for each image block B in the ROI, the checksum of image block B is calculated and recorded with c1 and c2. If c1≠c2, B is marked as a distorted image block.
(8) Replace the pixel values of the corresponding ROI image block with the recovered restoration data to reconstruct the ROI. The block diagram of the extraction and authentication process is shown in Fig. 7 Figure 7: Flow chart of watermark extraction and authentication

Experimental results
In this section, experiments based on the above method are implemented to evaluate the performance of embedded watermarks on 5 different lung CT images. The proposed algorithms are programmed by MATLAB software.
The three kinds of watermark information H1, Rcomp, and D2 are connected in sequence to generate a synthetic watermark. Fig. 8 is an example of five types of watermarks for lung CT images, including original CT images, binary images with patient information, binary images corresponding to synthetic watermarks, CT images after watermark embedding, and a binary image of segmented patient information after extraction. The PSNR values calculated from each image are 51. 24, 50.19, 49.37, 50.66, and 51.21 as shown in Tab. 1, so that the invisibility of the watermark is strong.  In simulation experiment, the ROI regions of the five lung CT images were respectively distorted as shown in Fig. 9. The distorted part is obvious. Before extracting the medical image, the integrity of ROI is verified firstly. If the calculated H2 is not equal to the calculated H1, the image is deemed to be distorted, and then the algorithm locates in the distorted area of image as shown in Fig. 10. After locating the distorted areas, the original pixel values of distorted image block can be recovered by using ROI recovery data as shown in Fig. 11. The proposed algorithm can precisely recover the ROI regions of the original image.

Gaussian low-pass filtering attack
If a Gaussian low-pass filter is used to process an image, the standard deviation of an image has the greatest impact on image quality, and the window size has little effect. The larger the standard deviation value, the worse the image quality after the attack. As shown in Figs. 20 and 21, the standard deviation values used in the experiment were 0.05 and 0.25. Figs. 22 and 23 show that image quality remains good after the attack. From the data in Tab. 4, it can be concluded that the proposed algorithm is strong against Gaussian low-pass filtering attacks.

Conclusion
A robust watermarking algorithm for authentication and recovery of medical image tampering based on ROI and IWT is proposed, which makes the algorithm more secure and confidential by using logical mapping and hash values. Two levels of recognition can be used to detect distorted areas. First, the hash value is used to match the integrity of the first level of identification. If the watermark is distorted, the hash values of the two computations are different, and then will be a second level comparison. Therefore, in the case of distortion or changing information, this technology is more valuable. Experimental results show that the proposed algorithm generates enough watermarked images and provides lossless information extraction, which can precisely locate in the distorted area of ROI regions and restore original ROI regions. Also, the embedded watermark is robust to noise, compression, and filtering attacks. Therefore, the algorithm is suitable for the remote consultation of COVID-19 and provides security for the transmission of medical images.

Conflicts of Interest:
We declare that we have no conflicts of interest to report regarding the present study.