Local Features-Based Watermarking for Image Security in Social Media

: The last decade shows an explosion of using social media, which raises several challenges related to the security of personal files including images. These challenges include modifying, illegal copying, identity fraud, copyright protection and ownership of images. Traditional digital watermarking techniques embed digital information inside another digital information without affecting the visual quality for security purposes. In this paper, we propose a hybrid digital watermarking and image processing approach to improve the image security level. Specifically, variants of the widely used Least-Significant Bit (LSB) watermarking technique are merged with a blob detection algorithm to embed information into the boundary pixels of the largest blob of a digital image. The proposed algorithms are tested using several experiments and techniques, which are followed by uploading the water-marked images into a social media site to evaluate the probability of extracting the embedding watermarks. The results show that the proposed approaches outperform the traditional LSB algorithm in terms of time, evaluation criteria and the percentage of pixels that have changed.

image, video, audio and metadata as well that can be extracted [4]. In contrast to encryption, the watermarking allows the user to view, access and get the original digital information [4].
The watermarking algorithm is usually used to achieve the authenticity and integrity by performing two steps, namely the embedding and the extraction. In image watermarking, the original image is known as the cover image or the carrier, while after applying the watermarking process the output image is known as the watermarked image [5]. Fig. 1 shows the block diagram of image watermarking, where the embedding process is done by applying a watermark to the original image using a secret key. On the other hand, the extraction process exploits the same secret key to extract the watermark and retrieve the original image. Conventionally, image watermarking techniques work in two domains, namely the spectral domain and the spatial domain. In spectral domain watermarking, the original image is transformed into a group of frequency coefficients [5]. This type is very robust; however, it usually exhibits high complexity. The operations applied to the lower frequencies instead of higher frequencies to avoid the problem of losing frequencies in case of compression or scaling [4]. The most commonly used algorithms in spectral domain are: Discrete Wavelet Transform (DWT), Discrete Cosine Transform (DCT), and Discrete Fourier Transform (DFT).
On the other hand, spatial domain watermarking operations are simple and directly applied to the pixels without transformation as in the former type. The most commonly used algorithm in spatial domain is the Least Significant Bit (LSB). LSB is a simple and fast watermarking approach, which converts the image regardless of its type into gray scale image. Each pixel is represented by 1 byte, where the last bit, i.e., the right most bit, contains the least significant information as shown in Fig. 2. The LSB watermarking algorithm replaces this bit with one bit of the secret data, which will be hidden inside the image. Since the replaced bit is the least significant one, there will be no obvious visual change in the image [6]. Fig. 3 shows the block diagram of LSB embedding process, where one-pixel value is presented, at which the last bit (i.e., LSB) has a value 1. This value has been replaced with the first bit in the secret message which is 0. Therefore, the new value of the last LSB has become 0 instead of 1.

Figure 3: Lsb embedding process
• We proposed a local feature-based watermarking technique, which is used in tandem with variants of the traditional LSB algorithm to increase the security level.
• To improve the robustness of the proposed technique, we have implemented a two-bits based LSB algorithm instead of the conventional one-bit based algorithm.
• We investigate the performance of the proposed algorithm in terms of time, evaluation criteria and the percentage of pixels that have changed.
The rest of the paper is organized as follows. In Section 2, we present a literature review on the state-of-the-art watermarking techniques. Then, we introduced the proposed method and experiments design in Sections 3 and 4, respectively. Finally, the paper is concluded in Section 5.

Related Works
The digital watermarking provides a protection of digital contents such as: images, videos and music from any illegal use. In the last years, digital watermarking has been combined with different algorithms to increase its security and robustness [7]. Media watermarking has become an active research area. The authors in [8] used LSB algorithm to embed the watermark into the digital image. The third and the fourth LSB are used for hiding the data. Their experimental results show a better quality of the watermarked image. In [9], the authors presented a combination of LSB algorithm and edge detection technique for image stenography. The edge pixels of the image have been used to hide the secret data, which leads to a higher security level. Also, [3] presented a new watermarking scheme to embed the selected metadata into the digital image. The implementation is done on both visible and invisible watermarking. Within this experiment, the images have been uploaded into four different social media sites. It shows that the compression method of social media sites can change the pixel values of the image. Besides that, [10] proposed a new image stenography method based on extracting the three rightmost LSBs of the image pixels. Then, performing the X-OR operation between the first bit, the third bit and also between the second bit, the third bit. Based on the results of these operations, a +1 or −1 modification applied to the pixel value of the stego image. The proposed method was better when compared to LSB algorithm according to [10].
In addition, [11] presented a new scheme of transform domain JPEG image stenography. The secret data is compressed twice. First, compressed by removing the weak words from the data and then by using the Huffman lossless compression technique. The compressed data is embedded into the original image based on the modulus three of the difference between DCT coefficients of the image. This scheme is proven by [11] to significantly reduce the number of changes in the cover image.
Also, [12] presented a new stenography technique inside RGB color space. First, the cover image was flipped to embed secret message into it. Then, it was divided into the red, green and blue channel. The blue channel was used for embedding secret message which were divided into four sub images and shuffled by using a magic matrix. Before embedding, the secret message was subtracted from the corresponding pixel values of the red channel. Then, the authors in [12] selected 8 bits of secret message to be embedded into the four sub images. This technique achieves enhanced security according to [12].
Eventually, [13] proposed a hybrid combination of watermarking techniques. A local feature based watermarking scheme with a traditional transform domain-based watermarking. Watermarks are embedded twice. First, the KAZE features regions have been selected and watermarks are embedded into significant-bit-planes of these regions by modifying their histogram. Then, the Integer wavelet transform-Singular value decomposition (IWT-SVD) domain has been used to embed watermarks again by modifying the entries of the left singular vector metrics. This method was sufficient 100 robust according to [13].

Proposed Method
The main concept in this work is to exploit the advantage of different image processing techniques to embed the secret data in the original image. A new image watermarking technique is introduced based on the LSB algorithm. The proposed technique uses a combination of the LSB algorithm and image processing techniques. This combination enhances the performance of the traditional LSB algorithm. Additionally, it increases the level of image security through online social media sites without affecting the visual quality of the image [4].
Specifically, the secret data will be hidden into a variable selected area or pixels not in the whole image, which increases the robustness of the system. In this technique, the secret data is embedded into the largest blob of the original image. Therefore, a blob detection technique is used to extract the existing blobs in the original image including the largest one. One main objective of this work is to improve the robustness of the proposed algorithm. To cope with this objective, we implemented a modified two-bits based LSB algorithm, at which the last two bits are used for hiding the secret data instead of the last bit only. In the following subsections, we explain the details of the blob detection, embedding algorithm, and the extraction algorithm, respectively.

Blob Detection
Generally, a blob stands for binary large object, which is composed of a set of connected pixels or points [14]. These pixels are considered to be similar to each other in a binary image. To extract a blob, the connectivity of neighbor pixels is tested to detect similarity [15]. There are many different types of connectivity such as the 4-connectivity and 8-connectivity patterns, which are shown in Fig. 4. In this work, we adopted the 8-connectivity to achieve more accurate results since the 8-connectivity is more precise, however, it imposes higher computations than the 4-connectivity [14]. In image processing, blob detection methods are aimed to disclose regions or points in a digital image that differ in properties compared to the surrounding regions [16][17][18]. These properties included color or brightness.   In the proposed approach, the secret data is embedded into the boundary pixels of a specific blob only for example the largest blob. This will increase the level of security and robustness. In addition, one than a blob can be chosen for the embedding process. In this technique, the secret watermark is provided into the original image without any visual changing in it.

Embedding Algorithm
The embedding algorithm has three inputs: a cover image, a secret data and a secret key. It is done as follows: (1) Convert the secret data into its binary representation.
(2) Convert the cover image into a binary image.

Extraction Algorithm
The extraction algorithm has two inputs: a watermarked image and a secret key. It is done as follows: (1) Convert the watermarked image into a binary image.
(2) Extract the largest blob of the binary image.

Experimental Results
In the following sub-sections, we describe the dataset of the secret watermarks and the test images used in our experiments. Additionally, we explain the evaluation criteria used for evaluating the proposed algorithm and the experiment design. Finally, we elaborate in explaining the deployment of the watermarked images on a popular social media site for testing the performance of the proposed algorithms.

Data Set
The data set used in the experiments consists of two parts. The first part contains four secret watermarks with different lengths, from 46 to 221 characters, as shown in Tab. 1. In this paper, the watermarks are added as data related to social media. The first watermark embeds name, age and gender of the owner of the image. In the second watermark, id, location, and date are added next to the first watermark. The third watermark describes the image. Finally, a caption has been added as a fourth watermark. The second part contains three images including "Tiffany" with size 512 × 512, "Cablecar" with size 512 × 480 and "Barbra" with size 512 × 512 as shown in Fig. 7. Several parameters can be adopted to measure the quality of a watermarked image such as the Peak Signal to Noise Ratio (PSNR), the Mean Square Error (MSE), and the structural similarity index (SSIM). Those parameters can be defined as follows:

PSNR
It used to evaluate the similarity between the original image and the watermarked image. Additionally, it measures the quality of the watermarked images, where the PSNR should be high for a reliable technique. The values of PSNR ranges between [0, +∞] [13]. The general PSNR Eq. (1) is defined as follows: where MAX is the maximum value that a pixel can have (i.e., 255 for a grayscale image).

MSE
It shows the difference between the original image and the watermarked image. However, there is no exact value for MSE. A lower MSE indicates that the watermarked image is more similar to the original image and 0 means the method is perfect [19]. Hence, The MSE should be low for a reliable technique. The MSE is defined in Eq. (2) as: where m and n are the number of rows and columns in the original image. I is the original image and K is the watermarked image.

SSIM
It measures the perceptual difference between the original image and the watermarked image. The values of SSIM ranges between +1 to −1 [12], 1 means that there is a perfect match the watermarked image with the original one. However, values 0.99, 0.98 and 0.97 means a good technique. The SSIM is expressed mathematically as follows in Eq. (3): where I is the original image and Iw is the watermarked image. μ I and μ w are the mean luminance values of I and Iw, respectively. δ I and δ w are their standard deviations. δ Iw is the covariance between I and Iw. C 1 and C 2 are positive constants.

Experimental Design
Based on the evaluation criteria, the experiments have been conducted using MATLAB 9.6.0 on a core i7 CPU up to 4.5 GHZ, with 16 GB memory. Each experiment will embed one of the secret watermarks into the boundary pixels of the largest blob for each cover image. In this paper, many different methods for embedding secret watermark are introduced. In the first experiment, the 1st LSB has been used only for the embedding process, while in the second experiment the 2nd LSB has been used only for the embedding process. In the third experiments, the 1st and 2nd LSBs are used for the embedding process, where half of the watermark has been embedded in the 1st LSB and the other half has been embedded in the 2nd LSB. Finally, the last experiment is based on selecting either of the 1st LSB or the 2nd LSB for the embedding process. If the position of the watermark bit is even, the watermark bit will be embedded in the 1st LSB, and if the position of the watermark bit is odd, then the watermark bit will be embedded in the 2nd LSB. Using these different embedding methods will lead to more reliability. Tab. 2, describes the different methods of embedding. In addition, Tab. 4 gives the results of these experiments into "cablecar.bmp" image, where the boundary pixels of the largest blob are 3076 pixels. The percentage of boundary pixels being used for these experiments are 0.011734. Based on the results shown, the PSNR values are also high, the MSE values still low and the SSIM values are significant using the different embedding methods. Fig. 9, shows the watermarked and the original image of "cablecar.bmp".

Security Measurement
The security of the watermarked images is tested by applying cropping attacks. Cropping attacks are usually harmful; therefore, it is used to test the robustness of the watermarking algorithms. Tab. 6 shows the results of these experiments.  "Tiffany" image failed to evade this attack; the boundary pixels of the largest blob covered the border pixels of the image. Therefore, cropping any part of the image would lead to lack the embedded watermarks. In addition, "cablecar" and "barbra" images succeeded in preserving the embedded watermarks into the original images.  On the other hand, we have tested the robustness of the algorithm against traditional LSB extraction algorithm to make sure if it will discover the watermark in the boundary pixels or not. It is implemented with the four different embedding methods, where the embedded data does not appear.

Upload & Download Process into Social Media
The last part of experiments is done as follows: The watermarked images are uploaded into a two social media sites. The first website called "Tumblr", which is a popular site interested about images. In addition, it allows the users to share their images with the others. Therefore, it is a suitable environment for the experiments. Then, these images are downloaded back to test the presence of embedded watermarks or not. These results show that the embedded watermarks are retrieved successfully after the images are downloaded back from the site.
Based on the results, all watermarked images with different embedding methods passed the experiments, which will preserve the ownership of these images.
In addition, the second website used is twitter, which is one of the most popular social media platforms that allows users to broadcast images and short posts called tweets. The results shows that the watermarked images cannot pass the experiments of twitter website. The reason for that is the compression function used by twitter site. This compression can modify the pixels values of the image. A study to handle the compressed images should be done as a future work. Tab. 7 summarizes the results of these experiments.

Conclusions
This paper proposed a technique to increase the security level of the uploaded images in the social media platforms while preserving the visual appearance of the images. The introduced method depends on extracting the largest blob of a digital image, then using the boundary pixels of this blob for hiding the watermarks. However, more than a blob can be used for the embedding process. The embedding process has been done by using four different methods. In addition, different experiments are carried out to evaluate the performance of the proposed method. For real test, the watermarked images are uploaded into a social media platform and downloaded back. The results show that the hidden watermarks cannot be extracted.

Funding Statement:
The authors received no specific funding for this study.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.