Can Image Splicing and Copy-Move Forgery Be Detected by the Same Model? Forensim: An Attention-Based State-Space Approach Soumyaroop Nandi, Prem Natarajan Abstract We introduce Forensim, an attention-based state-space framework for image forgery detection that jointly localizes both manipulated (target) and source regions. Unlike traditional approaches that rely solely on artifact cues to detect spliced or forged areas, Forensim is designed to capture duplication patterns crucial for understanding context. In scenarios like protest imagery, detecting only the forged region—e.g., a duplicated act of violence inserted into a peaceful crowd—can mislead interpretation, highlighting the need for joint source-target localization. Forensim outputs three-class masks (pristine, source, target) and supports detection of both splicing and copy-move forgeries within a unified architecture. We propose a visual state-space model that leverages normalized attention maps to identify internal similarities, paired with a region-based block-attention module to distinguish manipulated regions. This design enables end-to-end training and precise localization. Forensim achieves state-of-the-art performance on standard benchmarks. We also release CMFD_Anything, a new dataset addressing limitations of existing copy-move forgery datasets. Project page and code . 1 Introduction Figure 1 : Proposed CMFD_Anything samples- Rows show: (a) forged image, (b) RGB mask, (c) forged image, (d) RGB mask. Source-target mask encodes untampered , source , & target regions. The proliferation of generative models has broadened image manipulation far beyond traditional editing tools. The challenge for today’s researchers is to detect manipulated images, irrespective of the source of manipulation, be it generative models [ 13 , 52 , 29 , 33 , 22 ] , tampered with by photo editing tools [ 9 , 32 , 40 ] or online social media filters [ 45 ] . Deceitful attackers may spread misinformation in the form of internet rumors [ 45 ] , fake news [ 19 ] , deep fakes [ 34 , 36 ] , forged satellite images [ 18 ] plagiarized academic publications [ 35 , 36 ] . The prediction of the source of manipulation in the tampered images would be a vital contribution to the image manipulation detection community. Without the knowledge of the source of manipulation, tracing a tampered image becomes a challenging task. Tracing the source of image manipulation is possible if a model is trained to detect all forms of image tampering, whether involving image content or not. Image content-based forgeries can originate externally, where patches from an unrelated image are inserted ( splicing forgery ), or internally, where parts of the same image are duplicated and repositioned ( copy-move forgery ). Some forgers attempt to remove objects or regions from an image and seamlessly replace them with background pixels ( inpainting forgery ). Beyond direct content manipulation, images can also be subtly altered without modifying their content through various forms of image enhancement , such as quantization, noise addition, resampling, blurring, morphing, compression, and histogram manipulation. Additionally, image tampering can stem from generative model-based synthesis [ 42 , 6 ] or transformations introduced by social media [ 45 ] . However, prior research has predominantly approached forgery detection from the perspective of image splicing, where models are trained with binary masks to capture artifact cues near manipulated regions. These approaches often assume that techniques effective for splicing generalize well to all types of manipulation, including copy-move forgeries. Traditional splicing detection models localize only the manipulated regions, without accounting for the duplicated source regions. In contrast, our proposed model, Forensim, is trained using three-class masks— pristine , source , and target —to handle both splicing and copy-move forgeries in a unified framework, as illustrated in Fig. 5 . For example, in a forensic investigation, establishing a crime often requires not only identifying the manipulated evidence—such as perpetrator’s fingerprints—but also tracing its origin, such as matching the fingerprint in a database. Analogously, in image manipulation detection and localization (IMDL), detecting a tampered region without locating its source can be insufficient, particularly when both exist within the same image. This observation motivates our approach, which reformulates the image forgery detection task as a three-class mask segmentation problem. Our framework is capable of distinguishing all relevant regions, and experimental results demonstrate that this design generalizes effectively across both image splicing/inpainting scenarios (binary masks) and copy-move forgery detection (CMFD), offering improved interpretability and robustness. In this paper, we introduce a novel state-space model-based attention mechanism designed to accurately localize both the source and forged regions in IMDL. Specifically, we propose a similarity (Sim_Attn) and manipulation (MSSA) attention modules, both of which leverage image affinity matrices to guide attention-based learning. Sim_Attn identifies and highlights similar regions within an image, while MSSA distinguishes forged regions from naturally occurring identical patterns. By jointly learning these complementary attention mechanisms, our approach effectively mitigates misdetections and false alarms, addressing the key limitations of existing IMDL models. The attention modules efficiently capture long-range dependencies while maintaining linear computational complexity and low memory usage. Additionally, we normalize the attention weights in the discretization step of the Mamba formulation in Eq. 2 . This normalization ensures a well-balanced distribution of attention, enhancing robustness—particularly in fine-grained tasks such as CMFD. Furthermore, we have conducted extensive experiments with different MSSA blocks in Fig. 4 to develop a robust and effective CMFD architecture. Training deep learning models for CMFD requires synthetic datasets, as open-source CMFD datasets are scarce. To address this, we introduce CMFD_Anything, a benchmark dataset derived from high-quality Segment_Anything images [ 23 ] . Existing CMFD datasets, often created from MSCOCO [ 26 ] , are limited and contain forgeries that are easily detectable by the naked eye. In contrast, CMFD_Anything generates realistic, high-quality forgeries, enabling the development of robust models like Forensim to detect highly post-processed tampered images in Fig. 1 . To unify splicing and CMFD, Forensim is trained on both spliced images with binary masks and CMFD images with source-target masks, enabling generalization across manipulation types. Our key contributions are: \bullet We reformulate IMDL as a three-class training task, enabling unified detection of both CMFD and splicing forgeries—unlike prior work limited to binary-mask training focused on artifact-based splicing detection. \bullet We propose similarity and manipulation attention modules within a state-space framework that effectively capture long-range dependencies with linear complexity. \bullet We introduce CMFD_Anything , a high-resolution copy-move forgery dataset derived from Segment Anything images, and demonstrate Forensim’s state-of-the-art performance on multiple CMFD benchmarks. 2 Related Work 2.1 Earlier IMDL Methods Handcrafted feature-based methods for Image Manipulation Detection and Localization (IMDL) include ELA [ 24 ] (detects compression error differences between forged and pristine regions), NOI1 [ 28 ] (models local noise using high-pass wavelet coefficients), and CFA1 [ 12 ] (approximates camera filter array patterns). These methods typically focus on splicing detection. Early DNN-based studies also targeted specific forgeries, such as splicing [ 8 ] , copy-move [ 7 ] , removal [ 54 ] , and enhancement [ 2 ] . However, real-world manipulated images lack prior information about the forgery type, motivating the development of general forgery detection algorithms that can identify any manipulation. 2.2 Image Splicing Models and Training Datasets Most image splicing frameworks consist of an input feature extraction network, feature fusion (if multiple artifacts), and an anomaly detection network that classifies each pixel as tampered or pristine to generate a binary localization map. These networks are typically pre-trained on synthetic datasets, like MS-COCO [ 26 ] . ManTraNet [ 47 ] detects 385 manipulation types using a bipartite end-to-end network but struggles with double JPEG compression artifacts. MVSS-Net [ 3 ] uses noise distribution for feature generalization but fails to balance sensitivity and specificity. CAT-Net [ 25 ] focuses on compression artifacts and is designed for image splicing only. IF-OSN [ 45 ] addresses artifacts from online social networks but struggles with traditional IMDL models. Trufor [ 16 ] generates manipulation and confidence maps but does not predict manipulation sources. HiFi-Net [ 17 ] treats IMDL as a multi-level classification task but fails when similar copy-move regions are present. None of these methods predict the source of manipulation, struggling in scenarios with similar copy-move regions. 2.3 CMFD Models and Training Datasets BusterNet [ 46 ] is the first end-to-end deep neural network for CMFD, featuring dual branches for source-target localization and trained on the synthetic USC-ISI CMFD dataset derived from MSCOCO [ 26 ] and SUN2012 [ 48 ] . DOA-GAN [ 20 ] similarly adopts a GAN-based framework trained on the same dataset. However, both models struggle with complex copy-move forgeries and fail to generalize to image splicing, exhibiting high false alarm and misdetection rates, as shown in Fig. 4.1 . The limited diversity, low complexity, and lack of availability of the USC-ISI dataset motivated us to develop the CMFD_Anything dataset. 2.4 Structured State Space Models Structured state space models (SSM) offer an alternative to Transformer and CNN-based models, modeling long-range dependencies with linear scaling in sequence length. Recent advancements, such as S4 [ 15 ] and Mamba [ 14 ] , utilize structured SSMs for efficient long-range dependency modeling. VisionMamba [ 53 ] and VMamba [ 27 ] further extend this for computer vision tasks. Despite their success, these models often lack task-specific design considerations, especially in IMDL. Our approach leverages a specialized SSM design optimized for similarity and manipulation detection, achieving better accuracy with lower complexity. Figure 2 : Forensim Overview: Sim-Mani Attention and Fusion 3 Proposed Method 3.1 State Space Model Overview State Space Models (SSMs) [ 15 , 14 , 27 ] are linear time-invariant (LTI) systems that effectively capture complex sequential dependencies, similar to the Kalman Filter [ 21 ] , which is designed for linear systems with simple dynamics. Given a continuous input sequence x(t)\in\mathbb{R} , the system produces a continuous output y(t)\in\mathbb{R} through a hidden state h(t)\in\mathbb{R}^{N} . The system’s evolution is governed by the parameter \mathbf{A}\in\mathbb{R}^{N\times N} , while \mathbf{B}\in\mathbb{R}^{N\times 1} and \mathbf{C}\in\mathbb{R}^{1\times N} act as projection parameters. The continuous system follows these governing equations: h^{\prime}(t)=\textbf{A}h(t)+\textbf{B}x(t) y(t)=\textbf{C}h(t) A timescale parameter \Delta is used to transform the continuous parameters \mathbf{A},\mathbf{B} into their discrete counterparts, denoted as \mathbf{\bar{\textbf{A}}},\mathbf{\bar{\textbf{B}}} , as described in [ 15 , 14 ] . A widely adopted approach for this transformation is the zero-order hold (ZOH) [ 15 ] , which is defined as follows: \bar{\textbf{A}}=\exp(\Delta{\textbf{A}}),\quad{\bar{\textbf{B}}}=(\Delta{\textbf{A}})^{-1}\left(\exp({\textbf{A}})-\textbf{I}\right)\Delta{\textbf{B}},\quad\bar{\textbf{C}}={\textbf{C}}, \displaystyle y_{k} \displaystyle=\bar{\textbf{C}}h_{k}+\bar{\textbf{D}}x_{k}, (1) \displaystyle h_{k} \displaystyle=\bar{\textbf{A}}h_{k-1}+\bar{\textbf{B}}x_{k} \bar{\textbf{D}} works as a residual connection and \bar{\textbf{B}} can be approximated using the first-order Taylor series as: \bar{\textbf{B}}=\left(\exp(\textbf{A})-\textbf{I}\right)\textbf{A}^{-1}\textbf{B}\approx(\Delta\textbf{A})(\Delta\textbf{A})^{-1}\Delta\textbf{B}=\Delta\textbf{B} Selective Scan: Mamba [ 14 ] excels at capturing and modeling complex interactions in long sequences through a selective scanning mechanism. The matrices \mathbf{B}\in\mathbb{R}^{L\times N} , \mathbf{C}\in\mathbb{R}^{L\times N} , and \Delta\in\mathbb{R}^{L\times D} are computed from the input \mathbf{x}\in\mathbb{R}^{L\times D} , enabling the model to preserve contextual awareness. While this approach removes invariant parameters in one-dimensional temporal inputs, such as text, the 2D-Selective scan in VMamba [ 27 ] extends this capability to two-dimensional images by incorporating spatial information and non-sequential structures through the Visual State Space Block (VSSM). In the first step, Cross-Scan, VSSM flattens input patches into four sequences, each following a distinct state space trajectory. Each sequence is processed independently and in parallel by separate VSSM instances to effectively capture long-range dependencies, as described in (Eqs. 1 , 2 ). Finally, in the Cross-Merge step, the processed sequences are reshaped and combined, generating an output map with global receptive fields in the two-dimensional space. 3.2 Forensim Overview The architecture of the Forensim model is illustrated in Fig. 2 . It is specifically designed for three-class supervised forgery detection, employing state-space-based feature extraction and attention mechanisms to improve forgery localization. Given an input image I\in\mathbb{R}^{H\times W\times 3} , the model utilizes the first four layers of an ImageNet-pretrained Vision Transformer backbone (DINO) to extract high-dimensional hierarchical feature representations V\in\mathbb{R}^{B\times N\times C} , where B is the batch size, N=H\times W , and C=384 represents the embedding dimension for our proposed Similarity Attention Module. These features are subsequently flattened and processed through the proposed Similarity State Space Attention module, which constructs an affinity matrix Aff\in\mathbb{R}^{N\times N} by capturing self-similarity patterns within the image. This mechanism enhances the detection of duplicated regions, aiding in forgery identification. 3.3 Similarity State Space Attention Module Given an extracted feature map V\in\mathbb{R}^{B\times N\times C} , the module computes an explicit affinity matrix Aff\in\mathbb{R}^{N\times N} that captures the similarity between different spatial locations, as shown in Fig. 3 . Leveraging the State Space Similarity mechanism described in Eq. 1 , we normalize \bar{\textbf{C}}h_{k} such that: \displaystyle y_{k} \displaystyle=\bar{\textbf{C}}h_{k}/\bar{\textbf{C}}n_{k}+\bar{\textbf{D}}x_{k}, (2) \displaystyle h_{k} \displaystyle=\bar{\textbf{A}}h_{k-1}+\bar{\textbf{B}}x_{k} Here, \mathbf{h}_{k}=\sum_{j=1}^{k}\mathbf{B}_{j}^{\top}x_{j}\quad\text{and}\quad\mathbf{n}_{k}=\sum_{j=1}^{k}\mathbf{B}_{j} [ 14 ] . Eq. 2 defines the similarity attention with a global receptive field. Given a token k and its preceding token j , where j\leq k , each \bar{\textbf{A}} aggregates information from all \mathbf{x_{k}} and \mathbf{y_{k}} . Similarity Attention divides the output by \bar{\textbf{C}}n_{k} , to ensure that the attention weights sum up to 1. We incorporate Rotary Positional Embeddings (RoPE) [ 37 ] into the similarity attention mechanism to ensure that the affinity matrix captures spatial dependencies across the image effectively. Additionally, an ELU activation function is applied to \mathbf{V_{k}} prior to normalization to enhance stability during similarity computation. The Similarity Attention module computes an explicit affinity matrix via a dot product between the transformed representations \bar{\mathbf{C}} and \bar{\mathbf{B}} , as defined in Eq. 2 . Given an input V\in\mathbb{R}^{B\times N\times C} , the vectors \bar{\mathbf{C}} and \bar{\mathbf{B}} are computed as: Figure 3 : Similarity State Space Attention Module \bar{\textbf{C}},\bar{\textbf{B}}=\text{ELU}(\text{Linear}(V_{k}))+1.0 (3) These features are subsequently modulated using RoPE. Specifically, they are reshaped, augmented with rotary positional encoding, and then normalized as follows: \bar{\textbf{C}}=\frac{\text{RoPE}(\bar{\textbf{C}})}{\|\bar{\textbf{C}}\|_{2}},\quad\bar{\textbf{B}}=\frac{\text{RoPE}(\bar{\textbf{B}})}{\|\bar{\textbf{B}}\|_{2}} (4) Finally, the explicit affinity matrix is computed using the dot product between the modulated feature representations: Aff=\bar{\textbf{C}}\bar{\textbf{B}}^{\top},\quad Aff\in\mathbb{R}^{B\times N\times N} (5) This yields a structured affinity representation that captures spatial relationships and preserves computational efficiency. When calculating the similarity attention of an image, the affinity matrix Aff exhibits higher values along the diagonal, as these values represent the correlation of a region with itself. To resolve this issue, we define an operation K , as follows: K(p,q,p^{\prime},q^{\prime})=\frac{(p-p^{\prime})^{2}+(q-q^{\prime})^{2}}{(p-p^{\prime})^{2}+(q-q^{\prime})^{2}+\sigma^{2}} (6) We obtain a new affinity matrix Aff^{\prime}=Aff\odot K , where \odot denotes the element-wise dot product. To refine the affinity matrix, a bidirectional softmax operation is applied, ensuring that the final similarity values are mutually reinforced between spatial locations by utilizing the patch-matching strategy from [ 4 ] , we compute the likelihood that a patch in the p -th row matches with a patch in the q -th column of Aff^{\prime} to compute the final affinity matrix Aff_{final} as follows: Aff_{row}(p,q)=\frac{\exp(\alpha Aff^{\prime}[p,q])}{\sum_{q^{\prime}=1}^{N}\exp(\alpha Aff^{\prime}[p,q^{\prime}])}, (7) Aff_{col}(p,q)=\frac{\exp(\alpha Aff^{\prime}[p,q])}{\sum_{p^{\prime}=1}^{N}\exp(\alpha Aff^{\prime}[p^{\prime},q])}, (8) Aff_{final}(p,q)=Aff_{row}(p,q)\cdot Aff_{col}(p,q). (9) Figure 4 : Manipulation State Space Attention Module Here, \alpha is a hyperparameter, set to 5. The final affinity matrix Aff_{final}\in\mathbb{R}^{N\times N} is then refined using a Convolutional module, which comprises four convolutional layers followed by a SiLU activation. These layers process the affinity matrix to generate the similarity attention map Sim_{map}\in\mathbb{R}^{\sqrt{N}\times\sqrt{N}} , which highlights the top-k most similar regions per pixel. We also obtain a normalized affinity map Norm_{map}\in\mathbb{R}^{N\times\sqrt{N}\times\sqrt{N}} from Eq. 6 to capture spatial dependencies across the entire image, such that: \text{Norm}_{\text{Map}}(p,q)=\frac{(Aff_{\text{final}}(p,q))}{\left(\sum_{q^{\prime}=1}^{N}Aff_{\text{final}}(p,q^{\prime})\right)} (10) (a) (b) Figure 5 : Splicing Training: (a) Baselines supervise only with target masks. (b) Forensim uses both source and target masks. 3.4 Manipulation State Space Attention Module The Multi-Level Manipulation State Space Attention (MSSA) module enhances tampered region detection by using a multi-scale state space attention mechanism composed of three MSSA_{Block} units. Each block processes the input with a specified number of attention heads to capture both global context and local feature details, addressing the computational challenges of traditional self-attention methods for high-resolution images. Given an extracted feature V\in\mathbb{R}^{B\times N\times C} , the three MSSA blocks capture multi-scale information, and their outputs are averaged and reshaped to the original spatial dimensions. A final convolution layer followed by SiLU activation produces the \text{MSSA}_{\text{map}} , which highlights potential forgery regions while suppressing background noise, as illustrated in Fig. 4 . Manipulation Attention in Fig. 4 incorporates Locally Enhanced Positional Encoding (LePE) [ 11 ] and Rotary Position Embedding (RoPE) [ 37 ] to enhance spatial awareness. Given an extracted input V\in\mathbb{R}^{B\times N\times C} , the \bar{\textbf{C}} and \bar{\textbf{B}} from Eq. 2 are computed as: \bar{\textbf{C}},\bar{\textbf{B}}=\text{ELU}(\text{Linear}(V_{k}))+1.0 (11) The representation is further modulated using RoPE, and attention is computed efficiently as: p=\frac{1}{\bar{\textbf{C}}\bar{\textbf{B}}^{\top}+\epsilon},\quad\bar{\textbf{B}}V_{k}=(\bar{\textbf{B}}^{\top}N^{-0.5})(V_{k}N^{-0.5}) (12) V_{k}=(\bar{\textbf{C}}\cdot\text{RoPE}(\bar{\textbf{B}}))\bar{\textbf{B}}V_{k}\cdot p+\text{LePE}(V_{k}) (13) Local Positional Encoding (LePE), implemented via depthwise convolution, enhances local feature aggregation and improves representational capacity. The generated V_{k} is passed through a combination of linear, CPE, normalization, and MLP layers to produce the MSSA Block output. The \text{MSSA}_{\text{Block}} comprises a convolutional patch embedding (CPE) layer, normalization layers, and multi-head attention mechanisms. It sequentially applies convolution, normalization, and SiLU activation, followed by the manipulation state-space attention mechanism defined in Eq. 2 , and a feed-forward network (MLP). Residual connections and drop path regularization further refine the output, enabling the MSSA Block to capture fine-grained spatial patterns for tampered region detection while maintaining computational efficiency. 3.5 Forensim Fusion Module To efficiently integrate extracted features, we propose a Non-Local Refinement (NLR) module that propagates information across spatial locations using the similarity map \text{Sim}_{\text{map}} and normalization map \text{Norm}_{\text{map}} from Section 3.3 , along with the manipulation self-structure attention map \text{MSSA}_{\text{map}} from Section 3.4 . This operation enhances contextual coherence by reinforcing semantically meaningful regions and suppressing irrelevant background signals. We formalize the NLR operation as a non-local weighted aggregation of features: \text{NLR}(F)_{i}=\sum_{j}A_{ij}\cdot F_{j},\quad A_{ij}=\frac{\exp(S_{ij})}{\sum_{k}\exp(S_{ik})} (14) where F\in\mathbb{R}^{C\times N} is the input feature map, S_{ij} is the similarity between locations i and j , and A_{ij} is the softmax-normalized attention weight. This operation allows each spatial feature to integrate context from semantically related regions, guided by similarity and manipulation cues. We apply this refinement to both the manipulation and similarity attention pathways as follows: \text{Mani\_Attn}=\text{NLR}(\text{MSSA}_{\text{map}}\odot\text{Sim}_{\text{map}}) (15) \text{Sim\_Attn}=\text{NLR}(\text{Mani\_Attn}\odot\text{Norm}_{\text{map}}) (16) where \odot denotes the Hadamard product. We then construct the fused representation \text{Sim\_Mani\_Attn}\in\mathbb{R}^{C\times\sqrt{N}\times\sqrt{N}} by channel-wise concatenating the aggregated features, as illustrated in Fig. 2 : \text{Sim\_Mani\_Attn}=\text{Mani\_Attn}\otimes\text{Sim\_Attn}\otimes\text{Sim}_{\text{map}} (17) where \otimes denotes channel-wise concatenation. This fused representation captures global self-similarity, local manipulation context, and fine-grained structural cues. It is further processed by a sequence of convolutional layers with SiLU activations (as described in Section 3.3 ) to produce a pixel-level forgery mask and an image-level detection score. This structured design enables Forensim to generalize robustly across diverse manipulation types through context-aware, semantically aligned feature integration. Table 1 : Image Quality Assessment (IQA) on CMFD datasets. \uparrow indicates higher is better; \downarrow indicates lower is better. Method Type CASIA CMFD [ 10 ] CoMoFoD [ 39 ] CMFD_Anything PaQ-2-PiQ [ 49 ] ( \uparrow ) No-Ref 3.64 3.42 4.11 CLIP-IQA [ 41 ] ( \uparrow ) No-Ref 6.58 6.42 7.23 SSIM [ 43 ] ( \uparrow ) Full-Ref 0.832 0.779 0.881 LPIPS [ 51 ] ( \downarrow ) Full-Ref 0.179 0.243 0.124 4 Training and Implementation Methods Precision (Localization) Recall (Localization) F1 (Localization) AUC Precision Recall F1 P S T P S T P S T (Loc.) (Detection) (Detection) (Detection) USC-ISI CMFD Test Set [ 46 ] BusterNet [ 46 ] 93.71 55.85 53.84 99.01 38.26 48.73 96.15 40.84 48.33 0.64 89.26 80.14 84.45 ManTra-Net [ 47 ] 93.50 8.66 48.53 99.22 2.28 28.43 96.08 2.97 30.58 0.53 68.72 85.82 76.32 DOA-GAN [ 20 ] 96.99 76.30 85.60 98.87 63.57 80.45 97.69 66.58 81.72 0.83 96.83 96.14 96.48 HiFi-Net [ 17 ] 92.80 7.10 46.00 98.80 1.90 26.00 95.30 2.50 29.00 0.52 66.00 84.00 74.00 TruFor [ 16 ] 96.88 77.10 86.42 99.01 65.92 81.93 97.99 67.82 82.89 0.85 96.95 96.88 96.59 SparseViT [ 38 ] 97.01 77.85 87.23 99.10 66.91 82.47 98.06 68.29 83.44 0.86 97.10 97.08 96.71 Forensim w/o Sim_Attn 92.62 69.43 78.67 97.11 57.64 72.56 96.23 61.36 74.69 0.78 86.95 81.67 80.06 Forensim w/o MSSA 91.48 68.87 77.39 96.81 58.35 71.43 95.75 60.84 72.91 0.77 85.94 80.62 79.48 Forensim w/o Detection 97.23 78.43 88.63 98.91 68.92 82.64 98.11 69.37 82.14 0.88 97.22 97.38 96.84 Forensim 97.43 79.61 89.29 99.34 70.49 99.67 99.92 74.83 84.48 0.90 98.47 97.64 96.98 CMFD Anything Test Set (Ours) BusterNet [ 46 ] 47.34 36.88 35.16 53.42 26.78 34.96 47.87 28.34 31.26 0.47 44.56 42.61 43.12 ManTra-Net [ 47 ] 48.65 7.16 37.48 64.98 2.21 24.85 48.16 2.41 27.89 0.44 52.62 64.93 57.14 DOA-GAN [ 20 ] 53.48 48.72 52.67 61.83 32.12 43.74 73.36 37.62 44.83 0.60 70.06 73.44 71.42 HiFi-Net [ 17 ] 47.50 6.50 36.00 73.00 1.90 23.00 47.20 2.10 26.00 0.43 51.00 63.00 55.50 TruFor [ 16 ] 56.91 50.83 57.63 65.42 36.21 47.32 77.83 41.29 49.51 0.63 72.45 74.62 73.01 SparseViT [ 38 ] 57.74 52.14 59.95 67.88 38.04 49.89 79.36 43.16 51.73 0.65 73.12 75.81 74.16 Forensim w/o Sim_Attn 52.68 47.39 50.64 58.19 30.87 43.26 70.83 35.87 41.27 0.58 67.58 68.92 66.84 Forensim w/o MSSA 51.67 47.18 49.21 56.82 31.58 42.96 68.12 34.59 40.26 0.57 66.89 67.14 65.72 Forensim w/o Detection 58.45 53.72 61.28 68.76 40.74 51.96 81.23 48.73 53.47 0.68 74.94 76.83 75.17 Forensim 59.41 54.82 64.77 69.74 41.91 53.43 82.67 50.61 54.16 0.70 75.12 77.42 75.68 Table 2 : CMFD results on USC-ISI CMFD [ 46 ] and CMFD-Anything (ours) test sets. Localization uses pixel-level precision, recall, F1 (Pristine(P)/Source(S)/Target(T) regions), and AUC. Detection uses image-level metrics. Bold = best per column, underline = second best. 4.1 Image Splicing using CMFD Training Setup Forensim is designed to detect both splicing and copy-move forgeries using a unified architecture that outputs 3-class masks ( pristine , source , target ) for all manipulation types, as shown in Fig. 4.1 . Unlike prior splicing models [ 47 , 3 , 25 , 16 , 17 , 38 ] , which are trained with binary masks (Fig. 5 a) , capture only artifact cues, and do not model duplication or source regions, our proposed setup (Fig. 5 b) uses 3-class supervision—even for spliced images—enabling the model to learn explicit source-target relationships. This joint modeling of Sim_Map and MSSA_Map allows the network to generalize across manipulation types without task-specific datasets or architectural modifications. While we do not claim to be the first to address CMFD, our key novelty lies in framing Forensim as the first general-purpose IMDL framework trained using a three-class-based training formulation, rather than targeting a specific task like splicing or copy-move. Importantly, we argue that three-class-based training is not a simplified subset of splicing; rather, localizing both source and target regions constitutes a more structured and fine-grained supervision signal than detecting tampering boundaries or artifact regions alone. Method Localization AUC Detection Prec. Rec. F1 (Loc.) Prec. Rec. F1 CASIA CMFD [ 10 ] BusterNet [ 46 ] 42.15 30.54 33.72 0.38 48.34 75.12 58.82 ManTraNet [ 47 ] 38.12 27.42 30.85 0.32 52.13 67.14 58.76 DOA-GAN [ 20 ] 54.70 39.67 41.44 0.46 63.39 77.00 69.53 TruFor [ 16 ] 55.67 41.83 43.62 0.47 78.92 86.32 82.43 SparseViT [ 38 ] 54.32 42.91 45.87 0.46 77.81 87.43 83.23 Forensim 61.87 47.24 58.12 0.57 84.24 91.71 89.12 w/o Sim_Attn 54.78 41.42 42.91 0.46 77.42 85.03 80.92 w/o MSSA 54.32 40.87 42.48 0.45 77.23 84.87 80.76 CoMoFoD CMFD [ 39 ] BusterNet [ 46 ] 51.25 28.20 35.34 0.39 53.20 57.41 55.22 ManTraNet [ 47 ] 36.11 25.48 28.34 0.30 50.34 54.92 52.48 DOA-GAN [ 20 ] 48.42 37.84 36.92 0.42 60.38 65.98 63.05 TruFor [ 16 ] 49.83 38.74 36.54 0.43 66.91 71.25 68.94 SparseViT [ 38 ] 51.15 37.20 37.92 0.42 67.70 70.41 69.83 Forensim 56.41 43.57 47.82 0.51 76.58 77.94 75.82 w/o Sim_Attn 49.51 36.83 35.91 0.41 66.35 69.01 67.31 w/o MSSA 48.89 36.20 35.47 0.40 66.02 68.74 67.10 Table 3 : Pixel and Image-level on CASIA and CoMoFoD CMFD datasets. Bold = Best , Underline = Second-Best . Figure 6 : Qualitative results on four CMFD datasets. Rows:Datasets; Columns:Models. Zoom in to view Untampered , Source , Target . 4.2 Motivation and Dataset Gap As summarized in Table 1 of [ 30 ] , existing CMFD benchmarks include only 941 forged images across four public datasets, none providing three-class RGB masks required to train models like Forensim. USC-ISI CMFD [ 46 ] , based on MS-COCO [ 26 ] and SUN2012 [ 48 ] , contains synthetic images that are often visually obvious and unrealistic. In practice, skilled adversaries can create convincing forgeries difficult to detect—even for humans. Reproducibility is also hindered as USC-ISI CMFD is no longer publicly available, and newer datasets like CatNet [ 25 ] focus only on splicing. These limitations underscore the need for a realistic, large-scale CMFD_Anything dataset. 4.3 CMFD_Anything Dataset We introduce CMFD_Anything , a high-resolution benchmark built from SA-1B images and masks [ 23 ] . Forgeries are created via two strategies: (1) duplicating an object within single-category images, and (2) copying objects from multi-object images to form multiple variants. Each paste is refined with MGMatting [ 50 ] and mild clone-stamp–style transforms (translation, small rotation/scale). As existing CMFD datasets lack negative (pristine) samples, we include 100K unaltered images from SA-1B to enable supervised training and false-positive calibration. The final dataset has 200K forged and 100K pristine images, split 8:1:1 (train/val/test); examples are shown in Fig. 1 . Copy placement. We select destinations in two steps: (i) axis-aligned proposals by sliding along the x / y axes through the source centroid and along its principal axis, subject to distance/scale/overlap gates; (ii) semantic filtering with OpenCLIP [ 5 ] image-only embeddings on local context windows, choosing the arg-max cosine match and requiring \cos\!\geq\!\tau (default \tau{=}0.30 ). We will release per-instance metadata (source/target masks, transform, chosen axis, and similarity) for transparent provenance evaluation. Quality Assessment. We evaluate CMFD_Anything using No-Reference [ 49 , 41 ] (forged-only) and Full-Reference [ 43 , 51 ] (forged vs. pristine) metrics. As shown in Tab. 1 , it outperforms CASIA [ 10 ] and CoMoFoD [ 39 ] . To filter low-quality forgeries, we train a binary classifier to reject synthetic samples that are easily identified as fake. 4.4 Training and Implementation Images are resized to 224\times 224 and processed with a DINO-pretrained Vision Transformer backbone. Models are implemented in PyTorch and trained on an NVIDIA RTX A5000 GPU using AdamW (batch size 64). A cyclic learning rate ( 1\text{\times}{10}^{-3} to 1\text{\times}{10}^{-5} ) is used with StepLR decay (0.5 every 10 epochs). Early stopping is applied based on validation loss. Forensim is trained for 100 epochs on 100K randomly sampled images per epoch from the training pool. The model is optimized with Cross-Entropy and InfoNCE losses, with additional trials using Dice and Focal losses to mitigate class imbalance (details in supplementary). 5 Experimental Evaluation 5.1 Evaluation Datasets and Metrics We evaluate Forensim on three standard copy-move forgery detection (CMFD) benchmarks—USC-ISI CMFD [ 46 ] , CoMoFoD [ 39 ] , and CASIA CMFD [ 10 ] —as well as the test split of our proposed CMFD_Anything dataset. Additionally, we assess generalization on four tampered image detection and localization (IMDL) datasets: NIST16 [ 1 ] , Columbia [ 31 ] , Coverage [ 44 ] , and CASIA [ 10 ] . Notably, neither CASIA nor CoMoFoD provides source and target masks—only binary annotations ( red pixels in Fig. 4.1 ). For evaluation, we report both pixel-level and image-level metrics. Pixel-level performance is assessed using precision, recall, F1-score, and AUC across three forgery classes: pristine , source , and target , derived from three-class RGB masks generated by Forensim and baseline methods. Image-level detection is evaluated using precision, recall, and F1-score. To ensure consistent global evaluation, true positives (TP), false positives (FP), and false negatives (FN) are aggregated across the entire dataset prior to metric computation. Following prior works [ 46 , 47 , 20 ] , we apply a 200-pixel threshold (for 320\times 320 images) to suppress small false positives. Tab. 2 and Tab. 3 present detailed pixel- and image-level results on CMFD datasets. Tab. 4 reports pixel-level F1 scores across four IMDL benchmarks, highlighting the generalization of Forensim to diverse manipulation types and real-world forgeries. 5.2 Forensim Results and Analysis For fairness and reproducibility, we restrict comparisons to models with publicly accessible code. All baseline methods were retrained following the protocol in [ 25 ] and evaluated on publicly available benchmark datasets. We compare Forensim against models trained on binary masks across both CMFD-specific and IMDL datasets, validating the effectiveness of our three-class training formulation. As shown in Tab. 2 , Tab. 3 , and Tab. 4 , Forensim consistently achieves the best F1 and AUC scores for both pixel-level localization and image-level detection across all benchmarks. Forensim independently models duplication similarity ( Sim_Map ) and manipulation structure ( MSSA_Map ), subsequently refined through non-local aggregation. It outputs three-class source-target masks—outperforming SOTA IMDL baselines in qualitative evaluation ( Fig. 4.1 ) and outputs binary forgery masks for splicing, when no in-image source exists ( Fig. 7(a) ). Despite its strong performance, Forensim remains efficient—36.7M params and 28.7 GFLOPs at 512\times 512 resolution, while outperforming larger baselines like TruFor [ 16 ] , SparseViT [ 38 ] ( Tab. 7 ). 5.3 Ablation Analysis and Robustness We perform ablations on three Forensim components: Sim_Attn , MSSA , and the detection branch ( Tab. 2 , Tab. 3 ). To further understand key design choices, we analyze normalization strategies and pre-processing conditions. Tab. 5 shows pixel-level F1 scores across three variants of the Sim_Attn normalization. The BiSoftmax configuration, which applies full normalization along both row and column dimensions, consistently outperforms the raw and Row-only variants across datasets. This demonstrates the importance of bi-directional affinity normalization for capturing discriminative similarity cues in IMDL. Tab. 6 presents additional ablations on the CMFD_Anything benchmark by varying mask generation strategies. Removing the MGMatting post-processing, replacing three-class masks with binary masks, or introducing noise into ground truth annotations each lead to degraded performance across all input resolutions. In contrast, the full CMFD_Anything pipeline achieves the best F1 scores, particularly at 512\times 512 , highlighting the value of high-fidelity soft masks and precise annotations for robust model training. To assess robustness, we test Forensim under six perturbations—brightness, JPEG compression, contrast, cropping, noise, and blur—following [ 46 , 47 ] , plus four social-media perturbations (supplementary, Table 4) following [ 45 ] . As shown in Fig. 8 , Forensim consistently outperforms state of the art across all perturbations. These results underscore Forensim’s design: Sim_Attn captures global duplication, MSSA local artifacts, and multi-scale state-space attention enhances robustness; with three-class supervision, Forensim demonstrates strong generalization across forgery types and image-level distortions. Table 4 : Pixel-level F1 localization on benchmark IMDL datasets using best threshold and a fixed threshold of 0.5 following [ 16 ] . Method NIST [ 1 ] COL [ 31 ] COV [ 44 ] CASIA [ 10 ] Avg. Best Fixed Best Fixed Best Fixed Best Fixed Best Fixed ManTra [ 47 ] 21.9 19.3 47.5 46.2 21.1 19.6 38.2 32.7 32.2 29.5 TruFor [ 16 ] 35.6 34.8 89.4 88.5 47.3 45.7 83.5 81.8 63.9 62.7 SparseViT [ 38 ] 39.4 38.4 95.9 95.9 52.5 51.3 84.2 82.7 68.0 67.1 Forensim (Ours) 40.2 39.1 94.2 93.8 55.7 54.6 83.4 81.8 68.4 67.3 (a) Benchmark IMDL Localization (b) Misdetection and False Alarms Figure 7 : (a) Forensim IMDL; (b) Forensim Limitations 5.4 Failure Cases and Future Directions While Forensim is robust overall, we observe three recurring failure modes: (i) background-matching splices where low contrast suppresses \mathrm{MSSA}_{\text{map}} (row 1, Fig. 7(b) ); (ii) repetitive structures causing many-to-many matches in \mathrm{Aff}_{\text{final}} (row 3); and (iii) rare errors on low-color/monochrome images. Remedies include a lightweight frequency/boundary head and photometric/codec augmentations for (i); uniqueness constraints (entropy-based or non-max suppression) and hard-negative mining for (ii); and grayscale-focused augmentation with contrast-limited adaptive histogram equalization plus a luminance similarity head for (iii). We will broaden 2D RoPE and extend to video IMDL with spatio-temporal consistency. Figure 8 : Robustness under attacks on CMFD_Anything. Table 5 : Pixel-level F1 across normalization types in Sim_Attn. Variant Norm. CASIA CMFD [ 10 ] CoMoFoD [ 39 ] CMFD_Anything None Raw 31.6 29.2 33.8 Row-only Partial 44.8 36.7 54.3 BiSoftmax Full 58.1 47.8 62.4 Table 6 : Ablation studies on CMFD_Anything using Forensim. Ablation Condition 224\times 224 256\times 256 320\times 320 512\times 512 No MGMatting 56.6 57.7 58.5 61.2 Binary Mask 53.9 55.2 56.3 59.4 Noisy Groundtruth 53.4 54.6 55.5 58.4 CMFD_Anything 59.6 60.8 62.1 62.4 Table 7 : Model complexity w.r.to Resolution, Parameters, FLOPs. Method Backbone Input Size Params FLOPs BusterNet [ 46 ] VGG 256\times 256 15.5M 45.7G ManTraNet [ 47 ] VGG 256\times 256 3.9M 274.0G DOA_GAN [ 20 ] VGG 256\times 256 26.9M 46.7G TruFor [ 16 ] ViT 512\times 512 68.7M 236.5G SparseViT [ 38 ] ViT 512\times 512 50.3M 46.2G Forensim (Ours) SSM 512\times 512 36.7M 28.7G 6 Conclusion We presented Forensim, a unified framework for IMDL that accurately localizes both source and forged regions using three-class supervision. We propose similarity and manipulation attention modules within a state-space framework, enabling efficient modeling of long-range dependencies with linear complexity. Forensim addresses key limitations of existing CMFD and splicing models, which typically rely on binary masks and artifact-based cues. To support robust training and evaluation, we introduced CMFD_Anything , a high-resolution dataset containing realistic copy-move forgeries. Extensive experiments across multiple benchmarks demonstrate that Forensim achieves state-of-the-art performance and generalizes effectively across manipulation types and attack scenarios, establishing it as a unified and interpretable solution for image forensics.