Enhanced Flipping Technique to Reduce variability in Image Steganography

Steganography algorithms aim to hide secret messages in a cover medium to provide imperceptibility to an attacker. Despite becoming the preferred technique for data hiding, the K-bit least significant bit (LSB) provides high variability and negatively impacts the visual quality of the cover image. Thus, optimization algorithms have been proposed to reduce variability. However, optimization-based methods have some limitations, such as high complexity and computational time. Therefore, a flipping method was proposed to reduce variability and reduce computational time. However, it provides lower embedding capacity. The challenge is how to design a new flipping method that reduces variability, enhances visual quality, and increases the embedding capacity. Therefore, this work proposes a flipping method for data hiding to reduce variability and enhance visual quality and embedding capacity. First, we hide the secret data in the cover image using the k-bit LSB technique. Then, we calculated the absolute difference between the cover and stego images. If the absolute difference of the 4-LSB is higher than a threshold value, then the adjacent bit of the 5-bits LSB is flipped. This process reduces the variability because flipping the 5th bit will make the pixel value of the stego image closer to the cover image. The performance of the proposed method is validated using the mean square error (for variability), peak signal-to-noise ratio (for visual quality), and embedding capacity parameters and tested on some benchmark dataset images. The experimental results showed that the proposed method provides less variability, good visual quality, and high embedding capacity compared to genetic and Bayesian optimization algorithms, and the existing flip method.


I. INTRODUCTION
Steganography is the science and art of secret communication, which aims to hide secret messages (e.g., text, image, or video) in a cover medium such as an image to provide an imperceptibility attack [1]. Besides images, various cover media are available such as text, audio , and videos [2]. Of these media, the image is the most preferred cover media because it contains many redundant pixels. Thus, a small variation in the pixels after data hiding is not visually impacted [3].
To improve steganography performance, several techniques have been proposed to cover data inside the cover media, such as least significant bit substitution (LSB) [4], a discrete cosine transform [5], Pixel Value ordering [6], Histogram Shifting [7], and Difference Expansion [8]. The most popular approach is the LSB which consists of hiding secret bits in the LSB of some pixels in the cover image [9]. This technique has a high embedding capacity [10]. However, this technique has a high variability that negatively affects the visual quality [11].
On the other hand, to reduce variability without negatively impacting the embedding capacity, some optimization algorithms such as the Genetic Algorithm [12], Particle Swarm Optimization [13], and Bayesian Optimization [14] have been proposed. However, these techniques generate the optimal secret data matrix and try to match the cover and secret data bits, and it takes a long execution time [15]. Hence, [16] proposed another flipping method to address long execution time issues. This method was performed after checking the bits of the cover image. If the bits of the cover image change more than fifty percent, then this technique is carried out on the message bits [17].
In steganography, embedding data within an image has a trade-off between image quality and embedding capacity. Specifically, the more data are covered within a carrier image, the further variability the image suffers, causing a decline in the resultant stego image quality [18].
Although flipping methods have been proposed to improve metaheuristic algorithm issues, these algorithms still have an issue in either less visual or embedding capacity [18]. The question is: how to design a new flipping method that reduces the variability between the cover and stego image after the data hiding process with higher embedding capacity? Therefore, this study aims to design a new flipping method to reduce the variability between the cover and stego images after the data hiding process. Our hypothesis is "If the flipping technique can affect the cover ima ge variability, visual quality, and embedding capacity, then hiding data using an effective flipping technique can produce a good data hiding technique that has small variability, better visual quality, and high embedding capacity".
The remainder of this paper is as follows. Section II presents an overview of the proposed technique. Section III presents several empirical proofs, and scientific justifications underlie the experimental results. In the last, the paper concludes and infers our hypotheses and infers our hypothesis.

II. RELATED WORKS
The study guided us to the best spatial domain methods possible to use in this paper. The most popular type used in literature is the spatial domain due to simplicity and efficiency. Some of the methods that used spatial domain are given below:

A. Substitution Least Significant Bit (K-LSB)
One common technique is to manipulate the least-significantbit (LSB) planes by directly replacing the LSBs of the cover image with the message bits [19]. The LSB Substitution algorithm uses the least significant bits in the data hiding stage; first, the secret data is converted to the binary number system. After, the secret data bits stream changes the least significant bits of the cover image pixels [19] [20]. LSB methods typically achieve high capacity [19] [10]. It is easy to implement, fast and has better imperceptibility [20] [21]. However, LSB-based hiding schemes have certain limitations, such as visible degradation of the stego image (Higher variability) when embedding extensive data, which affects the quality of stego image became easily vulnerable against attacks [21] [22].
Many researchers have investigated the data hiding using LSB substitution by [23] introducing adaptive LSB embedding by utilizing the pixel value differencing (PVD) characteristics. This method divides the cover image into two-pixel blocks, further computing the difference in value between the two pixels. The numbers of secret bits are estimated based on the computed difference value. Next, the adaptive LSB scheme embeds the number of secret data bits inside the selected pixel blocks. This method also introduced a readjustment process to keep the stego-pixels with respective ranges; it successfully achieved the larger embedding capacity by retaining high visual imperceptibility. However, they did not prove that their technique is not vulnerable to pixel difference histogram analysis [24].
Next, [25] proposed an adaptive LSB substitution for data embedding based on edge computation. A maximum of 4 LSBs is utilized during the embedding process. On the other hand, this method did improve the embedding capacity. However, it suffered from low visual imperceptibility [26]. Then, [27] proposed a semi-reversible data hiding technique involving interpolation and LSB substitution. The interpolation methods are used to scale up and scale down the cover image, where the LSB substitution (up to 3 LSBs) is employed for embedding, unlike the use of 4 LSBs by the previous researcher. This method provides a larger embedding capacity while maintaining acceptable visual quality. However, this method did not discuss security evaluation [26]. Another novel LSB-based technique [28] proposed is bit inversion to improve the PSNR value. Certain LSBs of the cover image pixels changed in this inversion technique if matched with a particular pattern. Thus, this enhanced the visual quality. However, this technique suffered from a low payload [26].
In addition, [29] proposed a high-capacity image steganography technique based on the LSB substitution method. In this method, the LSB substitution technique divides the image into two parts: embedding data and indicating the embedding changes. This method increases the embedding capacity and improves the visual quality of the stego image, while the number of LSB substitutions is adaptive, ranging from 1-5. The visual quality of this method directly depends on the number of utilized LSBs; however, as the number of LSB substitutions increases, the visual quality of the stego-image decreases [26].
Moreover, [24] integrated the LSB substitution with a PVD method. This method divides the image into 2 × 2-pixel blocks and applies the K-LSB bit in the upper-left pixel of the block. Next, a PVD embedding process is applied to the base (upper left) pixel with the remaining pixels of the block. This method provides a larger embedding capacity with the improved PSNR value. However, the k-bits ranges are 1 to 3, indirectly indicating that up to 3 LSBs of a pixel can change during the embedding process [26].
Finally, [30] proposed a novel steganography approach based on the combination of LSB substitution mechanism and edge detection. This method divides the cover pixels into edge and non-edge areas. The edge information determines by the three most significant bits (MSBs) of the cover pixels, where the rest of the 5 LSBs are used adaptively by the LSB substitution. This method obtained high embedding capacity while retaining acceptable visual quality. However, a maximum of 5 LSBs is used [26].
Previous research [23] [24][25] [26] has shown that LSB substitution increases the embedding capacity. However, we found trade-offs among all these objectives because these are correlated to one another. Most of the larger capacity-based LSB methods employed the m aximum LSBs or modified the maximum number of bits in each pixel (3-5 bits). This maximum bit's modification in pixels increases the visual distortion between cover and stego-pixels (that can be seen as a low PSNR value 30 to 33 dB). Consequently, it reduces the stego-image visual quality (Higher variability) and increases the risk of steganalysis detection attacks [26].
Optimization algorithms such as genetic algorithm (GA) and Bayesian optimization algorithm (BOA) have gained popularity as they have overcome the challenges of LSB substitution data hiding technique, such as less security, low visual quality, and increasing variability [5] [22]. The GA and BOA algorithms match the image pixel bits with data bits to generate minimum variability after data hiding. Further details of GA and BOA algorithms are explained below.

B. Optimization Algorithm -Based Data Hiding Technique
Steganography methods have good visual quality and variable data embedding capacity using a GA algorithm [22] [31]. Utilizing a genetic algorithm avoids exhausting searching and allows us to find the best place in the host image for embedding modified secret data. Thus, the proposed method can achieve high embedding capacity and enhance the stego image quality (the PSNR value) [12]. However, they require much auxiliary information like gradient, derivatives and are long computationally [31]. Some studies used GAs to enhance steganography performance [12] [22]. A review of some of their applications are presented by [12] proposed a spatial domain GA-based reversible data embedding method with tunable visual quality. This method modeled the hiding process as a search and optimization problem. As a result, embedding payload and visual quality were improved. However, the computational complexity increases, and security is not proven [22].
Then, [32] proposed a chaotic maps-based method to improve the GA's data hiding technique. In the method, the GA fitness function was selected based on PSNR. Further, the various sizes of secret data were employed in the cover image using random functions and chaotic maps. Meanwhile, genetic randomness was performed using several chaotic maps versions such as gauss, logistic, and tent. Finally, the chaotic maps were considered the fastest than random function for the steganographic technique. The obtained results of gauss that the obtained results of two dimensions of data hiding applications based on the genetic algorithm are faster. There are limitations in achieving effective results from the genetic algorithm, such as the determination of crossover, mutation techniques, and end conditions [32].
Finally, [33] proposed a discrete cosine transform (DCT) domain with multi-bit LSB steganography that using to exploit the Genetic Algorithm (GA) for optimization. The pseudorandom function is used to sample pixels. The improved robustness in DCT while the multi-bit LSB technique increases the payload capacity in LSB and GA used for optimization. As a result, it attempted to reduce but resulted in variability. However, DCT, including the frequency domain, cannot be manipulated because it destroys the image's main features. Another limita tion is to work with fixed-length genes (here, the fixed-length binary fragment) to produce offspring that restrict taking different variations to capacitate more secreted message bits [33]. The Bayesian optimization algorithm (BOA), compared to the GA, generally finds the optimal solution in fewer iterations, which can decrease the number of cost function calculations and reduce the computational burden [14].
In one of the most recent evaluation studies, the BO algorithm used steganography to embed the secret data [14] proposed a method before embedding. The secret data are mapped to the optimal values using a Bayesian optimization algorithm (along with introducing a novel mutation operator) to reduce the variability. The main idea of the proposed method is that before the embedding process, the secret data are mapped to the optimal values using the BO algorithm (along with introducing a novel mutation operator). Then, the mapped data are embedded into the low-order bits of host pixels using modulus function and a systematic and reversible algorithm. Since the proposed method can embed data into more significant bits, enhancing the payload while preserving its visual image quality is vital. However, the BO algorithm takes the maximum number of iterations equal to 10 [14]. The GA and BOA algorithms provide high security and reduce variability. However, the major challenge of the GA and BOA algorithms operation requires an extra computational complexity [14][31] [32]. Therefore, other researchers proposed a new approach named flipping bits to solve variability and computation time.

C. Flipping Method
Studies have incorporated the flipping bits method for data hiding by [18] proposed a reversible bit flipping method for concealing 2 bits of secret data in a segment of 2 pixels. The last LSB bits of the pixels have been exploited in each segment to conceal the secret data at the first embedding layer. In the current work, a segment of 2 pixels hides. Only 2 bits of secret information, and again, it does not directly substitute the LSB bits. However, this method suffers from low embedding capacity, [17] proposed a modified bit flipping technique for hiding information in an image called bit flipping-1 and bit flipping-2. In the method, they change the data to be hidden into a binary form. In addition, the dimension of secret data also changed to 18 bits. This flipping was placed at the top of the binary message. The message is now a combination of both flipping-1 and bit flipping-2. This method provides the PSNR value increasing around 47.40 dB. However, this method suffers from low embedding capacity.
Similarly, [16] proposed flipping the message bits to increase imperceptibility in the least significant bit of image steganography. Firstly, the message is converted into a binary form. This method is carried out after checking the bits of the cover image. If the cover image's bits change more than fifty percent, this technique is carried out on the message bit. This method provides the PSNR value increasing around 51dB to 60dB and the MSE value dropping from around 0.44 to 0.05. However, it offers less security because executing flipping bits if the change in bits per pixel is more than 50%, so choosing the cover image should be selective. Table 1 summarizes the advantages and disadvantages of the LSB technique, GA algorithm, and flipping methods.

D. Issues and Objectives
The following issues are found from the comparative analysis presented above for the existing methods.
• The most popular technique for steganography is the Least Significant Bit (LSB) technique, as it provides better embedding capacity. Still, the drawback is that it produces higher variability and is prone to attack [21] [22] • Although these GA and BO algorithms provide low variability and higher embedding capacity, they consume a long iteration time [14] [31] [32]. • The flipping method avoids the iteration time in the data hidden. However, it has less embedding capacity. This research aims to design a data hiding approach that provides better imperceptibility, embedding capacity, and lesser time complexity.

III. PROPOSED FLIPPING METHOD
The proposed layer comprises of two-stages. The first stage uses the k-bits LSB technique for data hiding purposes, while the second stage improves image variability using the proposed flipping method.

A. STAGE I: THE DATA HIDING USING K-LSB
We follow a standard data hiding using the k-LSB technique at this stage. First, read the cover image ( ) and the secret data ( ), and split the into k-bits chunks known as secret data chunks ( ). This makes the and the are ready to begin the data hiding process. The data hiding process is started by applying operation between each pixel in the cover image with a constant value (ℎ). The ℎ is based on the contrast of the cover image. For example, if we use the 4-LSB method for 8-data bit (which is equal to 25510 or 1111 1111 for maximum value), the 4-least significant bit (1111), will be changed to 0000. Thus, the ℎ value should be (1111-0000) equal to 24010. The detailed steps for Stage I are as follows: Step 1 : Read the and .

Step 2 : Split SD into 4-bits chunks (SDC)
Step 3 : For each chunk, apply the logical AND operation between the cover pixel and h value, as given in Equation (1): Step 4 : Apply the logical OR operation between the SDC and C' bits to hide the data in the cover pixels, to produce the S using Equation (2): Step 5 : Repeat step 3 and 4 for all remaining chunks of SDC until the whole SDC are embedded into the C'.
Step 6 : End Stage I. Return the Stego image (S).
In Stage II, the proposed flipping method is then applied to reduce the S variability.

B. MULTIPART FIGURES
The detailed steps for Stage II are: Step 1: Set the threshold value, T.
Step 2: For each chuck, calculate the absolute difference (AD) between the S and C image using Equation where ADij denotes the absolute difference, Cij denotes the cover, Sij denotes the stego image, and , are and Step 3: If the absolute difference (AD) is higher than the threshold T, we flip the 5 th stego pixel (FSP).
Step 4: Repeat steps 2 and 3 for all remaining chunks.
The proposed flipping method begins with an absolute difference ( ) between the cover a nd stego images. Then, if the absolute difference ( ) is higher than the threshold T, we flip the adjacent pixel of the k-bits LSB technique (i.e., the 5 th bit if we use 4-bit LSB). Equations (4) and (5) are used to calculate the T value and flipping variable.
where ′ denotes the stego image, T denotes the threshold and denotes the Absolute Difference while flipping the 5th pixel in the stego image (Equation 3).
To further illustrate how the proposed flipping method is performed, please refer to the example shown in Table 2.
Figures 1 and 2. In this example, we use 4-bit LSB data hiding technique. The MV for 4-bit is 2 4 =16 (1111), and T value is set to be 8 (refer to Equation (4)). Therefore, the maximum variability value will affect half of the 8-bit pixels.  Figure 2 shows the entire process of the proposed flipping method can be summarized as follows: First, it reads the cover image ( 33 F7 0F CC16) and secret data (i.e.BF 55 33 33). Then, split secret data into 4-bits chunks (SDC) and apply operation between the cover pixel and h value. Then, the ′ is to apply operation with the bits to hide the data in the cover pixels to produce the stego image (S). After calculating the and operations between ′ and . The next the absolute difference (AD) between the cover image and stego image. Then, if the absolute difference (AD) is higher than the threshold T=8, it flips the adjacent pixel of the k-bits LSB technique is flipped (5 th bit); otherwise, the pixel value remains.  On the receiver side, the process of encrypted data extraction is shown in Figure 3. The FSP read and its LSB k-bits were extracted using the operation with a constant value ( ). The extracted k-bits are bits. In the last, the bits concatenate for determining the original encrypted data The whole process of the proposed method is summarized as the following steps: Algorithm1: The Data Hiding Using K-LSB Input: Cover Image C and Secret Data (SD). Output: Stego Image (S) Begin Step 1: Read the cover image C and Secret data (SD).
Step 2: Process the image into Block Size 4×4 Step 3: Divide (SD) into 4-bit Chunk (SDC) Step 4: For each chunk, apply the logical AND operation between the cover pixel and ℎ value using in Equation (1) Step 5: Apply the logical OR operation between the SDC and C' bits to hide the data in the cover pixels, to produce the S using Equation (2) Step 6: Repeat step 3 and 4 for all rema ining chunks of SDC until the whole SDC are embedded into the C'.
Step 7: Perform data hiding using K-LSB.
Step Step 1: Read the cover image C and Stego Image (S).
Step 2 : Set the threshold value, T.
Step 3 : For each chuck, calculate the absolute difference (AD) between the S and C image using Equation (3) Step 4 : If the absolute difference (AD) is higher than the threshold T, then we flip the 5 th stego pixel (FSP).
Step 5 : Repeat steps 2 and 3 for all remaining chunks.

IV. EXPERIMENTAL RESULT AND DISCUSSION
The proposed method was simulated using MATLAB 2013a. We conducted all the experiments on a system with 3.2GHz, 6-core 8th-gen i7processor, and 8GB RAM. The standard dataset images were taken from the USC-SIPI image dataset [34]. Fifteen secret data were randomly generated using MATLAB. Experimental results were evaluated using visual, statistical, and security analyses to measure the performance of the proposed method.

A. VISUAL ANALYSIS
This analysis measures the visual quality of the stego image after the data hiding [35] using Mean Square Error (MSE). MSE represents the error between the cover and stego images generated due to data hiding in the stego image, as shown in Equation (6) (6) where C and S denote the cover and stego image, , represents the row and column of the stego image, and A,B represents the row and column of the cover image.
The resolution of the cover image was 256×256. Table 3 shows that the proposed flipping method affects the visual quality of stego image after the K-LSB data hiding. The experiment was conducted based on two, three, and four (LSB) bits. Table 3 shows that the average MSE va lue for the 2-bit LSB is 1.24, 3-bit LSB is 5.17, and 4-bit LSB is 20.982, while the proposed flipping method is the average MSE value for the 2-bit is 0.98, 3-bit is 3.94, and 4-bit is 15.91. Indeed, when comparing the proposed method (2 -bit) with GA [12] (2-bit) and BO algorithms [14], the proposed method outperformed the GA and BO algorithms that were used to reduce the visual quality of the stego image. Our MSE value is 0.98, whilst GA and BO algorithms were 2.37 and 1.48, respectively.

B. STATISTICAL PARAMETERS
This experiment was conducted to demonstrate the analytical performance of the stego image produced by the proposed flipping method and K-LSB, and various statistical parameters were measured for the proposed method.
The following results are shown in Table 4, which shows how the proposed flipping method affects the visual quality of the stego image after K-LSB data hiding. The experiment was conducted based on two, three, and four (LSB) bits. Table 4 shows the average MSE value for the (2-bit LSB) was 1.23, for (3-bit LSB) was 4.96, and for (4-bit LSB) was 20.74, while the proposed flipping method after the data hiding process was applied on the stego image, the average MSE value for the (2-bit LSB) was 0.98, for (3-bit LSB) was 3.91, and for (4-bit LSB) was 15.25. As a result, the MSE of the stego image after applying the proposed flipping method improved the stego image variability, owing to the lower MSE value.
The above results show that the proposed flipping method achieved a lower MSE rate for stego images than the K-LSB. The proposed flipping method flips at the 5 th bit after data hiding, which leads to less variability than the original stego image results.   The following results are shown in Table 5 also shows how the proposed flipping method affects the visual quality of the stego image after the K-LSB data hiding executes. The experiment was conducted based on 2, 3, and 4 (LSB) bits. Table IV shows the average PSNR value for the (2-bit LSB) was 47.24dB, for (3-bit LSB) was 40.91 dB, and for (4-bit LSB) was 34.94 dB. After the data hiding process, the proposed flipping method was applied to the stego image. Their average PSNR value for the (2-bit LSB) was 48.18db, for (3-bit LSB) was 42.20dB, and for (4-bit LSB) was 35.99db. As a result, the PSNR of the stego image a fter applying the proposed flipping method outperformed the stego image after K-bits LSB data hiding, owing to achieving a higher PSNR value. This value is defined in Equation (7) [36].
where Max represents the maximum value represented in the cover image while MSE denotes the mean square error. As shown in Table 4, the PSNR values of the proposed flipping method are much higher than the ima ge quality standard of 30 dB, which proves that stego images have high image quality. This occurs because the proposed flipping method replaces the K least significant bits of each pixel in the cover image with secret k-bits from the secret message and flipping the 5 th after data hiding. In contrast, the K-bits LSB data hiding is slightly lower than that of the proposed flipping method because of the cover image with the secret message. bits. Table 6 shows the average EC value for the (2-bit LSB) was 13107 bits, for (3-bit LSB) was 196608 bits, and for (4bit LSB) was 262144; after the data hiding process, the proposed flipping method was applied to the stego image, the average EC value for the (2-bit ) was 524288 bits, for (3-bit ) was 786432 bits, and for (4-bit) was 1048576 bits. As a result, the PSNR of the stego image after applying the proposed flipping method outperformed the stego image after K-bits LSB data hiding because it achieved a higher value of EC value, as presented in Equation (8) where and are the width and height of the image, respectively.
It is clearly observed that the proposed flipping method provides high-quality performance with various hiding capacities. In addition, the EC is fixed for each image in the dataset, and it depends on the method used. The proposed flipping method achieved a PSNR of 48.16 dB when hiding 524288 bits. Furthermore, the proposed scheme attains the minimum PSNR value, 35.99 dB, hiding approximately 1048576 using all 4 LSBs. The hiding of this large number of bits indicates a very high hiding capacity. Therefore, the proposed flipping method provides a high embedding capacity. The experiment was conducted based on 2, 3, and 4 (LSB) bits. Table 7 shows the average entropy value for the (2 -bit LSB) was 7.2655, for (3-bit LSB) was 7.2320, and for (4-bit LSB) was 7.3234, also conducted based on 2, 3, and 4 (LSB) bits, but after the data hiding process, the proposed flipping method was applied to the stego image, the average entropy value for the (2-bit LSB) was 7.29092, for (3-bit LSB) was 7.28008, and for (4-bit LSB) was 7.29908. As a result, the stego image's entropy after applying the proposed flipping method outperformed the stego image after K-bits LSB data hiding due to the obtained entropy results in Table 7. These images show that the entropy of the stego-image is slightly greater than the cover image, and this is because more hidden information is added to the cover image without a significant change in pixel values. The entropy value is defined in Equation (9) [38].
where, ( ) is the probability density function of a given image at intensity level, l and is the total number of grey levels in the image, the highest value of entropy indicates good quality and information about an image.

C. SECURITY ANALYSIS
This section discusses the security analysis parameters for the proposed method in stego flipping method and stego K-LSB. The first parameter of the two measured security parameters is KL divergence, whereas the second parameter is histogram analysis. The USC-SIPI image dataset was used for experimental purposes for both security parameters.

1) KL DIVERGENCE
Solomon Kullback and Richard Leibler invented the KL Divergence parameter. It is measured to determine the difference between two probability distributions. The histogram distribution varies when data are hidden in the cover image in steganography. Thus, this parameter calculates divergence between the cover and stego images. It is calculated using Equation (10) [40].
where i denotes subscript variable and its value varies from 0 to 255. PQ denotes the probability distribution of the histograms of the cover and stego images.
In the ideal case, KL divergence should be zero. The experiment was conducted based on 2, 3, and 4 (LSB) bits. Table VII shows the average KL divergence for the (2 -bit LSB) was 0.00336, for (3-bit LSB) was 0.01628, and for (4bit LSB) was 0.03872, also conducted based on 2, 3, and 4 (LSB) bits, but after the data hiding process, the proposed flipping method was applied on the stego image, the average KL divergence value for the (2-bit) was 0.00224, for (3-bit) was 0.01226, and for (4-bit) was 0.03454. As a result, the KL divergence of the stego image after applying the proposed flipping method is the minimum value of KL divergence compared to the K-LSB technique stego. It has proven that embedding to the 4LSB with a small statistical probability can achieve higher steganographic security, and the minimum value of KL probability statistics is more accurate for steganographic security measures.

2) HISTOGRAM ANALYSIS
Histogram analysis is the most preferred parameter for security purposes. The data hiding in the cover image changes the pixel values, and thus, histogram distribution varies [40]. In an ideal scenario, the histogram should be identical. For experimental purposes, Table 9 shows the histogram analysis of the cover and stego images for the proposed flipping methods. The result shows that the stego image histogram is similar to the cover image histogram for 2-bit and varies for a 3-bit and 4-bit method. The horizontal axis of the histogram denotes the tonal deviations, while the vertical axis denotes the number of pixels in that specific tone. It is observed that the histograms of the carrier and stego images provide a negligible difference. The proposed flipping method can sustain statistical attacks as secret pixels can not be observed from the histogram.

D. COMPARATIVE ANALYSIS WITH OPTIMIZATION AND FLIPPING METHODS
To validate the performance of the proposed flipping method in reducing variability, it compared with other optimization and flipping methods that were used to improve the stego image variability. As shown in Table 11 and Table 12, the proposed flipping method outperformed other methods in PSNR and EC. The proposed method achieved higher PSNR and was compared with optimization and state-of-the-art flipping methods. The average PSNR for the proposed flipping method was 48.13 dB, while for GA [12], BO algorithms [14], and the basic flipping method were 45.14dB, 44.96 dB, respectively. Furthermore, the basic flipping method uses the basic flipping method on the secret data and before the data hiding process, improving the visual quality and va riability. In the proposed method, the flipping method is used after the data hiding process to improve visual quality and variability. In the second experiment, the EC values of the proposed method were higher than those of state the art flipping method. The basic flipping method values of 1 Bpp, whereas the proposed method obtained 2Bpp in the same EC with optimization algorithms. The proposed method shows that the PSNR is more effective than previous flipping. In addition, the proposed method avoids certain problems in state-of-the-art. It can achieve the highest EC without minimizing the visual degradation of the stego image.
In order to validate the performance of the proposed flipping method in reducing variability, it is compared with other optimization and flipping methods used to improve the stego image variability. Tables 10 to 12 show that the proposed method for PSNR, MSE, and EC was better than the other methods' results. The proposed method also achieved the best performance in MSE; the average MSE for the proposed method was 0.35, compared to 2.37, 1.48, and 1.24, respectively, for GA, BO algorithms, and K-bits LSB stego image are shown in Table 12. Moreover, the average PSNR for the proposed flipping method was 52.64 dB, compared to 45.14dB, 44.96 dB, 47.37dB, and 47.16 dB, respectively, for GA, and BO algorithms, which are shown in Table 10. At the same time, the proposed method has obtained 2 bpp in the same EC with GA and BO algorithms shown in Table 12.
Moreover, Table 13 to 15 illustrates the proposed method results for PSNR, MSE, and EC with existing flipping methods. The proposed method achieved higher PSNR and low MSE and higher EC compared with the state-of-the-art flipping methods [16][17 [18]. The MSE, PSNR, and EC values were 0.35, 52.64 dB, and two bpp for the proposed method, compared to the existing flipping methods such as [16][17] [18] values of 1.17, 47.32db 1.5 bpp, 1.24, 47.16db, and 1bpp, respectively, are presented in Figures 5  until 9. The experimental study points out that the proposed method is better than the existing method in terms of higher visual quality, as indicated by the high PSNR of hiding secret message bits in the image, thus reducing the MSE with the same embedding capacity shown in Table 12.           Based on the results shown in Table 16, the proposed method outperformed optimization and flipping methods to improve visual quality and variability. The proposed method is used after the data hiding process, improve visual quality and variability. The proposed flipping method achieved a lower MSE than optimization and basic flipping methods. The average MSE for the proposed flipping method was 1.00, whereas for GA, BO, and basic flipping methods achieved approximately 2.37, 1.48, and 1.24, respectively. Th e proposed method shows that the PSNR and MSE are more effective than previous flipping.
The Astuti flipping method [16] works by flipping the secret bits in the opposite direction. The flipping process results in a mirror version of secret bits. Their secret data bits also reduced the variability. In addition, the reversible bit flipping method for concealing 2 bits of secret data in a segment of 2 pixels. The last LSB bits of the pixels were exploited in each segment to conceal the secret data at the first embedding layer. However, flipping is performed on the stego image (after data hiding), not on the secret message in the proposed flipping method. Hence the chance of attacks is avoided, and embedding capacity is higher.
To evaluate the proposed flipping method and compare it with others, even when they are used in the secret message. A new experiment was conducted. In this experiment, the Astuti flipping method [16] was applied based on (2 bit) data hiding, and then the proposed flipping method was applied after data hiding, which clearly improves the results of the Astuti method, as shown in Table 16. The results show that the use of the proposed method after basic flipping method results showed that the average PSNR, MSE, and EC were improved. The results for the basic flipping method were average PSNR (47.14 dB), MSE (1.24), and EC (1). In comparison, the results after applying the proposed method were PSNR (48.16 dB), MSE (0.9912), and EC (2Bpp). It is observed that the basic flipping method with the proposed method provides highquality performance, are presented in Figures 9 and 10.  The performance of the proposed method is evaluated using a single simulation execution applying two iterations for achieving a target stable stego image. Thus, the flipping proposed method if the absolute difference (AD) is higher than the threshold T, then we flip the adjacent pixel of the kbits LSB technique is flipped (5 th bit), while the state-of-theart flipping method flip bits if the change in bits per pixel is more than 50%. Hence it needs to be selective in choosing the cover image are presented in Figure 11. In corresponding to Figure 11, it shows that the proposed method takes lesser time for data hiding as compared to existing methods, and Table 11 shows the PSNR parameter for visual quality better than existing methods In addition, to statistically analyze the results obtained for the proposed flipping method, the Friedman test is the best-known statistical method for testing the performance differences between more than two algorithms [41]. Friedman's test was used to assess the independence of repeated experiments resulting in ranks, the ranks PSNR computed by this test for the K-bits LSB stego image, basic flipping method, and basic flipping method with the proposed flipped method are tabulated in Table 17. It can be seen in the table that the proposed flipping method was successfully achieved as the best performing algorithm, whereas the lowest-performing algorithm was the basic flipping method. The Friedman test was used to conduct statistical comparisons between the proposed flipping method and other flipping method variants. Two comparisons were conducted using MSE and PSNR dimensions to evaluate the results. Table 17 shows the ranks achieved by this test for both sets of comparisons. It can be seen in these tables that the proposed flipping method ranked and basic flipping method with the proposed flipped method first, followed by basic flipping method, K-bits LSB stego image, and basic flipping method in both cases. The p-values calculated using the statistics from the Friedman's test were 0.002 and 0.018 in the MSE and PSNR cases, respectively, as shown in Table 17. These pvalues suggest significant differences in the performance of the methods considered. In addition, the structurality index (SSIM) is another measurement tool used to measure the quality of imperceptibility in steganographic images [41]. SSIM are two well-known measurements used to compare the differences between the original and their changes, is presented in Figure  12. It is impossible to judge which is better to be inferred from knowing which one is original and which has undergone additional treatment such as data compression. The SSIM index is defined as in Eq (11): SSIM (x,y)= (2 + ) (2 + 2 ) ( 2 + 2 + 1)( 2 + 2 + 2) , (11) where and are defined by illuminating each image in the x and y direction, and are the standard deviations and the contrast estimation of the signal, 1 , and 2 are small constants involved in controlling instability when either is very close to zero. However, while respecting the standards of the global quality index, these constants are ignored and equal to zero. Therefore, the closer the SSIM is to the unity, the better the image performance it can reach [41].

E.Discussion of Proposed Flipping Technique Results
This section discusses the performance of the proposed flipping method. The performance of the proposed flipping method has been evaluated using an experimental approach. Three different experiments have been conducted: the first is a visual analysis to assess the stego image's quality after the secret data. Secondly, the USC-SIPI dataset has been used for the quantitative analysis and achieved a better PSNR ratio and MSE. Finally, the security assessments have been tested for the secret data. Based on the experimental results, the proposed method outperforms other methods in variability and embedding capacity and improves the variability of the K-LSB in all cases 2 bit, 3 bit, and 4 bit.
The proposed method's ability to overcome the widest range of data hiding technique challenges with the best results is the essence of all previous studies. Based on state of the art, optimization algorithms such as GA, BO, and flipping method reduced the best variability for stego image. Based on these experiments, the results can be extended to include our case as follows: Optimization algorithms such as BO and GA algorithms were able to reduce variability and higher embedding capacity. However, optimization algorithms require long iterations, and the random selection of bits leads to visible distortion when hiding a large message. Optimization algorithms are used before the embedding process, and the secret data are mapped to the optimal pixels using BO or GA optimization algorithms to reduce the mean square error (MSE). The mapped data are then embedded into the loworder bits of host pixels using modulus function and a systematic and reversible algorithm. Optimization algorithms strongly influence visual quality. The results are better with small data hiding, which has less variability. The flipping method was able to reduce variability and avoid long iterations. However, their flipping method consumes less embedding capacity. In the flipping method before the embedding process, the secret da ta are flipped 2bits of secret data to reduce the variability. Then, the flipping bits of the message are embedded in the smallest bits in each cover image. However, it was only able to produce a highquality stego image. It failed to secure data hiding a nd low emending capacity.
The proposed flipping method aims to resolve the problem of variability resulting from data hiding by depending on the flipping technique to adjust the cover pixels after hiding the data bits that provide reduced variability. Based on the previous result in [16], the proposed flipping method achieved a higher embedding capacity, similar to the optimized data hiding technique. Simultaneously, it solves the problem of variability caused by a flipping method. The experimental results showed that our method could solve problems and special cases better than the flipping method.
The above analysis shows that the proposed flipping method is more effective than previous methods. Although each of the previous methods was able to deal very well with particular challenges, the proposed flipping method was able to deal very well with specific challenges. The proposed flipping method solves the problems of the data hiding technique that endures a higher variability and less embedding capacity. The outcome shows that optimization algorithms gave good results for higher embedding capacity but required long iterations. The proposed flipping method provided the best results for reducing variability, higher embedding capacity, and more security for all images.

V. CONCLUSION
In this paper, a data hiding approach is designed based on the flipping method to enhance imperceptibility, embedding capacity, and reduce variability. Secret data is initially hidden in the cover image using the k-bit LSB method to achieve this goal. After that, an absolute difference is found between the cover and stego image. If the absolute difference is higher than the threshold value, the adjacent bit of k-bit LSB pixel is flipped. The flipping process reduces the absolute difference and enhances the impermeability of the stego image. The simulation results show that the proposed method for both PSNR and MSE is better than state-of-theart results based on the experimental results. The average PSNR was 52.64 dB for the proposed method, compared to 45.11db and 44.64db, respectively, for GA and BO methods. Next, the average MSE was 0.53 for the proposed method compared to 2.37 and 1.48, respectively, for GA and BO methods. Finally, the proposed flipping method was compared with state-of-the-art methods that produced better EC.