A light-weight image seam cropping tampering localization method and apparatus
By using a single-branch encoding-decoding structure and an adaptive dynamic fusion module, the problem of high parameter quantity and computational complexity in existing image tampering localization methods in resource-constrained scenarios is solved, achieving lightweight and high-precision tampering area localization.
Patent Information
- Application Number
- CN202611379072.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-24
AI Technical Summary
Existing image tampering localization methods struggle to achieve high-precision localization in resource-constrained scenarios, especially for Seam Carving tampering localization tasks, which have high model parameter counts and computational complexity, making them unsuitable for mobile or real-time evidence collection applications.
A single-branch encoder-decoder structure is adopted, which combines multi-scale convolution and LS convolution to extract high-frequency residual information of tampered images. A spatial gated modulation mechanism is introduced for pixel-level enhancement, and feature fusion is optimized through an adaptive dynamic fusion module to reduce computational overhead while maintaining high-precision positioning capability.
While significantly reducing computational overhead, it achieves high-precision pixel-level positioning of tampered areas, effectively identifying tampered areas and achieving a balance between accuracy and efficiency.
Smart Images

Figure CN123160853A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital image processing technology, and in particular to a lightweight method and apparatus for image seam clipping and tampering positioning. Background Technology
[0002] Existing image tampering operations, such as content-aware deletion or insertion, alter the original image content. For purposes like image authenticity verification or content restoration, it's necessary to locate the tampered areas. Current image tampering localization methods primarily focus on improving accuracy. Methods based on Convolutional Neural Networks (CNNs) and Transformers have achieved significant performance improvements. However, CNNs are limited by the local receptive field of small kernel convolutions, making it difficult to effectively model long-range dependencies. While Transformers can capture global information, their self-attention mechanism introduces unnecessary attention in unimportant areas, significantly increasing computational overhead and limiting their application in resource-constrained scenarios. Furthermore, existing research generally recognizes the crucial role of noise features and edge information in image tampering localization tasks, thus favoring a dual-branch structure to model tampering traces from both semantic and non-semantic dimensions. While this method can improve localization performance to some extent, it inevitably introduces additional computational paths, significantly increasing the number of parameters and computational cost in the encoding stage, and increasing the difficulty of network deployment. In other words, while pursuing high localization performance, these methods often rely on large model size and high computational overhead, thus limiting their application in resource-constrained environments.
[0003] The aforementioned problems are more pronounced in tasks targeting specific types of tampering, such as the seam carving image tampering localization task. This task involves locating tampering operations performed by the Seam Carving technique on images, specifically content-aware deletions or insertions, and identifying the deleted or inserted tampered areas in the image. For Seam Carving image tampering localization tasks, pursuing high localization performance also results in a large number of model parameters and high computational complexity, making it difficult to meet the deployment requirements of practical applications such as mobile devices or real-time forensics. To adapt to practical applications such as mobile devices and real-time forensics, existing methods tend to reduce the number of model parameters and computational complexity to achieve lightweighting. However, the lightweighting process inevitably annihilates edge noise and frequency domain residuals, making it difficult for the model to perceive small tampered areas, ultimately leading to the inability to accurately locate the tampered areas.
[0004] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention
[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention proposes a lightweight image seam cutting and tampering positioning method and device, which can maintain high-precision positioning capability of the tampered area while being lightweight.
[0006] The embodiments of the present invention adopt the following technical solutions: In a first aspect, the present invention provides a lightweight method for locating image seam cropping tampering, specifically: using the tampered image to be detected... As input, high-frequency residual information of the tampered image is extracted by integrating SRM filters in the horizontal, vertical and diagonal directions, and a spatial gated modulation mechanism is introduced to enhance the RGB features of the tampered image at the pixel level to obtain the initial features for texture enhancement. During the encoding stage, multi-scale convolution and LS convolution are used to extract the spatial features of the initial features in different receptive fields to obtain continuous structural features that represent the seam cutting and tampering. After continuous downsampling, the continuous structural features are refined into deep features to obtain refined deep features. In the decoding stage, deep features are used as input. During the process of upsampling and restoring resolution step by step, the correlation between the upsampled features and the skip connection features of the corresponding level in the encoding stage is modeled. A competitive gating mechanism is used to adaptively allocate fusion weights to achieve selective enhancement and suppression of features, thereby obtaining high-resolution discriminative features. After pixel-by-pixel classification mapping, the discriminative features are output as a binary prediction mask. To determine the area that was tampered with.
[0007] Preferably, the method further includes: Image manipulation The signals are fed into the RGB branch and the noise extraction branch in parallel. In the RGB branch, the basic spatial features of the tampered image are extracted through 3×3 convolution, and the number of channels is expanded through 1×1 convolution. Then, local modeling is performed by combining depthwise convolution, and the image is divided along the channel dimension to obtain the first sub-feature. Second sub-feature ; In the noise extraction branch, SRM filters are used to extract high-frequency residual information from the tampered image. Convolution operations are then used to map this high-frequency residual information to a channel space consistent with RGB features. Dilated convolutions with different receptive fields are introduced in parallel to extract local and extended neighborhood information. These two are then fused along the channel dimension to obtain the enhanced noise features. ; Utilizing enhanced noise characteristics For the first sub-feature Fusion is performed to generate spatial adaptive gating. ; Space adaptive gating is achieved through element-wise multiplication. Acting on the second sub-feature Thus, the initial features are obtained.
[0008] Preferably, the encoder includes multi-layered cascaded feature extraction units, and the method further includes: The output features of the (i-1)th layer feature extraction unit As the input to the i-th layer feature extraction unit, the output features are obtained after processing by the i-th layer feature extraction unit. , where i=1,2,…,N, the initial features are used as the input of the first layer feature extraction unit, and the output of the Nth layer feature extraction unit is the continuous structural features.
[0009] Preferably, the processing procedure of a feature extraction unit in the encoder includes: Output features The data is fed into multi-scale convolution branches for parallel modeling to capture spatial information under different receptive fields and obtain spatial feature maps output by each scale convolution branch. The multi-scale convolution branches include 3×3 convolution, 5×5 convolution and 7×7 convolution. Three weight parameters are set for each scale convolution branch, and the weights are normalized using the Softmax function to obtain normalized weights. , ; The normalized weights are weighted and aggregated with the corresponding spatial feature maps to obtain scale features; By combining large kernel perception and small kernel aggregation convolutional operations to process scale features, the network's ability to jointly represent the overall structure of the tampered path and local anomalies is enhanced, resulting in joint features. ; Joint features are achieved through 1×1 convolution. Channel reorganization and mapping are performed, and the features output by the feature extraction unit in the encoder are obtained through residual connection.
[0010] Preferably, scale features are processed by combining large kernel perception and small kernel aggregation convolutional operations to enhance the network's ability to jointly represent the overall structure of the tampered path and local anomalies, thereby obtaining joint features. ,include: The number of channels for scale features is reduced from 1×1 convolution. Compress to Furthermore, it employs large-kernel depth separable convolution to expand the receptive field, thereby capturing a wide range of spatial context information and long-distance dependencies to obtain intermediate features; Intermediate features are processed through 1×1 convolutions to generate a set of spatially adaptive dynamic convolution weights. ; Group and split the dynamic convolution weights so that each Each channel shares a set of sizes. The groups share dynamic weights, where G is the total number of groups; The scale features and grouped shared dynamic weights are input into a location-dependent dynamic convolution to perform operations, thereby achieving fine-grained feature aggregation and enhancement within a local range, resulting in joint features. .
[0011] Preferably, the decoder includes a multi-layered cascaded feature extraction unit and a feature fusion unit that fuses upsampled features and skip connection features. The method further includes: Deep features are upsampled through multiple upsampling steps to obtain upsampled features; the features output by the encoder feature extraction unit are used as skip connection features; except for the deepest layer which directly enters the corresponding feature extraction unit of the encoder, the upsampled features and the skip connection features of the corresponding resolution are adaptively fused by the feature fusion unit after upsampling in the other layers, and then the fused features are sent to the feature extraction unit of the current layer. This process is repeated step by step to decode upwards and finally recover the high-resolution discriminative features.
[0012] Preferably, the decoder includes multi-layered cascaded feature extraction units, and the processing of one feature extraction unit includes: Upsampled features using 1×1 convolution Features of skip connections Channel alignment is performed to obtain a feature representation with a unified dimension. and feature representation ; Feature representation is constructed using element-wise multiplication. and feature representation The response coupling relationship between them is determined, and the interaction features are locally modeled using convolution to obtain the enhanced interaction features. ; Feature representation Feature representation and interaction features The fusion process is performed to construct a global context representation. Channel-level statistics are extracted through global average pooling, and the fusion weight W is obtained after passing through two lightweight networks and normalization. By fusing weight W to the feature representation Feature representation and interaction features After weighted fusion, further local refinement is performed through 3×3 convolution to obtain the final features output by the feature extraction unit in the decoder.
[0013] Preferably, the expression for the fusion weight W is as follows: ; ; in, This is a set of fusion weights, including three types of feature representations and their corresponding fusion weights. This represents the fusion weights corresponding to the upsampled features. This represents the fusion weights corresponding to the skip connection features. This represents the fusion weights corresponding to the interactive features. It is a global average pooling operation. It is a fully connected network consisting of two 1×1 convolutional layers. This represents the enhanced interaction features. This represents the feature representation corresponding to the upsampled feature. This represents the feature representation corresponding to the skip connection feature, and Softmax represents the normalization process.
[0014] In a second aspect, the present invention provides a lightweight image seam cropping and tampering location device, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing the lightweight image seam cropping and tampering location method of the first aspect.
[0015] Thirdly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions, which are executed by one or more processors to perform the lightweight image seam cropping and tampering positioning method described in the first aspect.
[0016] Compared with existing technologies, the advantages of this invention are as follows: In terms of structural design, a single-branch encoder-decoder structure is adopted instead of the traditional dual-branch structure. On the one hand, noise feature modeling is moved forward to the input end for early suppression; on the other hand, redundant computation is reduced by simplifying branches, thus achieving network lightweighting. In feature extraction, multi-scale feature modeling and a large receptive field mechanism are introduced to enhance the perception ability of continuous structures in tampered regions, compensating for the shortcomings of single-branch structures in representation ability. In feature fusion, an adaptive dynamic fusion strategy is introduced to selectively aggregate multi-level features according to correlation, improving feature utilization efficiency. Through the above layer-by-layer design from structural simplification and feature enhancement to fusion optimization, the invention ultimately maintains high-precision pixel-level localization capability of tampered regions while significantly reducing computational overhead, effectively identifying tampered regions and achieving an effective balance between accuracy and efficiency. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0018] Figure 1 This is an architecture diagram of a Seamless Carving tampering location network provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating a lightweight image seam cropping and tampering positioning method provided in an embodiment of the present invention; Figure 3 This is an architecture diagram of NGFP in a lightweight image seam cropping and tampering localization method provided in an embodiment of the present invention; Figure 4 This is a flowchart of the ADFM method in a lightweight image seam cropping and tampering location method provided in an embodiment of the present invention; Figure 5 This is a flowchart of step 101 in a lightweight image seam cropping and tampering positioning method provided in an embodiment of the present invention; Figure 6 This is a flowchart of the processing procedure of a feature extraction unit in an encoder provided in an embodiment of the present invention; Figure 7 This is an architecture diagram of the LSConv module in a lightweight image seam cropping and tampering location method provided in an embodiment of the present invention; Figure 8 This is a flowchart illustrating the processing of the LSConv module in a lightweight image seam cropping and tampering location method provided in an embodiment of the present invention. Figure 9 This is a flowchart of the processing procedure of a feature extraction unit in the decoder provided in this embodiment of the invention; Figure 10 These are the image tampering localization results of different networks provided in the embodiments of the present invention; Figure 11 These are the image tampering location results of different networks provided in the embodiments of the present invention; Figure 12 This is a visualization verification diagram of the ablation experiment in Seamless Removing provided in the embodiments of the present invention; Figure 13 This is a schematic diagram of a lightweight image seam cutting and tampering positioning device provided in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0020] Unless the context otherwise requires, throughout the specification and claims, the term "comprising" is interpreted as openly inclusive, meaning "including, but not limited to." In the description of the specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this disclosure. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics mentioned may be included in any suitable manner in any one or more embodiments or examples; that is, although they may be incorporated into embodiments or examples using the above terms for reasons such as order and position, it does not limit them to be incorporated in combination by a single embodiment or example.
[0021] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more. Furthermore, for example, the description may use the prefix "A" or "B" to describe the same type of nouns as two independent entities. In this case, the corresponding features defined with "A" and "B" are used only to distinguish between similar entities and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.
[0022] In the description of this invention, the expression “A and / or B” (where A and B are used to formally represent specific features) will be used. The corresponding expression includes the following three combinations: only A, only B, and a combination of A and B.
[0023] As used in this invention, “about,” “approximately,” or “approximately” includes the stated value and the average value within an acceptable range of deviation from a particular value, wherein the acceptable range of deviation is determined by a person skilled in the art taking into account the measurement under discussion and the error associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).
[0024] Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0025] Example 1: Existing deep learning methods for Seam Carving still fall short in modeling long-range structural relationships, with most methods based on CNN architectures using 3×3 small kernel convolutions. While this type of architecture is strong in local feature extraction, it is limited by the receptive field and struggles to effectively capture structural continuity. Seam Carving essentially involves the progressive deletion or insertion of pixels along the lowest-energy path in an image, and the tampering traces typically manifest spatially as elongated and continuous texture variations. These structures exhibit clear directionality and coherence. However, traditional small kernel convolutions primarily rely on local receptive fields for feature extraction, focusing more on modeling short-range changes within the neighborhood and easily neglecting long-range structural continuity. Therefore, it is necessary to introduce a large receptive field modeling mechanism to enhance the ability to model the overall coherence of the tampering path. In contrast, CNN architectures using large kernel convolutions can effectively expand the receptive field while avoiding the high computational overhead of Transformers, thus providing a feasible approach to building lightweight networks that balance accuracy and efficiency.
[0026] Based on the above analysis, the applicant proposes a lightweight seam-carving tampering localization network. Addressing the characteristic of seam features being long, thin, and continuous, traditional small-kernel convolutions, limited by their receptive field, struggle to effectively capture the overall continuity of the tampering path. The applicant designed a Multi-scale Dynamic Aggregation Block (MSDABlock). MSDABlock utilizes depthwise convolutions to construct multi-scale receptive fields, perceiving seam structural changes at different scales, thus achieving effective modeling of continuous tampering traces. Building upon this, based on the principle of large-kernel perception and small-kernel focusing, a 7×7 large-kernel perception is used to capture the large-scale geometric distribution of the tampering path, while small-kernel spatial focusing achieves content-adaptive local feature refinement. The entire tampering localization network uses MSDABlock as its basic building block, extracting and reconstructing features layer by layer in both encoding and decoding stages, thus forming a unified and efficient feature representation framework. To reduce the number of model parameters and computational complexity, the applicant abandoned the traditional dual-branch architecture and designed a Noise-Guided Feature Preprocessing (NGFP) module. NGFP introduces SRM (Steganalysis Rich Model) noise priors at the input and performs pixel-level gated modulation on RGB (Red, Green, Blue) features, thereby achieving initial enhancement of tamper-sensitive regions. Addressing the issue of insufficient fusion between upsampled features and skip connection features during decoding, the applicant designed an Adaptive Dynamic Fusion Module (ADFM). ADFM learns the dynamic weight relationships between features to achieve effective complementarity between the two types of features, thereby improving the response consistency and localization integrity of tampered regions. Ultimately, it maintains high-precision localization capability of tampered regions while remaining lightweight.
[0027] like Figure 1The diagram shows the architecture of the Seam Carving tamper localization network provided by this invention. The Seam Carving tamper localization network is a single-branch encoder-decoder structure. The encoder consists of four cascaded MSDABlocks at the top, and the decoder includes four cascaded MSDABlocks at the bottom and ADFM. The network first preprocesses the tampered image to be detected using NGFP to generate initial texture-enhanced features. The encoder receives these initial features, extracts them step-by-step through the four MSDABlocks and corresponding downsampling layers, and then sends the features output by the last MSDABlock to Bottleneck for deep feature refinement to obtain more discriminative deep features. In the decoding stage, the decoder starts from the deep features output by Bottleneck and gradually restores the spatial resolution through upsampling, thus obtaining upsampled features at different scales. Simultaneously, the features output by the corresponding MSDABlocks at each layer of the encoder are used as skip connection features. Before entering subsequent MSDABlocks, the upsampled features and skip connection features are first fused by the adaptive dynamic fusion module ADFM. Finally, the network outputs a binary prediction mask to achieve accurate localization of the tampered region. This invention introduces a multi-scale dynamic aggregation block MSDABlock, a noise-guided feature preprocessing module NGFP, and an adaptive dynamic fusion module ADFM into the Seam Carving tamper localization network. Through a single-branch structure and lightweight module design, it can effectively capture the fine-grained structural features of Seam Carving tampering while significantly reducing the number of parameters and computational complexity, thus achieving a good balance between accuracy and efficiency.
[0028] based on Figure 1 The provided Seam Carving tamper location network, in Embodiment 1 of this invention, provides a lightweight image seam cropping tamper location method, such as... Figure 2 As shown, the method specifically includes the following steps: Step 101: Using the tampered image to be detected As input, high-frequency residual information of the tampered image is extracted by integrating SRM filters in the horizontal, vertical and diagonal directions, and a spatial gated modulation mechanism is introduced to enhance the RGB features of the tampered image at the pixel level, so as to obtain the initial features for texture enhancement.
[0029] In traditional two-branch image tampering localization methods, high-frequency residual information is typically modeled using a separate noise branch to compensate for the insensitivity of RGB features to fine-grained structural anomalies. However, these methods often introduce additional network branches, significantly increasing the number of model parameters and computational overhead, which is not conducive to lightweight deployment.
[0030] Since the key role of noise features is to highlight structural anomalies in potentially tamperable regions, this invention proposes a noise-guided feature preprocessing module, NGFP. NGFP moves noise modeling forward to the network input, using high-frequency residual information to spatially guide RGB features, achieving enhanced expression of tamper-sensitive regions without introducing additional branches. The structure of NGFP is as follows: Figure 3 As shown, input features Figure X The process is divided into two parallel branches, one above the other. In the upper branch, the input features are processed in parallel. Figure X After sequentially processing through 3×3 ordinary convolution, 1×1 convolution, and 3×3 depthwise convolution, channel segmentation is performed to output the first sub-feature. Second sub-feature First sub-feature Subsequent splicing, second sub-feature Retain directly as the primary feature to be weighted.
[0031] In the next branch, input features Figure X After a 3×3 convolution, the output is split into two dilated convolutions (DConv) with dilation rates of 1 and 2 to capture information from different receptive fields. The results of the two dilated convolutions are then concatenated and followed by a 1×1 convolution to obtain noise features. The first sub-feature With noise characteristics Channel concatenation is performed; the concatenated features are then sequentially processed through 1×1 convolutions and 3×3 depthwise convolutions, before being activated by a Sigmoid function to generate a spatially adaptive gate G. The spatially adaptive gate is then applied via element-wise multiplication. Acting on the second sub-feature Thus, the initial features are obtained.
[0032] Step 102: In the encoding stage, multi-scale convolution and LS convolution are used to extract the spatial features of the initial features in different receptive fields to obtain continuous structural features that represent the seam cutting and tampering. After continuous downsampling, the continuous structural features are refined into deep features to obtain refined deep features.
[0033] For seamless tampering, the tampering traces typically manifest as thin and continuous structural perturbations, making it difficult to simultaneously address the requirements of detail sensitivity and context awareness at a single scale. Therefore, this invention proposes the multi-scale dynamic aggregation block MSDABlock. MSDABlock combines multi-scale convolutional modeling with LSConv, achieving dynamic aggregation of features from different receptive fields while enhancing the collaborative modeling ability of large-scale structural information and local detail features, thereby improving the network's ability to represent continuously tampered structures. Figure 1As shown, the output of each MSDABlock is fed into the next connected MSDABlock as input, and also directly into ADFM to be fused with the upsampled features of the corresponding resolution.
[0034] Step 103: In the decoding stage, deep features are used as input. During the process of upsampling and restoring resolution step by step, the correlation between the upsampled features and the skip connection features of the corresponding level in the encoding stage is modeled. The competitive gating mechanism is used to adaptively allocate fusion weights to achieve selective enhancement and suppression of features, thereby obtaining high-resolution discriminative features.
[0035] In the encoder-decoder structure, skip connection features and upsampled features differ in their expression level and information attributes. The former retains rich shallow spatial details, while the latter contains stronger high-level semantic expressions. Directly fusing features by concatenation or element-wise addition can easily lead to information conflicts or redundant accumulation, thus affecting the ability to distinguish tampered regions. Therefore, this invention proposes an Adaptive Dynamic Fusion Module (ADFM). Before the upsampled features and skip connection features enter the subsequent MSDABlock, they are fused through ADFM. This method achieves adaptive selection and effective integration of features from different sources by constructing a multi-branch feature representation and a dynamic weight allocation mechanism, improving feature utilization efficiency and the stability of localization results. In addition, a competitive gating mechanism based on Softmax is used to adaptively allocate fusion weights, thereby achieving selective enhancement and suppression of features, providing more discriminative input features for the subsequent MSDABlock. Among them, the upsampled features are features obtained by upsampling deep features layer by layer, and the skip connection features are features output by each MSDABlock in the encoding stage and downsampled. ADFM fuses upsampled features and skip connection features of the same resolution.
[0036] The structure of ADFM is as follows: Figure 4 As shown, ADFM receives upsampled features and skip connection features. Both are first aligned using 1×1 convolutions, and then multiplied pixel-by-pixel to obtain interaction features. Finally, a 3×3 convolution is performed to obtain the enhanced interaction features. Representing features Feature representation and interaction features The system performs fusion to construct a global context representation. Channel-level statistics are extracted using global average pooling, and the resulting data is processed through two lightweight networks and normalization to obtain the fusion weights W. These fusion weights W are then used to adjust the feature representation. Feature representation and interaction features After weighted fusion, further local refinement is performed through 3×3 convolution to obtain the final features output by the feature extraction unit in the decoder.
[0037] Step 104: Output a binary prediction mask after pixel-by-pixel classification mapping of the discriminative features. To determine the area that was tampered with.
[0038] Binary prediction mask It is a single-channel matrix with a height of H and a width of W, and its spatial resolution is strictly consistent with that of the tampered image.
[0039] In one embodiment, the discriminative features output by the decoder are processed through a pixel-by-pixel classification mapping layer to generate a single-channel probability map; then, after threshold decision (e.g., 0.5) binarization, they are transformed into a binary prediction mask. This mask uses white to mark tampered pixels and black to mark original pixels, thereby outlining the complete contour and irregular boundaries of the tampered area with pixel-level precision, achieving accurate positioning of the tampered area.
[0040] In this embodiment, a single-branch encoder-decoder structure is used instead of the traditional dual-branch structure in terms of structural design. This approach moves noise feature modeling forward to the input for early suppression and reduces redundant computation by simplifying branches, thus achieving network lightweighting. For feature extraction, multi-scale feature modeling and a large receptive field mechanism are introduced to enhance the perception of continuous structures in tampered regions, compensating for the shortcomings of the single-branch structure in representation. For feature fusion, an adaptive dynamic fusion strategy is introduced to selectively aggregate multi-level features based on relevance, improving feature utilization efficiency. Through this layered design from structural simplification and feature enhancement to fusion optimization, a high-precision pixel-level localization capability for tampered regions is maintained while significantly reducing computational overhead, achieving an effective balance between accuracy and efficiency.
[0041] Traditional image tampering localization methods typically introduce a separate network branch to extract high-frequency noise or residual information in order to capture subtle structural anomalies in the tampered region. However, introducing a separate network branch significantly increases the number of model parameters and computational overhead, hindering lightweight deployment. Therefore, the core idea of steps 201-205 of this invention is to move the noise modeling process from the deep layers of the network to the input end. This eliminates the need for additional network branches, allowing high-frequency residual information to be used directly at the input end to guide and enhance RGB features, achieving the same technical effect without adding network branches. In other words, this invention configures an intelligent amplification mechanism for the network at the input end, based on the first sub-feature. Determine the feature magnification region and the corresponding second sub-feature. Performing feature enhancement operations offers higher efficiency and positioning accuracy, such as... Figure 5As shown, step 101 specifically includes the following steps: Step 201: Transfer the tampered image The signals are fed into the RGB branch and the noise extraction branch in parallel.
[0042] Step 202: In the RGB branch, extract the basic spatial features of the tampered image through a 3×3 convolution operation, expand the number of channels through a 1×1 convolution, and then perform local modeling by combining depthwise convolution, and divide the image along the channel dimension to obtain the first sub-feature. Second sub-feature .
[0043] In the RGB branch, directly modulating the features as a whole can easily introduce redundant interference. Therefore, this invention divides the features into two parts through channel expansion and decomposition, which are used for subsequent gating generation and response enhancement.
[0044] Specifically, the basic spatial features of the tampered image are extracted through 3×3 convolution, the number of channels is expanded through 1×1 convolution, and local modeling is performed by combining depthwise convolution. Then, the image is divided along the channel dimension to obtain the first sub-feature. Second sub-feature First sub-feature Primarily used to generate spatial modulation weights, the second sub-feature. As the response branch to be enhanced, the expression corresponding to step 202 is as follows: ; in, Indicates the first sub-feature, Indicates the second sub-feature. (·) represents a 3×3 convolution. (·) represents a 1×1 convolution. (·) denotes depthwise convolution. (·) indicates a partitioning operation.
[0045] Step 203: In the noise extraction branch, the SRM filter is used to extract the high-frequency residual information of the tampered image. The high-frequency residual information is mapped to the channel space consistent with the RGB features through convolution operation. Dilated convolution with different receptive fields is introduced to extract local information and extended neighborhood information in parallel. The two are fused in the channel dimension to obtain the enhanced noise features. .
[0046] In the noise branch, the high-frequency residual information of the tampered image is extracted using an SRM filter. This high-frequency residual information is then mapped to a channel space consistent with the RGB features via convolution. The corresponding expression is as follows: ; in, Indicates noise characteristics, For SRM filters, To tamper with the image, (·) represents a 3×3 convolution.
[0047] Considering that a single-scale noise response is insufficient to fully characterize the spatial distribution characteristics of tampering traces, this invention also introduces convolutional operations with different receptive fields to enhance its modeling. Specifically, local and extended neighborhood information is extracted in parallel through dilated convolution and fused at the channel dimension to obtain enhanced noise features. The corresponding expression is as follows: ; in, This indicates the enhanced noise characteristics. (·) represents a 3×3 convolution. (·) denotes dilated convolution with an inflation rate of 2 and a kernel size of 3×3. This indicates a channel-level concatenation operation. Indicates noise characteristics, (·) represents a 1×1 convolution.
[0048] Step 204: Utilize the enhanced noise features For the first sub-feature Fusion is performed to generate spatial adaptive gating. .
[0049] Obtain the enhanced noise characteristics Subsequently, to enable noise features to effectively guide the expression of RGB features, this invention introduces a spatial attention-based gated modulation mechanism, utilizing the enhanced noise features. For the first sub-feature By fusing the data, a spatially adaptive gating system that reflects the saliency distribution at different spatial locations is generated. In spatial adaptive gating, the high-response region corresponds to a potential tampering location. The expression is as follows: ; in, Indicates spatial adaptive gating, This indicates the enhanced noise characteristics. This indicates a channel-level concatenation operation. (·) represents a 1×1 convolution. (·) denotes depthwise convolution. For activation function, This is the first sub-feature.
[0050] Step 205: Adaptive gating of space through element-wise multiplication Acting on the second sub-feature Thus, the initial features are obtained.
[0051] Space adaptive gating Acting on the second sub-feature That is, dynamic feature selection and enhancement are achieved through element-wise multiplication, and the corresponding expression is as follows:
[0052] in, Indicates initial features, Indicates spatial adaptive gating, Indicates the second sub-feature. (·) represents a 1×1 convolution. This indicates element-wise multiplication.
[0053] Space adaptive gating Acting on the second sub-feature The process can be understood as using noise features to explicitly guide RGB features, so that RGB features enhance response in texture abnormal areas and suppress irrelevant information in background areas, thereby improving the discriminative ability of feature expression.
[0054] In summary, NGFP effectively enhances tamper-sensitive regions without adding extra branches by introducing a noise-guided mechanism at the input stage. Compared with noise-independent branches, this design not only reduces model complexity but also provides a stable and discriminative input representation for subsequent feature extraction.
[0055] The lightweight image seam cropping and tampering localization method also includes encoding initial features, such as... Figure 1 As shown, the encoder includes multiple cascaded feature extraction units (MSDABlock), which extract the output features of the (i-1)th layer feature extraction unit. As the input to the i-th layer feature extraction unit, the output features are obtained after processing by the i-th layer feature extraction unit. , where i=1,2,…,N, the initial features are used as the input of the first layer feature extraction unit, and the output of the Nth layer feature extraction unit is continuous structural features.
[0056] like Figure 6 As shown, the processing procedure of a feature extraction unit in the encoder specifically includes the following steps: Step 301: Output features The data is fed into multi-scale convolutional branches for parallel modeling to capture spatial information under different receptive fields, and spatial feature maps output by each scale convolutional branch are obtained. The multi-scale convolutional branches include 3×3 convolution, 5×5 convolution and 7×7 convolution.
[0057] Considering that different scale branches focus on local detail modeling and large-scale context information extraction respectively, with small kernel convolution focusing more on fine-grained texture changes and large kernel convolution capturing structural dependencies over longer distances, richer representation capabilities can be obtained through collaborative modeling of multi-scale features. Therefore, this invention will output features... The data is fed into a multi-scale convolutional branch for parallel modeling. This branch employs three different scales of depthwise convolution (including 3×3, 5×5, and 7×7 convolutions) to model the output features. Parallel processing is performed to capture spatial information under different receptive fields, ultimately obtaining spatial feature maps output by convolutional branches at various scales.
[0058] In one embodiment, the input to a feature extraction unit is defined as f, and the expression for obtaining the spatial feature map by parallel modeling of f is as follows: ; in, This represents the input to a feature extraction unit. This represents a 3×3 convolution. This represents a 5×5 convolution. This represents a 7×7 convolution. This represents the spatial feature map output after a 3×3 convolution. This represents the spatial feature map output after a 5×5 convolution. This represents the spatial feature map output after a 7×7 convolution.
[0059] Step 302: Set the three corresponding weight parameters for each scale convolution branch, and normalize them using the Softmax function to obtain the normalized weights. , .
[0060] Since features at different scales have different emphases in terms of expressive power, using a fixed fusion method can easily limit the network's adaptability. Therefore, this invention adaptively weights multi-scale features using learnable weight parameters to dynamically adjust the contribution of information at different scales based on the input content. Let the weight parameters corresponding to each scale convolutional branch be... The weight parameters are normalized using the Softmax function to obtain the normalized weights. That is, the sum of the normalized weights corresponding to each scale convolution is 1.
[0061] Step 303: Perform weighted aggregation of the normalized weights and the corresponding spatial feature maps to obtain scale features.
[0062] In one embodiment, the expression for the scale feature obtained by weighted aggregation is as follows: ; in, Indicates scale characteristics. (·) represents a 1×1 convolution. The normalized weights corresponding to the i-th scale convolution This represents the spatial feature map corresponding to the i-th scale convolution.
[0063] Step 304: Combine large kernel perception and small kernel aggregation convolutional operations to process scale features, thereby enhancing the network's ability to jointly represent the overall structure of the tampered path and local anomalies, and obtain joint features. .
[0064] After completing the multi-scale weighted aggregation described above, the scale features are further enhanced by combining convolutional operations with large kernel perception and small kernel aggregation. This step introduces large-scale structural modeling and local adaptive aggregation capabilities on the basis of multi-scale information, thereby strengthening the network's ability to jointly represent the overall structure of the tampered path and local anomalies. The corresponding expression is as follows: ; in, Indicates joint features, This represents a convolution operation that combines large kernel perception and small kernel aggregation. Indicates scale characteristics.
[0065] In one embodiment, the present invention uses the LSConv module to perform a convolutional operation combining large kernel perception and small kernel aggregation to efficiently capture visual information. For example... Figure 7 The diagram shown is the architecture of the LSConv module. The LSConv module includes Large Kernel Perception (LKP) and Small Kernel Aggregation (SKA). In the LKP stage, the number of channels for scale features is increased from 1×1 through 1×1 convolution. Compress to To reduce subsequent computational overhead, a large-kernel depthwise separable convolution is then used to expand the receptive field, thereby capturing a wide range of spatial context information and long-range dependencies. Finally, a set of spatially adaptive dynamic convolution weights is generated through 1×1 convolutions. It is used to characterize local structural features at different spatial locations.
[0066] In the SKA stage, to achieve lightweight design, this invention uses a grouped weight sharing mechanism to split the dynamic convolution weights into groups, so that each Each channel shares a set of sizes. The groups share dynamic weights, where G is the total number of groups. This design, while preserving the content's adaptive properties, compresses the number of parameters to the level of traditional dynamic convolution. Finally, scale features and grouped shared dynamic weights are input into a location-dependent dynamic convolution to perform operations, achieving fine-grained feature aggregation and enhancement within a local range, resulting in joint features. .
[0067] This method utilizes dynamically generated convolutional weights from the LKP stage to perform position-dependent dynamic convolution operations on scale features, thereby achieving fine-grained feature aggregation and enhancement within a local scope. By combining the large-scale modeling of LKP with the local adaptive aggregation of SKA, it can simultaneously capture long-distance dependencies and fine-grained structural information with lower computational overhead, providing more comprehensive support for subsequent feature representation. In one implementation, , and Set them to 7, 3, and 8 respectively.
[0068] Step 305: Combine the joint features using 1×1 convolution. Channel reorganization and mapping are performed, and the features output by the feature extraction unit in the encoder are obtained through residual connection.
[0069] To further integrate feature information and stabilize the network training process, this invention introduces a 1×1 convolution at the end of the MSDABlock module for channel recombination and mapping, and then concatenates the mapped result with the initial input of MSDABlock through residuals to obtain the output features. The introduction of residual paths not only alleviates the vanishing gradient problem in deep network training but also preserves original feature information, achieving effective fusion of old and new features. The expression corresponding to step 305 is as follows: ; in, Indicates output features, Indicates joint features, (·) represents a 1×1 convolution, where f is the input of a feature extraction unit.
[0070] In summary, MSDABlock achieves joint modeling from local texture details to continuous geometric structures through the synergistic effect of multi-scale convolutional modeling and the LSConv structure. While ensuring computational efficiency, it effectively improves the network's ability to perceive and locate continuous structural perturbations in SeamCarving modifications.
[0071] like Figure 8 As shown, the processing procedure of the LSConv module specifically includes the following steps: Step 401: Reduce the number of channels for the scale feature from 1×1 convolution. Compress to Furthermore, it employs large-kernel depth separable convolution to expand the receptive field, thereby capturing a wide range of spatial context information and long-distance dependencies to obtain intermediate features.
[0072] Step 402: Process the intermediate features using 1×1 convolutions to generate a set of spatially adaptive dynamic convolution weights. .
[0073] Step 403: Group and split the dynamic convolution weights so that each Each channel shares a set of sizes. The groups share dynamic weights, where G is the total number of groups.
[0074] Step 404: Perform a dynamic convolution operation on the scale features and grouped shared dynamic weights, which are input to the location-related components, to achieve fine-grained feature aggregation and enhancement within a local range, thus obtaining joint features. .
[0075] The lightweight image seam cropping and tampering localization method also includes decoding deep features, such as... Figure 1 As shown, the decoder includes multi-layered cascaded feature extraction units (MSDABlock) and feature fusion units (ADFM) that fuse upsampled features and skip connection features. The total number of feature extraction units in the decoder and encoder is the same, but the total number of ADFM units is one less than the total number of feature extraction units. The processing steps include: upsampling deep features through multiple layers to obtain upsampled features; obtaining the features output by the encoder's feature extraction units as skip connection features; except for the deepest layer which directly enters the corresponding feature extraction unit of the encoder, each of the other layers, after upsampling, first adaptively fuses the upsampled features with the skip connection features of the corresponding resolution using ADFM, and then sends the fused features to the current layer's feature extraction unit. This process is repeated level by level to decode upwards, ultimately recovering the high-resolution discriminative features. The deepest layer refers to the first level of the decoder (…). Figure 1 The floor immediately adjacent to Bottleneck.
[0076] like Figure 9 As shown, the processing procedure of a feature extraction unit in the decoder specifically includes the following steps: Step 501: Upsample the features using a 1×1 convolution. Features of skip connections Channel alignment is performed to obtain a feature representation with a unified dimension. and feature representation .
[0077] Among them, upsampling features Features of skip connections They are at the same resolution. Upsampled features are obtained by upsampling deep features. Skip connection features are obtained by downsampling after processing by the feature extraction unit in the encoder. This step reduces channel redundancy while improving the upsampled features. Features of skip connections Being in the same feature space facilitates subsequent fusion.
[0078] In one embodiment, the expression corresponding to step 501 is as follows: ; in, This represents the feature representation corresponding to the upsampled feature. This represents the feature representation corresponding to the skip connection feature. Indicates upsampling features, This indicates a skip connection feature. (·) represents a 1×1 convolution.
[0079] Step 502: Construct feature representations through element-wise multiplication and feature representation The response coupling relationship between the features is analyzed, and the interaction features are locally modeled using convolution to obtain the enhanced interaction features. .
[0080] Relying solely on independent features is insufficient to fully characterize the correlation between two features. This invention further introduces an interaction enhancement mechanism, constructing response coupling relationships between features through element-wise multiplication. This operation highlights regions where both types of features are spatially co-activated, thereby strengthening the response at potential tampering locations. Furthermore, convolution is used to locally model the interactive features, resulting in enhanced interactive features:
[0081] in, This represents the enhanced interaction features. Represents element-wise multiplication. This represents the feature representation corresponding to the upsampled feature. This represents the feature representation corresponding to the skip connection feature. (·) represents a 3×3 convolution.
[0082] After the above processing, not only can the consistent response region be highlighted, but relevant information can also be further aggregated in the local neighborhood, thereby improving the ability to characterize structural anomalies.
[0083] Step 503: Represent the features Feature representation and interaction features The fusion process is performed to construct a global context representation. Channel-level statistics are extracted through global average pooling, and the fusion weight W is obtained after passing through two lightweight networks and normalization.
[0084] In obtaining feature representation Feature representation and interaction features After representing the three types of features, if a fixed weight is used for fusion, it is difficult to adapt to changes in tampering patterns in different images. Therefore, this invention introduces a dynamic weight generation mechanism, which first aggregates the three types of features (feature representations) Feature representation and interaction features Furthermore, a unified weight generation method is used to ensure that the generated weights can simultaneously perceive the global context information of the three types of features without increasing the channel dimension, achieving adaptive weight allocation based on the overall information of the three paths. In addition, this invention uses softmax for normalization, which constrains the sum of all channel weights to 1, establishing a competitive relationship between channels and preventing a single branch from dominating the fusion result. Further, this competitive mechanism assigns relatively lower weights to channels with more redundant information after three-path fusion and higher weights to channels carrying complementary information across branches. This allows the feature contribution of each channel to be redistributed based on the global context after three-path fusion, weakening the dominant role of the dominant feature in the fusion result, balancing the proportion of effective information from different branches in the fused features, and improving feature representation ability and model inference accuracy.
[0085] Specifically, feature representation Feature representation and interaction features The system performs fusion, constructs a global context representation, extracts channel-level statistics through global average pooling, and then generates fusion weights using a two-layer lightweight fully connected network. ; ; in, This is a set of fusion weights, including three types of feature representations and their corresponding fusion weights. This represents the fusion weights corresponding to the upsampled features. This represents the fusion weights corresponding to the skip connection features. This represents the fusion weights corresponding to the interactive features. It is a global average pooling operation. It is a fully connected network consisting of two 1×1 convolutional layers. This represents the enhanced interaction features. This represents the feature representation corresponding to the upsampled feature. This represents the feature representation corresponding to the skip connection feature, and Softmax represents the normalization process.
[0086] Step 504: Represent the features by fusing weights W Feature representation and interaction features After weighted fusion, further local refinement is performed through 3×3 convolution to obtain the final features output by the feature extraction unit in the decoder.
[0087] In one embodiment, feature representations are fused using weights. Feature representation and interaction features After weighted fusion, further local refinement is performed using 3×3 convolution to obtain the final features output by the feature extraction unit in the decoder, whose corresponding expression is: ; in, This represents the final features output by the feature extraction unit. This represents the enhanced interaction features. This represents the feature representation corresponding to the upsampled feature. This represents the feature representation corresponding to the skip connection feature. This represents the fusion weights corresponding to the upsampled features. This represents the fusion weights corresponding to the skip connection features. This represents the fusion weights corresponding to the interactive features. (·) represents a 3×3 convolution.
[0088] In summary, the ADFM module achieves efficient integration of multi-source features by explicitly modeling the interaction relationships between features and the competitive weight allocation mechanism, thereby significantly improving the network's response consistency and localization integrity to weakly tampered regions.
[0089] To verify the effectiveness of the lightweight Seam Carving tamper-proof localization network proposed in this invention, a comparative experiment was designed between existing models and tamper-proof localization networks. The existing models include RRUNet, PSCCNet, EITLNet, HDFNet, AFGCL, MUN, and EfficientNetB7-Unet, and F1, MCC, and AUC were uniformly used as evaluation metrics.
[0090] Table 1 presents the quantitative results of each method in the Seam Removing and Seam Inserting tasks at a 10% tampering rate. Experimental results show that the lightweight tamper localization network proposed in this invention still significantly outperforms other comparative methods in all evaluation metrics, demonstrating strong detection capability and good generalization performance. In summary, with a significant reduction in parameter count and computational complexity, the lightweight tamper localization network proposed in this invention achieves an effective improvement in model efficiency at the cost of minimal performance loss, demonstrating a high performance-complexity trade-off advantage. This indicates that by optimizing the structure for Seam Carving tampering features, the lightweight nature of the model can be significantly improved while maintaining detection performance, making it more suitable for practical deployment in resource-constrained environments.
[0091] Table 1. Positioning performance of different networks
[0092] Figure 10 The comparison network localization results in the Seam Removing scenario show that, apart from EffB7-UNet (Scratch) and the network of this invention, other networks exhibit significant false negatives and false positives, making it difficult to accurately detect tampered regions. However, further comparison reveals that EffB7-UNet (Scratch) still has shortcomings in detail representation; its prediction results are slightly lacking in boundary integrity and region continuity. In contrast, the network of this invention can generate more coherent and consistent masks, demonstrating greater stability in structural representation.
[0093] Figure 11 The comparison images show the localization results of the networks in the Seam Inserting scenario. Similar to the Seam Removing scenario, both EffB7-UNet (Scratch) and the network of this invention demonstrate strong localization capabilities. Overall, the results of each method show minimal differences, but subtle differences remain at the level of detail. For example, EffB7-UNet (Scratch) is slightly inferior in terms of boundary localization accuracy and region integrity, while the network of this invention shows more stable performance in terms of structural continuity and boundary clarity of the tampered region.
[0094] In summary, compared with other existing methods, the lightweight network proposed in this invention significantly reduces the number of model parameters and computational complexity while maintaining high positioning accuracy. It achieves a good balance between performance and efficiency, demonstrates stronger practical deployment potential, and fully verifies its effectiveness and practicality in the Seam Carving image tampering localization task.
[0095] To evaluate the contribution of each module proposed in this invention to the overall performance, the applicant conducted ablation studies on the introduction of the multi-scale dynamic aggregation block (MSDABlock), the noise-guided feature preprocessing module (NGFP), and the adaptive dynamic fusion module (ADFM). The experimental results are shown in Table 2.
[0096] Table 2 Ablation Experiment
[0097] When using only MSDABlock, the network's F1 scores are 0.7582 and 0.9071, respectively. This indicates that MSDABlock, through multi-scale feature modeling and dynamic aggregation mechanisms, possesses strong feature representation capabilities and can effectively capture a certain degree of tampering structural information. Introducing the NGFP module on top of MSDABlock improves the F1 scores to 0.7879 and 0.9301. Preprocessing the input features using noise features helps highlight high-frequency abnormal responses in potentially tampered regions, thus providing a more discriminative input representation for subsequent feature extraction. When the ADFM module is introduced on top of MSDABlock, the F1 scores improve to 0.7840 and 0.9289. This result shows that adaptive fusion of upsampled features and skip connection features can alleviate semantic differences and information conflicts between features at different levels to some extent, thereby improving feature utilization efficiency and network performance. Finally, when MSDABlock, NGFP, and ADFM modules are combined to form the network of this invention, the F1 performance improves to 0.8281 and 0.9395. The significant performance improvement reveals that NGFP and ADFM effectively complement each other in terms of feature enhancement and cross-layer fusion, working synergistically with MSDABlock's feature extraction capabilities to significantly improve the network's overall representation ability and localization accuracy for Seam Carving tampered regions. NGFP enhances the response of tampered regions through input-level noise gating, while ADFM uses dynamic weights to alleviate cross-layer feature conflicts. Together with MSDABlock's multi-scale large-kernel perception, they enhance the model's ability to discriminate weak structural perturbations.
[0098] To further understand the enhanced role of each module, this invention visualizes the results of the Seam Removing task in Table 2, as shown below. Figure 12As shown, it can be observed that with the gradual addition of modules, the predicted mask results are more similar to the actual mask image. To improve recognizability, yellow boxes were added to mark some discrepancies, and a pixel difference map (false detection map) between the predicted results and the actual annotations was introduced. From the spatial distribution of false detection pixels, the erroneous predictions are mainly concentrated at the edges of the tampered areas, and the false detection areas shrink significantly with the gradual introduction of each module, which reflects the continuous improvement of the network's ability to characterize boundaries. In addition, to reduce the bias caused by subjective visual analysis, this invention further statistically analyzed the number of false detection pixels for different networks. The statistical results show that with the continuous optimization of the network structure, the number of false detection pixels generally shows a downward trend, quantitatively verifying the effectiveness of the proposed module in improving positioning accuracy.
[0099] In summary, this invention addresses the problems of large model parameters, high computational complexity, and difficulty in meeting practical deployment requirements in the Seam Carving image tampering localization task. It proposes a lightweight image tampering localization network. By introducing a noise-guided feature preprocessing module, a multi-scale dynamic aggregation block, and an adaptive dynamic fusion module, the network's representational capabilities are improved from three levels: input enhancement, feature extraction, and cross-layer fusion. Experiments show that the proposed lightweight image tampering localization network reduces the number of parameters and computational complexity by approximately 91.8% and 83.1%, respectively. While significantly reducing the network size, it still maintains high-precision localization capabilities for tampered areas, verifying the effectiveness of the lightweight structural design.
[0100] Example 2: Based on the lightweight image seam cropping and tampering location method provided in the foregoing embodiments, the present invention also provides a lightweight image seam cropping and tampering location device that can be used to implement the above method, such as... Figure 13 The diagram shown is a schematic representation of the device architecture according to an embodiment of the present invention. The lightweight image seam cropping and tampering location device of this embodiment includes one or more processors 21 and a memory 22. Wherein, Figure 13 Take a processor 21 as an example.
[0101] Processor 21 and memory 22 can be connected via a bus or other means. Figure 13 Taking the example of a connection between China and Israel via a bus.
[0102] The memory 22 serves as a non-volatile computer-readable storage medium for a lightweight image seam cropping and tampering location method. It can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the lightweight image seam cropping and tampering location method in the foregoing embodiments. The processor 21 executes various functional applications and data processing of the lightweight image seam cropping and tampering location device by running the non-volatile software programs, instructions, and modules stored in the memory 22, thereby implementing the lightweight image seam cropping and tampering location method of the foregoing embodiments.
[0103] Memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may include memory remotely located relative to processor 21, which can be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0104] The program instructions / modules are stored in memory 22 and, when executed by one or more processors 21, perform the lightweight image seam clipping and tampering positioning method described in the foregoing embodiments.
[0105] This invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors, for example... Figure 13 One of the processors 21 enables the one or more processors to execute the lightweight image seam cropping and tampering location method in the foregoing embodiments.
[0106] It is worth noting that the information interaction and execution process between the modules and units in the above-mentioned device and system are based on the same concept as the processing method embodiment of the present invention. For details, please refer to the description in the method embodiment of the present invention, and will not be repeated here.
[0107] Those skilled in the art will understand that all or part of the steps in the various methods of the embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0108] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A lightweight image seam trimming and tampering positioning method, characterized in that, include: The tampered image to be detected As input, high-frequency residual information of the tampered image is extracted by integrating SRM filters in the horizontal, vertical and diagonal directions, and a spatial gated modulation mechanism is introduced to enhance the RGB features of the tampered image at the pixel level to obtain the initial features for texture enhancement. During the encoding stage, multi-scale convolution and LS convolution are used to extract the spatial features of the initial features in different receptive fields, thereby obtaining continuous structural features that characterize the seam cutting and alteration. The continuous structural features are continuously downsampled and then refined into deep features to obtain the refined deep features. In the decoding stage, deep features are used as input. During the process of upsampling and restoring resolution step by step, the correlation between the upsampled features and the skip connection features of the corresponding level in the encoding stage is modeled. A competitive gating mechanism is used to adaptively allocate fusion weights to achieve selective enhancement and suppression of features, thereby obtaining high-resolution discriminative features. After pixel-by-pixel classification mapping, the discriminative features are output as a binary prediction mask. To determine the area that was tampered with.
2. The lightweight image seam cropping and tampering positioning method according to claim 1, characterized in that, The method further includes: Image manipulation The signals are fed into the RGB branch and the noise extraction branch in parallel. In the RGB branch, the basic spatial features of the tampered image are extracted through 3×3 convolution, and the number of channels is expanded through 1×1 convolution. Then, local modeling is performed by combining depthwise convolution, and the image is divided along the channel dimension to obtain the first sub-feature. Second sub-feature ; In the noise extraction branch, SRM filters are used to extract high-frequency residual information from the tampered image. Convolution operations are then used to map this high-frequency residual information to a channel space consistent with RGB features. Dilated convolutions with different receptive fields are introduced in parallel to extract local and extended neighborhood information. These two are then fused along the channel dimension to obtain the enhanced noise features. ; Utilizing enhanced noise characteristics For the first sub-feature Fusion is performed to generate spatial adaptive gating. ; Space adaptive gating is achieved through element-wise multiplication. Acting on the second sub-feature Thus, the initial features are obtained.
3. The lightweight image seam trimming and tampering positioning method according to claim 1, characterized in that, The encoder includes multi-layered cascaded feature extraction units, and the method further includes: The output features of the (i-1)th layer feature extraction unit As the input to the i-th layer feature extraction unit, the output features are obtained after processing by the i-th layer feature extraction unit. , where i=1,2,…,N, the initial features are used as the input of the first layer feature extraction unit, and the output of the Nth layer feature extraction unit is the continuous structural features.
4. The lightweight image seam trimming and tampering positioning method according to claim 3, characterized in that, The processing steps of a feature extraction unit in an encoder include: Output features The data is fed into multi-scale convolution branches for parallel modeling to capture spatial information under different receptive fields and obtain spatial feature maps output by each scale convolution branch. The multi-scale convolution branches include 3×3 convolution, 5×5 convolution and 7×7 convolution. Three weight parameters are set for each scale convolution branch, and the weights are normalized using the Softmax function to obtain normalized weights. , ; The normalized weights are weighted and aggregated with the corresponding spatial feature maps to obtain scale features; By combining large kernel perception and small kernel aggregation convolutional operations to process scale features, the network's ability to jointly represent the overall structure of the tampered path and local anomalies is enhanced, resulting in joint features. ; Joint features are achieved through 1×1 convolution. Channel reorganization and mapping are performed, and the features output by the feature extraction unit in the encoder are obtained through residual connection.
5. The lightweight image seam trimming and tampering positioning method according to claim 4, characterized in that, By combining large kernel perception and small kernel aggregation convolutional operations to process scale features, the network's ability to jointly represent the overall structure of the tampered path and local anomalies is enhanced, resulting in joint features. ,include: The number of channels for scale features is reduced from 1×1 convolution. Compress to Furthermore, it employs large-kernel depth separable convolution to expand the receptive field, thereby capturing a wide range of spatial context information and long-distance dependencies to obtain intermediate features; Intermediate features are processed through 1×1 convolutions to generate a set of spatially adaptive dynamic convolution weights. ; Group and split the dynamic convolution weights so that each Each channel shares a set of sizes. The groups share dynamic weights, where G is the total number of groups; The scale features and grouped shared dynamic weights are input into a location-dependent dynamic convolution to perform operations, thereby achieving fine-grained feature aggregation and enhancement within a local range, resulting in joint features. .
6. The lightweight image seam trimming and tampering positioning method according to claim 1, characterized in that, The decoder includes multi-layered cascaded feature extraction units and a feature fusion unit that fuses upsampled features and skip connection features. The method further includes: Deep features are upsampled through multiple upsampling steps to obtain upsampled features; the features output by the encoder feature extraction unit are used as skip connection features; except for the deepest layer which directly enters the corresponding feature extraction unit of the encoder, the upsampled features and the skip connection features of the corresponding resolution are adaptively fused by the feature fusion unit after upsampling in the other layers, and then the fused features are sent to the feature extraction unit of the current layer. This process is repeated step by step to decode upwards and finally recover the high-resolution discriminative features.
7. The lightweight image seam cropping and tampering positioning method according to claim 1, characterized in that, The decoder includes multiple cascaded feature extraction units. The processing of one feature extraction unit includes: Upsampled features using 1×1 convolution Features of skip connections Channel alignment is performed to obtain a feature representation with a unified dimension. and feature representation ; Feature representation is constructed using element-wise multiplication. and feature representation The response coupling relationship between them is determined, and the interaction features are locally modeled using convolution to obtain the enhanced interaction features. ; Feature representation Feature representation and interaction features The fusion process is performed to construct a global context representation. Channel-level statistics are extracted through global average pooling, and the fusion weight W is obtained after passing through two lightweight networks and normalization. By fusing weight W to the feature representation Feature representation and interaction features After weighted fusion, further local refinement is performed through 3×3 convolution to obtain the final features output by the feature extraction unit in the decoder.
8. The lightweight image seam trimming and tampering positioning method according to claim 7, characterized in that, The expression for the fusion weight W is as follows: ; ; in, This is a set of fusion weights, including three types of feature representations and their corresponding fusion weights. This represents the fusion weights corresponding to the upsampled features. This represents the fusion weights corresponding to the skip connection features. This represents the fusion weights corresponding to the interactive features. It is a global average pooling operation. It is a fully connected network consisting of two 1×1 convolutional layers. This represents the enhanced interaction features. This represents the feature representation corresponding to the upsampled feature. This represents the feature representation corresponding to the skip connection feature, and Softmax represents the normalization process.
9. A lightweight image seam cutting and tampering positioning device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing the lightweight image seam cropping and tampering positioning method as described in any one of claims 1-8.
10. A non-volatile computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions, which are executed by one or more processors to perform the lightweight image seam cropping and tampering positioning method as described in any one of claims 1-8.
