# AISMSNet: Advanced Image Splicing Manipulation Identification Based on Siamese Networks
## 3 Proposed Splicing Manipulation Detection System Based on Siamese Neural Network
### Image Segmentation Based on K-means  
Image segmentation techniques play a fundamental role in identifying specific areas of an image. Image segmentation identifies regions of interest (ROI) and regions of no interest (RONI) within an image with a predefined criterion. In the context of tampered zone detection, ROI detection is essential to identifying manipulated areas by clustering pixels. This approach contributes significantly to the robustness and effectiveness of the mechanisms for detecting splicing attacks.  
The K-means algorithm is an unsupervised machine learning method designed for feature clustering [35]. Unsupervised image segmentation with the K-means algorithm divides an image into homogeneous regions. A key feature of unsupervised segmentation is its ability to classify pixels without knowing the classes they belong to. In the context of image splicing detection, K-means segmentation detects RONI areas and ROI areas by classifying data into a predefined number of clusters. Initially, K pixels are randomly chosen as the initial centroids for the clusters. Each pixel in the image is assigned to the cluster whose centroid is closest, basing this assignment on the Euclidean distance, given by Equation (3), from an arbitrary centroid \((\eta)\)[36; 37]. Finally, the cluster centroids are recalculated as the average of the pixels assigned to each cluster, thus completing the segmentation process. This approach identifies and distinguishes areas of interest, optimizing image manipulation detection through applying the K-means algorithm.  
\[min(E(\eta))=\sqrt{\sum(p_{i}-\eta_{i})} \tag{4}\]  
where \(p_{i}\) is a data point or pixel value. The K-means algorithm classifies the pixel values in the image according to the number of clusters used to segment it and recognizes RONI and ROI areas for image splicing. Figure 3 illustrates the segmentation of an image performed by the K-means algorithm using different numbers of clusters.  
The K-means algorithm, applied to the image features obtained by the Siamese neural network, carries out image segmentation based on the pixel similarities of characteristics related to the original image and the manipulated image. Therefore, it is necessary to divide the areas detected as manipulated into smaller blocks to increase the algorithm's efficiency. The centroids of the K-means algorithm are used as reference points to identify and evaluate manipulated areas, facilitating comparison and determining the similarity between image blocks.  
K-means integration, as a refinement process after the approximate detection of patterns realized by the Siamese neural network related to splicing distortions, improves the precision and efficiency of splicing manipulation detection. On the other hand, the application of the K-means algorithm as a refinement method in the detection of splicing manipulations represents a significant leap forward in the field of digital forensics. This approach provides an effective tool for a reliable evaluation of the authenticity of images. Additionally, combining deep learning techniques and clustering analysis for different image regions solves complex challenges associated with digital image manipulation. For this reason, K-means enhances the algorithm's ability to identify and analyze images with precision and accuracy.