# 4 KSecure: A Universal Method for Active Manipulation Detection in Images of Any Resolution
## 3 Method
### Training Process
#### 3.3.2 Noises  
A key component of the 4 KSecure algorithm is the distortion module presented in Figure 4. This block serves a dual role within the pipeline. First, it acts as a form of augmentation, which, despite the relatively large dataset consisting of tens of thousands of training and validation examples, further diversifies the input data and improves the model's generalization ability. Second, the distortion module introduces realistic manipulations into the training process, allowing the network to learn to detect actual image modifications more precisely. As shown in Figure 4, the Noise module is divided into two parts: Noise False and Noise True. * Noise False This component is responsible for introducing various attacks or modifications that do not alter the semantics of the image. This means that, for a human observer, the image still conveys the same content and should not be classified as manipulated. In practice, this serves two main functions: (1) It acts as an additional augmentation technique, expanding the data distribution and increasing the diversity of sample scenes. (2) It trains the network to recognize that not every modification to an image should be classified as a manipulation, such as edits that enhance its visual appeal or improve its quality. The Noise False group includes operations such as the following: \(\circ\) JPEG compression [48] with a randomly selected compression factor ranging from 64.0 to 99.0; \(\circ\) Gaussian noise with random intensity and a standard deviation of std = 0.03; \(\circ\) Conversion of the image to grayscale while preserving the number of channels; Brightness adjustment with random intensity in the range of 80% to 120%; Contrast adjustment with random intensity in the range of 80% to 120%. Figure 4: Noise scheme in the 4 KSecure algorithm. Each of these transformations can occur within an acceptable range of intensity, which does not significantly affect the semantics of the image and should not be interpreted as intentional manipulation. * Noise True After passing through the Noise False module, the image enters the attack sequence labeled Noise True. These transformations actively alter the image's content by modifying its semantics, such as removing, replacing or obscuring essential elements. As a result, the image deviates from the original to the extent that the network should detect the modification by identifying the manipulated area through binary classification as manipulated or non-manipulated. Each Noise True transformation also produces a binary mask indicating the modified areas, which serves as ground truth during training (see Figure 3). The Noise True sequence includes the following operations: \(\circ\) Random Erasing: deletes a random portion of the image, filling it with zeros or a constant value. The affected area may range from 1% to 5% of the image's surface; \(\circ\) Random Cut Mix: swaps image fragments between samples in the batch by inserting part of one image into another. The affected area may range from 1% to 7% of the image's surface; \(\circ\) Cut Mix Restore: restores a fragment of the original image (without a hidden mark) in place of an already marked section. The affected area may range from 1% to 10% of the image's surface; \(\circ\) Random Clipart Mix: inserts randomly positioned, scaled and oriented clipart into the image. The clipart's size may range from 8% to 25% of the image's surface; \(\circ\) Random Region Noise: applies noticeable blurring to selected image regions. The affected area may range from 8% to 25% of the image's surface; \(\circ\) Random Crop Pair: extracts a portion of the already noisy image and its corresponding mask and resizes it back to the original dimensions. The selected area may range from 60% to 99% of the image's surface. Each attack is applied with a specific probability, affecting individual samples within a batch rather than the entire mini-batch.