# 4 KSecure: A Universal Method for Active Manipulation Detection in Images of Any Resolution
## 3 Method
### Evaluation
#### 3.4.2 Detection Metrics Obtained
The decline in the number of samples assigned to individual attack combinations results from the adopted data processing scheme (pipeline). As previously mentioned, this pipeline is identical to the one used during training, meaning that each sample is sequentially processed through different blocks, each with a specific activation probability. Consequently, the likelihood of multiple blocks being activated simultaneously is relatively low. As a result, despite the large number of test samples, the number of available samples in the later columns may be significantly smaller than in the earlier ones. Regarding the attacks best detected by the network, operations such as erasing, blurring and cut mix stand out, translating into a high sensitivity to significant modifications in image fragments. All these attacks substantially alter pixel values and the perception of the scene, making their detection relatively straightforward. On the other hand, attacks involving subtle modifications, such as clipart or cut-restore, perform worse in detection. It is important to note that clipart elements were added to the image before the embedding of hidden artifacts, meaning that from the anomaly detection perspective, they were not considered unwanted modifications but rather an intended part of the image. This implies that the network's task was not only to detect the anomaly in the form of clipart but also to determine whether a given item of clipart existed before the embedding process. As a result, this leads to an increased number of false positives (incorrectly flagged modifications) and false negatives (missed modifications). The metric for the cut-restore operation, which involves replacing fragments of the marked image with corresponding areas from the unmarked version, also performed slightly worse. The key issue is the trade-off between high transparency and final detection accuracy. To maintain the highest possible visual clarity for the human eye, the algorithm must limit the number of regions where integrity markers are embedded and the intensity of the modifications introduced. As a result, it may happen that a replaced fragment did not contain a sufficiently strong integrity marker, while simultaneously being an integral part of the original image. In such cases, the network may fail to recognize it as manipulation. From a general perspective on image integrity, this might not necessarily be considered tampering, since the content remains part of the original photo. However, from the algorithm's standpoint--where one of the tasks is also to detect content lacking an embedded integrity marker--this should ideally be flagged as a potential issue. This discrepancy highlights the challenges faced by the detection network, as it strives to balance a high accuracy with minimal invasiveness of the embedded integrity features. Two graphical summaries have been prepared to better illustrate the results of both the active marking and detection processes (Figures 14 and 15). These images provide a visual representation of the obtained results and help in understanding the underlying processes. They are structured as matrices (grids) arranged in rows and columns:  
* The first row contains the original images;
* The second row presents the images after the integrity markers have been applied;
* The third row shows the artifacts introduced by the encoding network, which have been normalized (0-1) to make them visible;
* The fourth row includes false and actual manipulations introduced into the previously marked images, with some highlighted using orange arrows for better readability;
* The fifth row displays binary ground truth masks indicating areas of actual manipulation (true attacks);
* The last row presents the raw output of the decoding model (without any thresholds or filters), attempting to reconstruct the manipulated regions. Figure 14 also includes cases where images were not subjected to any modifications.