A cross-model AIGC image detection method and device based on space-spectrum fusion
By extracting image features through spatial-spectral fusion and using a learnable frequency attention module to adaptively adjust the mask mechanism, the problems of generalization ability and anti-interference robustness in cross-model detection are solved, achieving efficient image detection results.
Patent Information
- Application Number
- CN202611168983.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-11-20
AI Technical Summary
Existing generative image detection methods have poor generalization ability when detecting across models, cannot adapt to the changes in spectral artifact distribution of different generative models, and have weak anti-interference robustness, making them unable to effectively identify post-processed images.
A cross-model AIGC image detection method based on spatial-spectral fusion is adopted. It extracts texture-rich and texture-sparse features through semantic fragmentation and physical reconstruction, and uses the learnable frequency attention module LFA to adaptively adjust the mask mechanism. Combined with spectral energy aggregation, feature fusion and discrimination are achieved.
It significantly improves the accuracy and robustness of cross-model detection, can adapt to the spectral artifact distribution of different generative models, maintains high detection performance when facing post-processing, and the lightweight model is suitable for deployment on resource-constrained devices.
Smart Images

Figure CN123142008A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision and digital image forensics, and in particular to a cross-model AIGC image detection method and apparatus based on spatial-spectrum fusion, which is applied to the detection of generative artificial intelligence (AIGC) synthesized images. Background Technology
[0002] With the rapid development of generative artificial intelligence (AIGC), deep generative algorithms, represented by generative adversarial networks (GANs) and diffusion models, have made groundbreaking progress. Especially after 2020, diffusion models, due to their training stability and high-fidelity output, have gradually replaced GANs as the mainstream image generation paradigm. The images generated by these models have achieved extremely high visual realism in terms of texture details, lighting effects, and semantic logic, making them difficult for the human eye to distinguish.
[0003] However, the widespread adoption of generative AI technology has significantly lowered the barrier to creating fake content, leading to a proliferation of fake news, fabricated evidence, and fraudulent information online, seriously threatening information security and social trust. Therefore, developing an AI-generated image detection method that can effectively identify synthetic images and has strong generalization capabilities across different generation mechanisms has become an urgent need in the fields of computer vision and cybersecurity.
[0004] Existing generative image detection methods can be mainly divided into four core paradigms: spatial domain learning methods, frequency domain analysis methods, physical or reconstruction consistency methods, and noise residual extraction methods. Among them, frequency domain analysis methods typically use fixed high-pass or band-pass filters to process the DCT / FFT spectrum in an attempt to separate the high-frequency fingerprints left by the generative model; spatial domain learning methods typically utilize deep CNN models trained with strong data augmentation (such as blurring and compression) to enable the network to learn universal artifacts in the pixel domain.
[0005] The disadvantages of existing technology are: Disadvantage 1: Poor Cross-Model Generalization. Existing spatial domain-based methods (such as existing techniques) are prone to overfitting, meaning the model relies excessively on the fingerprint features of the specific generator used in the training set (such as ProGAN). When the image to be detected comes from an unknown model with a completely different architecture (e.g., from a GAN architecture to a Diffusion architecture, or a novel Transformer architecture), the detection accuracy of existing methods drops significantly due to the change in the underlying generation logic, failing to meet the practical needs of cross-model detection.
[0006] Disadvantage 2: Rigid Frequency Analysis (RFA) Existing frequency domain-based methods (such as Existing Technology 2) primarily rely on pre-set, fixed filters to extract features. However, different generative models (such as StyleGAN and Diffusion Model) often leave spectral artifacts distributed across different frequency bands (some in high frequencies, some in mid frequencies) due to variations in network layers and upsampling operators. Fixed filters cannot dynamically adjust the region of interest based on the input image, easily overlooking crucial frequency domain artifacts and leading to missed detections.
[0007] Disadvantage 3: Limited Feature Modality and Weak Robustness Against Interference. Most existing technologies rely solely on spatial or frequency features for discrimination, lacking a deep interaction between the two. In practical applications, images often undergo post-processing such as compression, scaling, or transmission to social media platforms. For example, JPEG compression destroys high-frequency features, and scaling destroys spatial texture. Existing methods fail to establish a complementary mechanism between spatial and spectral features, leading to a significant decrease in detection performance when facing such post-processing attacks. Summary of the Invention
[0008] The purpose of this invention is to address at least one of the shortcomings of existing deep-sea cage feed quantity assessment technologies, namely, difficulty in monitoring fish body parameters, insufficient integration of multiple factors, and strong reliance on experience, by providing a cross-model AIGC image detection method and device based on spatial-spectrum fusion.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: Specifically, a cross-model AIGC image detection method based on spatial-spectral fusion is proposed, including the following: Acquire the target AIGC image; A spatial domain preprocessing procedure of semantic fragmentation and physical reconstruction is performed on the target AIGC image to obtain semantically independent texture-rich features and texture-sparse features; Enhanced texture-rich features and texture-sparse features are obtained by processing the texture-rich features and texture-sparse features through a learnable frequency attention module (LFA) and a physically initialized adaptive masking mechanism. The enhanced texture-rich features and texture-sparse features are concatenated along the channel dimension to obtain fused features, and the final prediction score for the target AIGC image is output based on the fused features.
[0010] Furthermore, specifically, the process of obtaining semantically independent texture-rich features and texture-sparse features includes, The target AIGC image is randomly cropped without overlap to obtain N image blocks of size M×M; Calculate the texture complexity of each of the image patches; Based on the texture complexity, image blocks that meet the preset high complexity conditions are selected and reconstructed to obtain a texture-rich view, and image blocks that meet the preset low complexity conditions are reconstructed to obtain a texture-sparse view. The texture-rich view and texture-sparse view are respectively input into the spatial rich model (SRM) layer for processing to obtain semantically independent texture-rich features and texture-sparse features. The SRM layer includes 30 preset fixed high-pass filters, which directly map the RGB input to a 90-channel high-dimensional residual feature space. Subsequently, the features are projected onto a 32-dimensional compact feature space by a lightweight convolutional encoder, which consists of a convolutional layer (Conv), a batch normalization layer (BN), and an activation function (ReLU).
[0011] Furthermore, specifically, a four-directional pixel difference metric is used. As a measure of texture complexity, its calculation formula is as follows: ; in, Let these represent the first-order difference operators for the horizontal, vertical, diagonal, and antidiagonal directions, respectively. Indicates the first Texture intensity value of each patch Indicates the c-th channel. The patch in the 1st line, number The column's pixel values, where c is the channel name, each taking a value of... ; Then select Value ranked first The image blocks are reconstructed to obtain a textured view, and then selected... After ranking The image blocks are reconstructed to obtain a textured sparse view. This is the preset selection ratio.
[0012] Furthermore, specifically, the operation of the Learnable Frequency Attention Module (LFA) includes: The first step is to enrich the texture features of the input. and sparse texture features A two-dimensional fast Fourier transform is performed, and the DC component is shifted to the center of the spectrum using the FFTShift operation to obtain a centered complex spectrum. and ; The second step is to initialize the high-frequency preference mask using a bi-branch learnable mask mechanism based on Euclidean distance initialization. and low-frequency preference mask ,in, and All parameters are fully learnable. During training, the network adaptively adjusts the mask distribution according to a preset loss function and uses a sigmoid activation function. and Perform soft-weighted filtering: ; in, Use the Sigmoid activation function; The bi-branch learnable mask mechanism based on Euclidean distance initialization is as follows: First, define the normalized Euclidean distance matrix. , representing any coordinate in the spectrum Distance to the center; ; in, It is the maximum Euclidean distance from the center to the corner point. These are the height and width of the spectrum, respectively. Next, based on Initialize the high-frequency preference mask separately and low-frequency preference mask : as well as ; Where α is an empirical factor, and the Euclidean distance matrix is... , representing any coordinate in the spectrum Distance to the center; The third step involves calculating enhanced texture-rich features based on a grouping energy aggregation strategy. With sparse texture features , The grouped energy aggregation strategy includes, Divide the feature channel C into G subgroups. For the g-th subgroup, calculate the global spectral energy amplitude after masking. : ; but , ; in, This represents broadcast multiplication at the channel dimension. and It is a learnable frequency-sensitive weight matrix. and They are respectively and pass The value obtained by the calculation formula.
[0013] Furthermore, specifically, set the value of G to 8.
[0014] Furthermore, specifically, the final predicted score for the target AIGC image is output based on the fused features, including: The fused features are processed alternately by multiple layers of 3x3 ConvBlock convolutional blocks and AvgPool average pooling, and finally output as a prediction score through GlobalAvgPool global adaptive average pooling, Flatten layer, and FC fully connected layer.
[0015] This invention also proposes a cross-model AIGC image detection device based on spatial-spectral fusion, which applies the steps of the method and includes the following: The data acquisition module is used to acquire the target AIGC image; The feature extraction module is used to perform a spatial domain preprocessing process of semantic fragmentation and physical reconstruction on the target AIGC image to obtain semantically independent texture-rich features and texture-sparse features; The feature enhancement module is used to process the texture-rich features and texture-sparse features through a learnable frequency attention module (LFA) using a physically initialized adaptive masking mechanism to obtain enhanced texture-rich features and texture-sparse features. The cascaded discriminant module (CDM) is used to concatenate the enhanced texture-rich features and texture-sparse features along the channel dimension to obtain fused features, and output the final prediction score for the target AIGC image based on the fused features.
[0016] The beneficial effects of this invention are as follows: This invention proposes a cross-model AIGC image detection method and apparatus based on spatial-spectral fusion. On one hand, it proposes a dual-stream network architecture, S2F-Net, based on spatial-spectral fusion. S2F-Net includes two parallel processing branches: one for rich texture and one for sparse texture, extracting high-frequency details and the other for low-frequency anomalies, respectively. These are then jointly discriminated through a fusion module. Compared to single-modality detection, this dual-stream fusion mechanism can compensate for post-processing issues such as image compression or blurring by utilizing information from the other modality, significantly improving robustness. On the other hand, it proposes a learnable frequency attention (LFA) mechanism, using a learnable mask initialized based on Euclidean distance. During training, it adaptively adjusts the weights of specific frequency bands in the spectrum to achieve different... The adaptive capture of generator model artifacts addresses the problem of existing techniques easily overfitting to specific generator fingerprints on the training set. This invention adaptively focuses on general spectral anomalies through the LFA mechanism, thus maintaining a high detection rate when transitioning from GAN to Diffusion models. Furthermore, while existing frequency domain methods rely on manually designed fixed filters (such as high-pass filters), the mask in this invention is learnable and can automatically adapt to different artifact distribution locations in the frequency domain for different generator architectures (such as StyleGAN and StableDiffusion). In addition, this invention proposes a feature recalibration method based on grouped spectral energy aggregation, which groups spectral channels and calculates energy amplitudes, and maps frequency domain energy to spatial channel attention coefficients through a learnable weight matrix. Attached Figure Description
[0017] The above and other features of this disclosure will become more apparent from the detailed description of the embodiments illustrated in conjunction with the accompanying drawings. In the accompanying drawings, the same reference numerals denote the same or similar elements. Obviously, the drawings described below are merely some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort. In the drawings: Figure 1 The diagram shows a flowchart of a cross-model AIGC image detection method based on spatial-spectral fusion according to the present invention. Figure 2 The diagram shown is the overall architecture of the S2F-Net proposed in this invention. Figure 3 As shown Figure 2 Enlarged view of the first stage in the lower left corner; Figure 4 As shown Figure 2 Enlarged view of the lower middle section; Figure 5 As shown Figure 2 Enlarged view of the lower right section. Detailed Implementation
[0018] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The same reference numerals used throughout the accompanying drawings indicate the same or similar parts.
[0019] Example 1, referring to Figure 1 as well as Figure 2 This invention proposes a cross-model AIGC image detection method based on spatial-spectrum fusion, applied to the S2F-Net network model, including the following: Step 110: Obtain the target AIGC image; Step 120: Perform a spatial domain preprocessing procedure of semantic fragmentation and physical reconstruction on the target AIGC image to obtain semantically independent texture-rich features and texture-sparse features; Step 130: The texture-rich features and texture-sparse features are processed by the Learnable Frequency Attention Module (LFA) using a physically initialized adaptive masking mechanism to obtain enhanced texture-rich features and texture-sparse features. Step 140: Concatenate the enhanced texture-rich features and texture-sparse features along the channel dimension to obtain the fused features, and output the final prediction score for the target AIGC image based on the fused features.
[0020] In this embodiment 1, on the one hand, a dual-stream network architecture S2F-Net based on spatial-spectral fusion is proposed. S2F-Net includes two parallel processing branches: one with rich texture and the other with sparse texture, which extract high-frequency details and low-frequency anomalies respectively. These are then jointly discriminated through a fusion module. Compared to single-modality detection, the dual-stream fusion mechanism of this invention can utilize information from the other modality for compensation when the image is compressed or blurred, significantly improving robustness. On the other hand, a learnable frequency attention (LFA) mechanism is proposed. This mechanism uses a learnable mask initialized based on Euclidean distance to adaptively adjust the weights of specific frequency bands in the spectrum during training, achieving adaptive capture of artifacts from different generation models. This solves the problem that existing technologies are prone to overfitting to the specific generator fingerprint of the training set. This invention adaptively focuses on general spectral anomalies through the LFA mechanism, thus maintaining a high detection rate when transitioning from GAN to Diffusion models. Furthermore, existing frequency domain methods rely on manually designed fixed filters (such as high-pass filters), while the mask of this invention is learnable and can automatically adapt to different generation architectures (such as StyleGAN and Stable). Diffusion) refers to the different artifact distribution locations in the frequency domain; in addition, this invention also proposes a feature recalibration method based on grouped spectral energy aggregation, which groups the spectral channels and calculates the energy amplitude, and maps the frequency domain energy to spatial channel attention coefficients through a learnable weight matrix.
[0021] The lower left area in the image is Figure 3 The "Smash & Reconstruction" stage involves the input image being "randomly cropped" to obtain multiple image patches. After "calculating & ranking" to improve texture complexity, the patches are reconstructed into a set of "rich-patch reconstruction" at the top and a set of "poor-patch reconstruction" at the bottom.
[0022] The middle area in the diagram is Figure 4 It contains two parallel branches, which process the two views mentioned above respectively. Each branch first extracts spatial features (including SRM filtering, 3x3 convolutional layers and BN-ReLU layers) through SDRFM (spatial domain residual feature extraction module); then it enters the core LFA (learnable frequency attention) module.
[0023] The internal process of the LFA module is as follows: the features are transformed to the frequency domain by FFT (Fast Fourier Transform) and Shift (spectral centering); element-wise multiplication is performed with Mask_high (high-frequency preference mask) and Mask_low (low-frequency preference mask); the energy value is obtained by Spectral Sum (spectral energy aggregation); and then the spatial features are weighted and calibrated by Learnable Weight.
[0024] The lower right area in the diagram is the CDM (Cascaded Discriminant Module). Figure 5 The fused features are processed alternately by multiple layers of 3x3 ConvBlock (convolutional blocks) and AvgPool (average pooling), and finally the true / false discrimination result is output through GlobalAvgPool (global adaptive average pooling), Flatten (flattening layer) and FC (fully connected layer).
[0025] In a preferred embodiment of the present invention, specifically, the process of obtaining semantically independent texture-rich features and texture-sparse features includes, The target AIGC image is randomly cropped without overlap to obtain N image blocks of size M×M; Calculate the texture complexity of each of the image patches; Based on the texture complexity, image blocks that meet the preset high complexity conditions are selected and reconstructed to obtain a texture-rich view, and image blocks that meet the preset low complexity conditions are reconstructed to obtain a texture-sparse view. The texture-rich view and texture-sparse view are respectively input into the spatial rich model (SRM) layer for processing to obtain semantically independent texture-rich features and texture-sparse features. The SRM layer includes 30 preset fixed high-pass filters, which directly map the RGB input to a 90-channel high-dimensional residual feature space. Subsequently, the features are projected onto a 32-dimensional compact feature space by a lightweight convolutional encoder, which consists of a convolutional layer (Conv), a batch normalization layer (BN), and an activation function (ReLU).
[0026] Specifically, a four-directional pixel difference metric is used. As a measure of texture complexity, its calculation formula is as follows: ; in, Let these represent the first-order difference operators for the horizontal, vertical, diagonal, and antidiagonal directions, respectively. Indicates the first Texture intensity value of each patch Indicates the c-th channel. The patch in the 1st line, number The column's pixel values, where c is the channel name, each taking a value of... ; Then select Value ranked first The image blocks are reconstructed to obtain a textured view, and then selected... After ranking The image blocks are reconstructed to obtain a textured sparse view. This is the preset selection ratio.
[0027] In this preferred embodiment, the first stage is semantic fragmentation and physical reconstruction (spatial domain preprocessing). In order to fundamentally suppress the interference of global semantic content of the image on the detector, the present invention first adopts a "shredding and reconstruction" strategy.
[0028] 1. Random non-overlapping cropping: For the input image The system performs random non-overlapping cropping to generate... Each size is A collection of image patches Clipping start coordinates Follows a uniform distribution:
[0029] in, The starting coordinates for cropping. , They respectively follow independent uniform distributions in the legal height interval and the legal width interval; , These are the height and width of the input image, respectively. The size of a single image patch.
[0030] 2. Texture Complexity Measurement and Ranking: To physically decouple semantic content from texture statistical features, this invention calculates the texture complexity of each image patch. A four-directional pixel difference metric is used. The formula is as follows:
[0031] in, These represent the first-order difference operators for the horizontal, vertical, diagonal, and anti-diagonal directions, respectively.
[0032] 3. Dual-view reconstruction based on calculations The values are sorted in descending order for all image patches, introducing a selection ratio. To construct two views with significantly different physical texture distributions: Texture-Rich View ):Depend on The highest value This view is reconstructed from highly complex image patches, focusing on high-frequency edges and mesh artifacts in the image.
[0033] Texture-Poor View ):Depend on The lowest value Reconstructed from low-complexity image patches, this view focuses on low-frequency anomalies in a smooth background.
[0034] 4. Spatial Residual Feature Extraction To expose subtle tampering traces, the two views mentioned above are input into a Spatial Rich Model (SRM) layer. The SRM layer contains 30 fixed high-pass filters, directly mapping the RGB input to a 90-channel high-dimensional residual feature space. Subsequently, a lightweight convolutional encoder (consisting of a Convolutional layer, a Batch Normalization layer, and a ReLU activation function) projects the features into a 32-dimensional compact feature space, yielding semantically independent texture features. .
[0035] In a preferred embodiment of the present invention, the operation of the Learnable Frequency Attention Module (LFA) specifically includes: The first step is to enrich the texture features of the input. and sparse texture features A two-dimensional fast Fourier transform is performed, and the DC component is shifted to the center of the spectrum using the FFTShift operation to obtain a centered complex spectrum. and ; The second step is to initialize the high-frequency preference mask using a bi-branch learnable mask mechanism based on Euclidean distance initialization. and low-frequency preference mask ,in, and All parameters are fully learnable. During training, the network adaptively adjusts the mask distribution according to a preset loss function and uses a sigmoid activation function. and Perform soft-weighted filtering: During iterative training, the model uses global classification loss as supervision and continuously updates the spatial feature extraction parameters and frequency attention module weights through backpropagation. The network relies on a texture complexity measurement mechanism to adaptively update high- and low-frequency mask activation regions, weight magnitudes, and spatial distributions based on the differentiated spatial texture details and frequency energy distribution features of the input image. Simultaneously, it accurately constructs both texture-rich and texture-sparse views, effectively decoupling image semantic content from texture statistical features. Addressing the inherent differences between real images and images generated by GANs and diffusion models in texture details, spectral shifts, high-frequency artifacts, and low-frequency smoothing anomalies, the model uses a learnable frequency attention mechanism to focus on hidden frequency-domain forgery defects in generated images, while suppressing invalid interference noise from natural textures in real images. This allows for adaptive adaptation to diverse forgery feature distribution patterns under different generation models and complex semantic scenarios. This training mechanism frees traditional fixed-rule frequency and spatial domain detection strategies from the limitations of human prior knowledge, enabling the model to autonomously discover the differentiated forgery features between real images and AI-generated images in both the frequency and spatial domains. It accurately captures subtle and hidden forgery artifacts weakened by the new generation generation model, effectively making up for the feature extraction defects of single-domain detection models and significantly improving the model's ability to distinguish multiple types of AIGC-generated samples and its cross-scene generalization performance.
[0036] ; in, Use the Sigmoid activation function; The bi-branch learnable mask mechanism based on Euclidean distance initialization is as follows: First, define the normalized Euclidean distance matrix. , representing any coordinate in the spectrum Distance to the center; ; in, It is the maximum Euclidean distance from the center to the corner point. These are the height and width of the spectrum, respectively. Next, based on Initialize the high-frequency preference mask separately and low-frequency preference mask : as well as ; Where α is an empirical factor, and the Euclidean distance matrix is... , representing any coordinate in the spectrum Distance to the center; The third step involves calculating enhanced texture-rich features based on a grouping energy aggregation strategy. With sparse texture features , The grouped energy aggregation strategy includes, Divide the feature channel C into G subgroups. For the g-th subgroup, calculate the global spectral energy amplitude after masking. : ; but , ; in, This represents broadcast multiplication at the channel dimension. and It is a learnable frequency-sensitive weight matrix. and They are respectively and pass The value obtained by the calculation formula.
[0037] In this preferred embodiment, the second stage is an FFT-based learnable frequency attention (LFA) module. This is the core innovative module of the present invention. In order to make up for the shortcomings of pure spatial convolution in capturing long-range frequency dependence, the present invention designs a plug-and-play LFA module, which realizes dynamic weighting of key frequency bands through an adaptive masking mechanism based on physical initialization.
[0038] 1. Spectral Transformation and Centering: First, enrich the texture features of the input. and sparse texture features A two-dimensional fast Fourier transform (2D FFT) is performed, and the DC component is shifted to the center of the spectrum using the FFTShift operation to obtain a centered complex spectrum. and :
[0039] 2. Geometrically Constrained Masking: To adapt to the artifact distribution of different generation architectures, this invention designs a bi-branch learnable masking mechanism based on Euclidean distance initialization. First, a normalized Euclidean distance matrix is defined. , representing any coordinate in the spectrum Distance to the center:
[0040] in It is the maximum Euclidean distance from the center to the corner. Based on this, two types of masks are initialized respectively: High-frequency preference mask ( ): Used for texture-rich branches. Since the periodic mesh artifacts generated during upsampling in the generative model are mainly concentrated in the high-frequency band, the mask is initialized to increase with the center distance:
[0041] Low-frequency preference mask ( ): Used for sparse texture branches. Since generative models often cannot maintain consistency of low-frequency energy in smooth regions (such as color patch residue), the mask is initialized to focus on the low-frequency regions in the center:
[0042] It should be emphasized that the above mask All parameters are fully learnable. During training, the network adaptively adjusts the mask distribution according to the loss function, using a sigmoid activation function to achieve soft-weighted filtering.
[0043] 3. Group-wise Energy Aggregation & Spatial Recalibration: In order to convert high-dimensional spectral information into effective guidance signals for spatial characteristics, this invention adopts a group-wise energy aggregation strategy.
[0044] Grouping: grouping feature channels Divided into Subgroups (in a preferred embodiment of the present invention) .
[0045] Energy aggregation: For the first For each subgroup, calculate the global spectral energy amplitude after mask filtering. :
[0046] Weight Mapping and Recalibration: Introducing a Learnable Frequency-Sensitive Weight Matrix The scalar energy is mapped to channel attention coefficients, and a non-negative gain factor is generated using ReLU. Finally, the original spatial features are subjected to channel-level adaptive recalibration.
[0047]
[0048] in This represents broadcast multiplication at the channel dimension.
[0049] In a preferred embodiment of the present invention, specifically, the final predicted score for the target AIGC image is output based on the fusion features, including: The fused features are processed alternately by multiple layers of 3x3 ConvBlock convolutional blocks and AvgPool average pooling, and finally output as a prediction score through GlobalAvgPool global adaptive average pooling, Flatten layer, and FC fully connected layer.
[0050] In this preferred embodiment, the third stage is the cascaded discrimination module (CDM). Texture richness features enhanced by the LFA module and sparse texture features Concatenation is performed along the channel dimension to form a fused feature.
[0051] To extract robust decision boundaries from fused features, this invention designs a Cascaded Discriminant Module (CDM). This module employs a hierarchical convolutional neural network architecture, consisting of alternating convolutional blocks (Conv-BatchNorm-ReLU) and downsampling layers. As the number of network layers increases and the spatial dimension decreases, the model gradually abstracts global forged fingerprints from local texture anomalies. Finally, a global adaptive average pooling layer and a fully connected layer output the final predicted score (true / false probability).
[0052] Taking the detection of forged images generated by GAN and Diffusion as an example, the implementation process of the present invention will be described in detail.
[0053] 1. Network Specific Parameter Settings Input Preprocessing: The input images are uniformly resized and randomly cropped to 192 pixels. Image patches. Sort by texture complexity and select the top... Build a richly textured view, then Build a sparse texture view, and finally reconstruct the view size to be SDRFM module: The SRM layer uses 30 fixed high-pass filter kernels, and the number of output channels of the convolutional layer is set to 32. LFA module: After FFT transformation, the spectral channels are divided into... Energy aggregation is performed on each subgroup. Mask initialization parameters Set to a preset value (e.g., 1.0) and update it during training via backpropagation. The CDM module consists of four cascaded convolutional blocks with feature channels of 64, 128, 256, and 512 respectively. Each convolutional block contains convolution, batch normalization, and a ReLU activation function.
[0054] 2. Model Training Strategy Training Dataset: To verify cross-model generalization, this embodiment uses only 360,000 images generated by ProGAN as negative samples (Fake) and 360,000 real images from the LSUN dataset as positive samples (Real). No Diffusion model data is used for training. Optimizer and Hyperparameters: The Adam optimizer is used, with an initial learning rate set to... The batch size is 32, and the training lasts for 100 epochs. The loss function used is the binary cross-entropy loss.
[0055] The beneficial effects of this embodiment are: extremely high cross-model generalization accuracy: trained only on ProGAN data, this model achieves an average detection accuracy of 90.49% and an average precision (AP) of 96.27% when facing 17 generative models, including the previously unseen Stable Diffusion v1.5, ADM, and Midjourney, significantly outperforming existing technologies (such as CNNDetection's 80.20%). Excellent robustness against interference: under common JPEG compression (quality factor 95) attacks, the detection accuracy remains at 73.31% (compared to 72.01% for the existing technology PatchCraft); under Gaussian blur ($\sigma=1$) attacks, the accuracy reaches as high as 85.03%, demonstrating the stability of the spatial-spectral fusion features. Lightweight model: The S2F-Net model of this invention has only 1.20M parameters and a weight file size of only 13.85MB, which is much smaller than ResNet-50 (25.56M parameters) and CLIP-ViT (151M parameters), making it very suitable for deployment on resource-constrained terminal devices.
[0056] Furthermore, the accuracy evaluation results and average accuracy assessment results of the cross-model AIGC image detection method based on spatial-spectrum fusion network (S2F-Net) proposed in this invention and other existing mature network models when performing instance processing are shown in Tables 1 and 2. Table 1 shows the accuracy evaluation results of the cross-model AIGC image detection method based on spatial-spectrum fusion proposed in this invention and other existing mature network models when performing instance processing, and Table 2 shows the average accuracy assessment results of the cross-model AIGC image detection method based on spatial-spectrum fusion proposed in this invention and other existing mature network models when performing instance processing.
[0057] Table 1
[0058] Table 2 Based on the above examples, the cross-model AIGC image detection method proposed in this invention, based on a space-spectrum fusion network (S2F-Net), has the following significant advantages compared to existing technologies: 1. Exceptionally Strong Cross-Model Generalization Performance: Existing techniques often overfit to the fingerprints of specific generators in the training set, leading to a significant drop in accuracy when facing unseen generative architectures (especially when transitioning from GAN architectures to Diffusion model architectures). This invention effectively blocks interference from global semantic information through a "semantic fragmentation and physical reconstruction" strategy, enabling the model to capture the underlying common fingerprints across generative mechanisms. Experimental results show that, when facing a test set composed of 17 different generative models including ProGAN, Stable Diffusion, and DALL-E, this invention achieves an average detection accuracy of 90.49% and an average precision (AP) as high as 96.27%.
[0059] 2. Flexible Adaptive Frequency Feature Capture Mechanism: Unlike traditional methods that use fixed filters (such as high-pass or band-pass filters), the Learnable Frequency Attention (LFA) module designed in this invention introduces geometrically constrained initialization weight priors. This enables the network to adaptively learn and focus on the most discriminative frequency bands (e.g., high-frequency grid artifacts in GAN images or specific frequency anomalies in Diffusion images) based on the physical characteristics of the input image, thereby significantly improving the recognition accuracy for novel generative models.
[0060] 3. Deep Complementarity of Spatial and Spectral Features: Enhanced Robustness Against Interference. This invention achieves deep interaction and calibration of spatial texture features and spectral statistical features by constructing a dual-stream path and introducing frequency-energy aggregation weights. This fusion mechanism enables the model to exhibit strong robustness against common post-processing attacks such as image compression, Gaussian blur, or scaling. For example, under JPEG compression (quality factor of 95) attacks, this invention still maintains a detection accuracy of 73.31%, ensuring its practical value in complex network environments.
[0061] 4. Extremely High Parameter Efficiency and Deployment Advantages (Lightweight): While ensuring top-tier detection performance, this invention achieves an extremely lightweight structural design. The S2F-Net proposed in this invention has only 1.20M parameters, which is only about 4.7% of the commonly used benchmark model ResNet-50; the model weight file size is only 13.85MB. This low computational overhead and low memory consumption characteristic allows it to be easily deployed on resource-constrained terminal devices or for real-time large-scale network target monitoring.
[0062] Furthermore, the relevant terms mentioned in this invention are explained as follows: 1. AIGC (Artificial Intelligence Generated Content): Artificial intelligence generated content, specifically referring to synthetic images generated using artificial intelligence algorithms in this patent.
[0063] 2. GAN (Generative Adversarial Networks): A major mainstream image generation model architecture.
[0064] 3. Diffusion Models: A novel generative model architecture based on the denoising process, such as Stable Diffusion and DALL-E 2.
[0065] 4. S2F-Net (Spatial-Spectrum Fusion Network): The "spatial-spectrum fusion network" proposed in this invention is the name of the core detection model of this patent.
[0066] 5. LFA (Learnable Frequency Attention): The "learnable frequency attention" mechanism proposed in this invention is used to adaptively extract frequency domain features.
[0067] 6. SRM (Spatial Rich Model): A high-pass filter bank commonly used in steganalysis to extract image residuals.
[0068] 7. SDRFM (Spatial Domain Residual Feature Module): Spatial domain residual feature extraction module, a sub-module used in this invention to process spatial texture features.
[0069] 8. CDM (Cascaded Discriminative Module): The convolutional neural network module used for final classification in this invention.
[0070] 9. FFT (Fast Fourier Transform): A fast Fourier transform algorithm that converts a signal from the spatial domain to the frequency domain.
[0071] 10. DCT (Discrete Cosine Transform): Another commonly used frequency domain transformation method.
[0072] 11. Up-sampling: The operation in generative models that enlarges low-resolution feature maps into high-resolution images often introduces artifacts.
[0073] 12. Patch: refers to a small area (e.g., 32x32 pixels) that is cropped from the whole image.
[0074] 13. ldiv (four-way pixel difference metric): A specific metric used to measure texture complexity during the "semantic shredding and reconstruction" phase.
[0075] 14. LFS (Large File Storage): This term helps to understand how large datasets are physically stored if you are referring to how they are stored and transferred in your examples.
[0076] Example 2: This invention also proposes a cross-model AIGC image detection device based on spatial-spectrum fusion, which applies the steps of the method described above, including the following: The data acquisition module is used to acquire the target AIGC image; The feature extraction module is used to perform a spatial domain preprocessing process of semantic fragmentation and physical reconstruction on the target AIGC image to obtain semantically independent texture-rich features and texture-sparse features; The feature enhancement module is used to process the texture-rich features and texture-sparse features through a learnable frequency attention module (LFA) using a physically initialized adaptive masking mechanism to obtain enhanced texture-rich features and texture-sparse features. The cascaded discriminant module (CDM) is used to concatenate the enhanced texture-rich features and texture-sparse features along the channel dimension to obtain fused features, and output the final prediction score for the target AIGC image based on the fused features.
[0077] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0078] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or system capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0079] Although the description of the invention has been quite detailed and particularly of several described embodiments, it is not intended to limit it to any of these details or embodiments or any particular embodiment, but should be considered as providing a broad possible interpretation of the claims by referring to the appended claims and taking into account the prior art, thereby effectively covering the intended scope of the invention. Furthermore, the invention has been described above with respect to embodiments foreseeable by the inventors in order to provide a useful description, and non-substantial modifications to the invention that have not yet been foreseen may still represent equivalent modifications.
[0080] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any embodiment that achieves the technical effects of the present invention using the same means should fall within the protection scope of the present invention. Within the protection scope of the present invention, various modifications and variations can be made to the technical solutions and / or implementation methods.
Claims
1. A cross-model AIGC image detection method based on spatial-spectral fusion, characterized in that, Including the following: Acquire the target AIGC image; A spatial domain preprocessing procedure of semantic fragmentation and physical reconstruction is performed on the target AIGC image to obtain semantically independent texture-rich features and texture-sparse features; Enhanced texture-rich features and texture-sparse features are obtained by processing the texture-rich features and texture-sparse features through a learnable frequency attention module (LFA) and a physically initialized adaptive masking mechanism. The enhanced texture-rich features and texture-sparse features are concatenated along the channel dimension to obtain fused features, and the final prediction score for the target AIGC image is output based on the fused features.
2. The cross-model AIGC image detection method based on spatial-spectral fusion according to claim 1, characterized in that, Specifically, the process of obtaining semantically independent texture-rich features and texture-sparse features includes, The target AIGC image is randomly cropped without overlap to obtain N image blocks of size M×M; Calculate the texture complexity of each of the image patches; Based on the texture complexity, image blocks that meet the preset high complexity conditions are selected and reconstructed to obtain a texture-rich view, and image blocks that meet the preset low complexity conditions are reconstructed to obtain a texture-sparse view. The texture-rich view and texture-sparse view are respectively input into the spatial rich model (SRM) layer for processing to obtain semantically independent texture-rich features and texture-sparse features. The SRM layer includes 30 preset fixed high-pass filters, which directly map the RGB input to a 90-channel high-dimensional residual feature space. Subsequently, the features are projected onto a 32-dimensional compact feature space by a lightweight convolutional encoder, which consists of a convolutional layer (Conv), a batch normalization layer (BN), and an activation function (ReLU).
3. The cross-model AIGC image detection method based on spatial-spectral fusion according to claim 2, characterized in that, Specifically, a four-directional pixel difference metric is used. As a measure of texture complexity, its calculation formula is as follows: ; in, Let these represent the first-order difference operators for the horizontal, vertical, diagonal, and antidiagonal directions, respectively. Indicates the first Texture intensity value of each patch Indicates the c-th channel. The patch in the 1st line, number The column's pixel values, where c is the channel name, each taking a value of... ; Then select Value ranked first The image blocks are reconstructed to obtain a textured view, and then selected... After ranking The image blocks are reconstructed to obtain a textured sparse view. This is the preset selection ratio.
4. The cross-model AIGC image detection method based on spatial-spectral fusion according to claim 1, characterized in that, Specifically, the operation of the Learnable Frequency Attention Module (LFA) includes: The first step is to enrich the texture features of the input. and sparse texture features A two-dimensional fast Fourier transform is performed, and the DC component is shifted to the center of the spectrum using the FFTShift operation to obtain a centered complex spectrum. and ; The second step is to initialize the high-frequency preference mask using a two-branch learnable mask mechanism based on Euclidean distance initialization. and low-frequency preference mask ,in, and All parameters are fully learnable. During training, the network adaptively adjusts the mask distribution according to a preset loss function and uses a sigmoid activation function. and Perform soft-weighted filtering: ; in, Use the Sigmoid activation function; The bi-branch learnable mask mechanism based on Euclidean distance initialization is as follows: First, define the normalized Euclidean distance matrix. , representing any coordinate in the spectrum Distance to the center; ; in, It is the maximum Euclidean distance from the center to the corner point. These are the height and width of the spectrum, respectively. Next, based on Initialize the high-frequency preference mask separately and low-frequency preference mask : as well as ; Where α is an empirical factor, and the Euclidean distance matrix is... , representing any coordinate in the spectrum Distance to the center; The third step involves calculating enhanced texture-rich features based on a grouping energy aggregation strategy. With sparse texture features , The grouped energy aggregation strategy includes, Divide the feature channel C into G subgroups. For the g-th subgroup, calculate the global spectral energy amplitude after masking. : ; but , ; in, This represents broadcast multiplication at the channel dimension. and It is a learnable frequency-sensitive weight matrix. and They are respectively and pass The value obtained by the calculation formula.
5. The cross-model AIGC image detection method based on spatial-spectral fusion according to claim 4, characterized in that, Specifically, set the value of G to 8.
6. The cross-model AIGC image detection method based on spatial-spectral fusion according to claim 4, characterized in that, Specifically, based on the fusion features, the final predicted score for the target AIGC image is output, including: The fused features are processed alternately by multiple layers of 3x3 ConvBlock convolutional blocks and AvgPool average pooling, and finally output as a prediction score through GlobalAvgPool global adaptive average pooling, Flatten layer, and FC fully connected layer.
7. A cross-model AIGC image detection device based on spatial-spectral fusion, characterized in that, The steps of applying the method according to any one of claims 1-6 include the following: The data acquisition module is used to acquire the target AIGC image; The feature extraction module is used to perform a spatial domain preprocessing process of semantic fragmentation and physical reconstruction on the target AIGC image to obtain semantically independent texture-rich features and texture-sparse features. The feature enhancement module is used to process the texture-rich features and texture-sparse features through a learnable frequency attention module (LFA) using a physically initialized adaptive masking mechanism to obtain enhanced texture-rich features and texture-sparse features. The cascaded discriminant module (CDM) is used to concatenate the enhanced texture-rich features and texture-sparse features along the channel dimension to obtain fused features, and output the final prediction score for the target AIGC image based on the fused features.
