# 4 KSecure: A Universal Method for Active Manipulation Detection in Images of Any Resolution
## 3 Method
### Evaluation
#### 3.4.1 Transparency Metrics Obtained  
Three main metrics were used to assess the similarity between the source image and the image containing the embedded integrity marker: SSIM, PSNR and LPIPS. These metrics were calculated on the processed image at its full native resolution, as integrity artifacts were applied after upsampling from the intermediate resolution. Below is a brief description of each of these measures:  
* SSIM (Structural Similarity Index) is a metric used to evaluate the similarity between two images, considering factors such as luminance, contrast and structural details. It ranges from 0 to 1, where 1 represents perfect similarity between the images. In a simplified form, the SSIM can be defined by the following equation: \[SSIM=\frac{\left(2\mu_{x}\mu_{y}+k_{1}\right)\left(2\sigma_{xy}+k_{2}\right)}{ \left(\mu_{x}^{2}+\mu_{y}^{2}+k_{1}\right)\left(\sigma_{x}^{2}+\sigma_{y}^{2} +k_{2}\right)}\] where \[ \begin{array}{rl}\circ&\mu_{x},\mu_{y}-\text{average of the image x and y;}\\ \circ&\sigma_{x}^{2},\sigma_{y}^{2}-\text{variance of the image x and y;}\\ \circ&\kappa_{1},k_{1}-\text{constants that prevent division by zero.}\end{array} \]
* PSNR (Peak Signal-to-Noise Ratio) measures image quality based on the difference between pixel values in the original and distorted images. It is typically expressed in decibels (dB) and is widely used to evaluate image perceptual similarity. A higher PSNR value indicates better image quality and less distortion. For 8-bit images, the PSNR is commonly calculated using the following formula: \[PSNR=10 log\frac{MAX_{I}^{2}}{MSE(I,T)}\] where \[ \begin{array}{rl}\circ&MSE(I,T)=\frac{1}{mn}\sum_{i=0}^{m-1}\sum_{j=0}^{n-1 }[\text{I}(i,j)-\text{T}(i,j)]^{2}-\text{mean squared error;}\\ \circ&MAX_{I}^{2}-\text{is the maximum possible input value.}\end{array} \]
* LPIPS (Learned Perceptual Image Patch Similarity) uses deep neural networks to assess differences between images, like human perception. Instead of comparing pixel values, LPIPS compares embedding values in the layers of a neural network trained on a large number of image examples. It takes values in the range of 0 to 1, where 0 indicates a perfect similarity between images. The AlexNet [49] backbone was selected as the feature extractor. Figures 5-7 present the results obtained for each of the discussed metrics. It is worth noting that the SSIM and PSNR achieve high values. At the same time, the LPIPS remains exceptionally low, indicating minimal differences between the original image and the image with the embedded integrity marker. Figure 5: Average SSIM for different resolutions of test images (our dataset). Figure 6: Average PSNR for different resolutions of test images (our dataset). The SSIM graph shows values around 0.999, signifying almost perfect similarity. Differences depending on resolution only become apparent in the fourth decimal place and are practically negligible. On the LPIPS graph, a scale ranging from 0.0 to 0.004 was applied instead of the entire 0.0-1.0 range, to capture slight variations. Despite this rescaling, LPIPS values still fluctuate within a very narrow range, confirming that artifacts in the embedded image are almost imperceptible, with an average of approximately 0.0002. Slightly more significant fluctuations are observed in the PSNR analysis, partially due to the fact that it is a logarithmic measure and is not normalized in the same way as the SSIM or LPIPS. It should be emphasized that the average PSNR value was 60.216 dB, indicating a very high quality level. Variations from approximately 59.9 to 62.25 dB still fall within the range indicative of high marked image transparency. The table below (Table 1) presents a comparative analysis of the transparency results achieved by the 4 KSecure algorithm at full resolution. While our method does not fall under traditional watermarking or steganography, we reference well-established works in data hiding as a benchmark for evaluating transparency.