AI-generated image detection method based on multi-agent collaboration

By employing a multi-agent collaborative AI-generated image detection method, which combines lightweight visual and non-visual feature extraction with large-model adversarial reasoning, the problems of detection accuracy and interpretability in existing technologies are solved, achieving efficient and reliable image detection results.

CN121033632BActive Publication Date: 2026-02-13QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511568432.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-13
Estimated Expiration
2045-10-30

AI Technical Summary

Technical Problem

Existing AI-generated image detection technologies are insufficient in terms of accuracy, reliability, and generalization, making it difficult to meet the needs of practical applications. In particular, when faced with high-resolution images and new generation tools, traditional methods have poor adaptability, single-model feature capture is one-sided, and the detection results lack interpretability.

Method used

A multi-agent collaborative approach is adopted. After preprocessing the original image, feature selection is performed to extract lightweight visual and non-visual features. Combined with a large model, adversarial reasoning and result calibration are carried out to output a structured detection report, which is then presented in an interpretable way through a visual interactive interface.

Benefits of technology

It improves the accuracy, reliability, and generalization of AI-generated image detection, meets the needs of practical applications, and provides interpretable detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033632B_ABST
    Figure CN121033632B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and in particular provides an AI generated image detection method based on multi-agent cooperation. The method comprises the following steps: performing feature screening on a preprocessed original image to obtain an image feature set; extracting lightweight visual features according to the image feature set to obtain a comprehensive visual feature vector set; supplementing non-visual features according to the original image and the preprocessed image to obtain an enhanced comprehensive feature vector; performing adversarial reasoning on a large model and calibrating a result through the comprehensive visual feature vector set and the enhanced comprehensive feature vector to determine a judgment result; and outputting a structured detection report based on the judgment result and visualizing the structured detection report through a visual interactive interface. The method improves the accuracy, reliability and generalization of detection and meets actual application requirements.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to an AI generated image detection method based on multi-agent cooperation. BACKGROUND

[0002] In recent years, AI generated image technologies such as diffusion models (e.g. Stable Diffusion) and Transformer-based models (e.g. MidJourney) have rapidly iterated, significantly improving the visual realism and detail richness of generated content, and have been widely applied in creative design, media creation and other fields. At the same time, the misuse of AI generated images has also become prominent. In information dissemination scenarios, fake news graphics and forged identity photos may mislead the public's perception; in the field of intellectual property, unauthorized use of AI generated images to imitate others' style may easily lead to copyright disputes; in the fields of justice and security, AI generated fake surveillance footage and identification images may interfere with case investigations and identity verification. Current AI generated image detection technologies face three major challenges:

[0003] Firstly, traditional detection methods based on pixel statistical features are not adaptable to high-resolution AI generated images and are easily invalidated by iterative optimization of the generation model; secondly, single model inference has the problem of one-sided feature capture, relying solely on Convolutional Neural Network (CNN) to extract microscopic features makes it difficult to identify macro-structural contradictions, and relying solely on Transformer easily ignores pixel-level flaws; thirdly, the detection results lack explainability, most methods only output probability values, making it difficult to trace the basis for judgment and meet the needs of the judiciary, media and other fields for verifiability. In addition, existing detection solutions are mostly designed for specific generation models and have weak generalization ability, requiring retraining when faced with new generation tools, which is costly. These problems make it difficult for AI generated image detection to meet the accuracy, reliability and generalization requirements of practical applications. SUMMARY

[0004] Therefore, the present application provides an AI generated image detection method based on multi-agent cooperation to improve the accuracy, reliability and generalization of detection to meet the needs of practical applications.

[0005] In a first aspect, the present application provides an AI generated image detection method based on multi-agent cooperation, comprising:

[0006] Step 1, pre-processing the original image and selecting features to obtain a set of image features;

[0007] Step 2, extracting lightweight visual features based on the set of image features to obtain a set of comprehensive visual feature vectors;

[0008] Step 3, according to the original image and the preprocessed image, supplementing non-visual features to obtain an enhanced comprehensive feature vector;

[0009] Step 4, through the comprehensive visual feature vector set and the enhanced comprehensive feature vector, the large model is subjected to adversarial inference and result calibration to determine the determination result;

[0010] Step 5, based on the determination result, outputting a structured detection report, and visualizing through a visual interactive interface.

[0011] Optionally, the pre-processing in step 1 comprises:

[0012] Let the original image set to be detected be denoted as , where N represents the number of original images to be detected; a single original image is denoted as a two-dimensional pixel matrix:

[0013] ;

[0014] where H and W are the height and width of the original image , respectively; , represents the color value of the pixel in the s-th row and r-th column of the original image , and in the RGB color space, , where , , ∈ [0, 255] respectively correspond to the pixel intensity of the red, green, and blue channels; k = 1, 2,..., N; s = 1, 2,..., H; r = 1, 2,..., W;

[0015] a. Resolution unification: all original images are unified to the target resolution by the bilinear interpolation algorithm;

[0016] Coordinate mapping relationship: for any pixel (x, y) in the original image , its corresponding coordinates in the image after standardization of the resolution are expressed as:

[0017] ;

[0018] ;

[0019] where floor represents the down rounding operation, and 0.5 represents the interpolation offset, which is used to ensure the accuracy of coordinate mapping; , y ∈[1, W].

[0020] Pixel color value calculation: for the image after standardizing resolution Any pixel in the image , whose RGB color value is The corresponding floating-point coordinate in the original image is determined by bilinear interpolation calculation:

[0021] ;

[0022] ;

[0023] The interpolation weight is calculated based on the 4 pixels around the floating-point coordinate , whose expression is:

[0024] ;

[0025] Where, ;

[0026] Finally, the expression of the RGB color value is:

[0027] ;

[0028] ;

[0029] ;

[0030] b. Color space normalization

[0031] The RGB pixel value range of the original image is [0, 255], which is normalized to the interval [0, 1]; for the image after standardizing resolution , the normalized RGB value expression of any pixel is:

[0032] ;

[0033] ;

[0034] ;

[0035] Where, , , are the RGB values of the corresponding pixels in the normalized image ;

[0036] c. Gaussian filter denoising

[0037] Random noise is removed by Gaussian filtering, and a 3x3 Gaussian filter kernel is constructed, whose expression is:

[0038] ;

[0039] wherein, represents the index of filter kernel; represents the standard deviation of Gaussian function;

[0040] The normalized image is filtered to obtain a filtered image Any pixel in the filtered image

[0041] ;

[0042] ;

[0043] ;

[0044] wherein, when or the pixel value is supplemented by a boundary pixel replication strategy to ensure the integrity of the filtering operation.

[0045] Optionally, the feature screening in step 1 comprises: screening high-value feature regions by edge detection and texture complexity analysis;

[0046] d. Edge detection: the edge information of the filtered image is extracted by using Canny edge detection algorithm to output an edge image , comprising:

[0047] Step 11. Gray image conversion: the RGB image is converted into a gray image, and the gray value of any pixel is expressed as:

[0048] ;

[0049] Step 12. Gradient amplitude and direction calculation: the gradient amplitude and the gradient direction of the gray image are calculated by using Sobel operator, and the expression is:

[0050] ;

[0051] ;

[0052] wherein, represents the horizontal direction gradient; represents the vertical direction gradient;

[0053] Step 13, Non-maxima suppression, local maximum filtering of gradient magnitude along gradient direction, used to eliminate redundant pixels on edge to preserve thin edge;

[0054] Step 14, Double threshold segmentation, set high threshold = 0.2, low threshold = 0.1; keep two kinds of pixels: pixels with gradient magnitude ≥ to determine edge; ≤ < and pixels connected with high threshold edge to supplement edge, finally form edge image ;

[0055] e, Texture complexity calculation, use GLCM to calculate texture complexity of image, including:

[0056] Step 15, Gray value quantization, for gray image , quantize gray value to L = 16 levels;

[0057] Step 16, GLCM matrix construction, construct GLCM matrix M with distance d = 1, angle , size L x L, where M (u, v) represents the co-occurrence frequency of pixels with gray value u and pixels with horizontal gray value v;

[0058] Step 17, Texture entropy calculation, calculate texture complexity index based on GLCM matrix, index is texture entropy Entropy, higher entropy value represents more complex texture;

[0059] First, calculate normalized co-occurrence probability P (u, v), its expression is:

[0060] ;

[0061] Then calculate texture entropy Entropy of 3 x 3 window centered at , its expression is:

[0062] ;

[0063] f, High value feature area judgment, set two judgment thresholds, filter each 3 x 3 window in image: edge density threshold = 0.3; texture entropy threshold = 3.0;

[0064] For denoised image ​If one of the following two conditions is met, the current window is determined to be a high-value feature region:

[0065]

[0066] Entropy

[0067] The pixel coordinates of all high-value feature regions are collected and denoted as , and M is the number of pixels in the high-value region. The pixel information of the high-value region is extracted based on the coordinate set to form an image segment set

[0068] The final output is the image feature set after standardization and high-value feature region screening, denoted as , where a single output corresponds to the processing result of the original image , containing two parts of information:

[0069] The basic information of the standardized denoising image, with a resolution of 512x512, an RGB channel pixel matrix, only retains the pixel value of the high-value feature region, and the pixel value of the non-high-value region is marked as invalid value

[0070] The pixel coordinate set of the high-value feature region records all pixel coordinates that meet the determination conditions.

[0071] Optionally, the step 2 comprises:

[0072] To achieve complementary extraction of microscopic pixel features and macroscopic structural features, two models are selected: MobileNet-V2, which realizes lightweight through depth separable convolution; Distilled ViT, which focuses on global structural logic through attention mechanism;

[0073] I. Microscopic pixel feature extraction branch based on MobileNet-V2;

[0074] For the high-value feature region pixels in the image segment set , the 256-dimensional microscopic feature vector is output by sequentially passing through feature mapping, bottleneck layer transformation and feature compression;

[0075] Step 21, input definition and depth separable convolution;

[0076] The RGB pixel matrix in is taken as input, denoted as:

[0077] ​​​​​​

[0078] wherein, is the effective size of the high-value feature region;

[0079] depth separable convolution, independent convolution for each channel, convolution kernel size is 3x3, the number is consistent with the input channel number, the output feature map :

[0080] ;

[0081] wherein, is the depth convolution kernel, corresponding to the RGB channel;

[0082] point convolution, the number of channels is raised to the expansion dimension t=6, the output :

[0083] ;

[0084] wherein, is the point convolution kernel, d is the output channel index;

[0085] Step 22, nonlinear activation and linear bottleneck layer;

[0086] nonlinear activation ReLU6, introduce nonlinearity to avoid gradient explosion, its expression is:

[0087] ; ;

[0088] linear bottleneck layer, the number of channels is compressed to the target dimension by 1x1 convolution, no activation function is used to preserve feature information, the output is:

[0089] ;

[0090] Step 23, feature compression and vector output;

[0091] global average pooling, convert two-dimensional feature map to one-dimensional vector , its expression is:

[0092] ;

[0093] wherein, d is the output channel index;

[0094] fully connected layer mapping, output 256-dimensional microscopic feature vector , its expression is:

[0095] ;

[0096] wherein, is a weight matrix, is a bias vector;

[0097] II. Macro structure feature extraction branch based on Distilled ViT;

[0098] Step 24, image patching and input sequence construction;

[0099] Patch division, based on Determine the minimum enclosing rectangle of the high-value feature area, with a size of , evenly divided into non-overlapping patches, with a patch size P = 16, each patch flattened into a dimensional vector, forming a patch sequence:

[0100] ;

[0101] wherein, represents the vector of the tthpatch, and the element corresponds to the RGB value of the pixel within the patch;

[0102] Input sequence enhancement, adding position embedding and distilled tokens, and the final input sequence is:

[0103] ;

[0104] wherein, represents the position embedding vector, represents the distilled token;

[0105] Step 25, multi-head attention and feedforward network;

[0106] Multi-head attention calculation: Map to query matrix Q, key matrix K, and value matrix V:

[0107] ;

[0108] wherein, is the mapping weight;

[0109] Divide into h = 8 heads, each with a dimension of Calculate the single-head attention score:

[0110] ;

[0111] wherein, , Kh 、 is the sub-matrix of the h-th head, for scaling attention scores;

[0112] concatenate the head outputs and linearly map to get multi-head attention results:

[0113] ;

[0114] where, is the mapping weight after concatenation;

[0115] Feed-forward network FFN: enhance feature expression, containing two linear layers and GELU activation function:

[0116] ;

[0117] where, , is the weight of the feed-forward network; , , are all biases; , is the cumulative distribution function of the standard normal distribution;

[0118] Step 26, macro feature vector output extraction The first element of the macro feature vector is obtained , and then compressed to a 256-dimensional macro feature vector by a linear layer:

[0119] ;

[0120] where, is the compression weight, is the bias;

[0121] III, feature fusion The micro feature vector is concatenated with the macro feature vector to form a 512-dimensional comprehensive visual feature vector:

[0122] ;

[0123] where T represents vector transposition;

[0124] The final output is a set of comprehensive visual feature vectors corresponding to all images to be detected:

[0125] ;

[0126] wherein, corresponding to the original image .

[0127] Optionally, the step 3 comprises:

[0128] According to the metadata of the original image and the denoised image , an enhanced comprehensive feature vector is obtained;

[0129] Step 31, metadata validity determines the quantitative real image feature matching degree :

[0130] validity determination, if the real device model ,GPS position and device history record match, then:

[0131] ;

[0132] wherein, represents the time difference between creation and shooting;

[0133] invalidity determination, if the metadata is missing, then:

[0134] ;

[0135] Constructing a metadata feature vector, converting discrete information into a 128-dimensional vector through one-hot encoding ; and combining to form a 129-dimensional metadata feature vector, whose expression is:

[0136] ;

[0137] Step 32, frequency domain feature extraction, extracting features based on the denoised image :

[0138] Step 321, grayscale conversion and Fourier transform, converting the denoised image into a grayscale image ; through two-dimensional fast Fourier transform 2D-FFT, it is converted into a frequency domain image, whose expression is:

[0139] ;

[0140] wherein, is the complex amplitude of the (u, v) point in the frequency domain;

[0141] Step 322, frequency domain energy distribution calculation, taking the frequency domain center (256, 256) as the origin, the frequency domain is divided into three regions:

[0142] Low frequency region, radius r≤64; medium frequency region: 64<r≤128; high frequency region, r>128; wherein, ;

[0143] Calculate the energy of each region, the expression is low frequency energy , medium frequency energy , high frequency energy , and total energy :

[0144] ;

[0145] ;

[0146] ;

[0147] ;

[0148] Step 323, construct the frequency domain feature vector, define a new 4-dimensional feature vector, the expression is:

[0149] ;

[0150] wherein, is the ratio of high frequency energy to low frequency energy;

[0151] Step 33, feature fusion, splice the comprehensive features , metadata feature vector , frequency domain feature vector of the original image , and unify the dimension through linear mapping, the expression is:

[0152] ;

[0153] wherein, is the mapping weight, is the bias.

[0154] Optionally, the step 4 comprises:

[0155] Select three large models based on fine-tuned Llama 3-70B: AI generation tendency inference model Branch A, used to maximize the recognition accuracy of AI generated images; real image tendency inference model Branch B, used to maximize the recognition accuracy of real images; threshold control and result calibration model Branch C, used to output the final judgment result based on the confrontation result and the threshold library;

[0156] Step 41, counterfactual reasoning phase;

[0157] Step 411, feature encoding maps 512-dimensional comprehensive feature vector to Llama 3-70B processed embedding vector with 4096 dimensions, expressed as:

[0158] ;

[0159] wherein, is the feature mapping weight, is the embedding bias;

[0160] Step 412, AI-generated tendency reasoning model Branch A and real image tendency reasoning model Branch B output probability;

[0161] AI-generated tendency reasoning model Branch A, input to the fine-tuned Transformer decoder, and outputs AI-generated probability , and outputs reasoning basis , probability , expressed as:

[0162] ;

[0163] wherein, is the Lth layer Transformer output hidden state of the AI-generated tendency reasoning model Branch A, L = 40; is the output weight; is the bias; is the Sigmoid function;

[0164] Real image tendency reasoning model Branch B, input is also , and outputs real image probability , and outputs reasoning basis , probability , expressed as:

[0165] ;

[0166] wherein, is the Lth layer hidden state of the real image tendency reasoning model Branch B, L = 40; , are the weight and bias, respectively;

[0167] Step 42, execute the counter-cyclic execution and threshold determination logic loop rule, divergence threshold = 0.3; upper limit of the number of loops =3; each round of input needs to be fused with the previous round of reasoning basis to form an enhanced feature vector;

[0168] Loop process: first round calculation, calculate the divergence value ; if , the divergence is small, and directly enter the threshold control and result calibration model Branch C calibration; if , start the second round of circulation;

[0169] The second round and subsequent circulation will convert the reasoning basis of the previous round , to vector , ; splice to form an enhanced feature vector, the expression is:

[0170] ;

[0171] Among them, the dimension 2560 = dimension 512 + dimension 1024 + dimension 1024;

[0172] After feature mapping, input AI generation tendency reasoning model Branch A and real image tendency reasoning model Branch B to calculate new probability , and divergence value ;

[0173] Loop termination when or the number of cycles reaches , take the last round probability as the final result , , corresponding to the divergence value ;

[0174] Step 43, threshold control and result calibration model C core threshold, AI generation judgment threshold =0.6; real image judgment threshold =0.6; confidence threshold =0.3;

[0175] Calibration process: first, confidence calculation, comprehensive probability size and divergence degree, the expression is:

[0176] ;

[0177] The higher the score, the higher the credibility;

[0178] Second, preliminary judgment, if , and , the preliminary judgment is high credibility AI generation; if , and If so, it is initially determined to be a highly credible real image; if or If so, it is initially determined to be a low-confidence judgment;

[0179] Secondary calibration, combined with Adjust confidence levels for feature details;

[0180] The final output is for each original image. Judgment result: Judgment label {High-credibility AI generation, high-credibility realism}; Confidence score Calibration basis .

[0181] Optionally, step 5 includes:

[0182] Input and output definitions: Input: Decision result Pixel coordinates of high-value feature regions Comprehensive characteristics Output: Structured inspection report and visual interactive interface to ensure interpretability and intuitiveness of results;

[0183] Step 51: The structured inspection report consists of four core parts:

[0184] Basic information, original image Resolution; processing time ;

[0185] Core judgment results, judgment tags Confidence score Adversarial reasoning probability value and The basis of reasoning is... Associated with preceding features;

[0186] Suggestions and tips: If For low-confidence results, it is recommended to supplement image metadata or re-detect using a higher resolution version; for high-confidence results, key feature regions are highlighted.

[0187] Step 52: The visual interactive interface contains three core views, using color and markers to distinguish key information:

[0188] The original image is overlaid with a high-value feature region image. Marked with a red rectangle above High-value feature regions in the data; displaying region feature descriptions;

[0189] Feature vector heatmap, displayed by color intensity The 512-dimensional feature value size; red represents an abnormal feature value, and blue represents normal; and the corresponding description is displayed when the current one-dimensional feature is clicked.

[0190] The anti-reasoning process line chart, the horizontal coordinate is the cycle round; the vertical coordinate is 、 And ; the solid line represents , the dashed line represents , and the dotted line represents ; the probability change trend is intuitively displayed.

[0191] In a second aspect, the embodiments of the present application provide a computer readable storage medium, which comprises a stored program, wherein the program controls the device where the computer readable storage medium is located to execute the AI generated image detection method based on multi-agent collaboration in the first aspect or any possible implementation manner of the first aspect when the program is running.

[0192] In a third aspect, the embodiments of the present application provide an electronic device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs comprise instructions, which, when executed by the device, cause the device to execute the AI generated image detection method based on multi-agent collaboration in the first aspect or any possible implementation manner of the first aspect.

[0193] In the technical scheme provided by the present application, the method comprises feature screening after pre-processing of the original image to obtain an image feature set; according to the image feature set, light-weight visual features are extracted to obtain a comprehensive visual feature vector set; according to the original image and the pre-processed image, non-visual features are supplemented to obtain an enhanced comprehensive feature vector; the comprehensive visual feature vector set and the enhanced comprehensive feature vector are used to perform anti-reasoning and result calibration on the large model to determine the determination result; based on the determination result, a structured detection report is output, and visualization is performed through a visual interactive interface, which improves the accuracy, reliability and generalization of the detection, and meets the actual application requirements. BRIEF DESCRIPTION OF DRAWINGS

[0194] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0195] Figure 1 The flowchart of the AI generated image detection method based on multi-agent collaboration provided by the embodiments of the present application;

[0196] Figure 2 Another flowchart of the AI generated image detection method based on multi-agent collaboration provided by the embodiment of the present application is shown in the figure.

[0197] Figure 3 A schematic diagram of an electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0198] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0199] It should be clear that the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0200] The terms used in the embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to limit the present application. The singular forms “a”, “an” and “the” used in the embodiments of the present application are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0201] It should be understood that the term “and / or” used herein is only to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character “ / ” herein generally represents an “or” relationship between the front and rear associated objects.

[0202] Depending on the context, the word “if” as used herein can be interpreted as “when” or “upon” or “in response to determining” or “in response to detecting”. Similarly, depending on the context, the phrase “if it is determined” or “if (a stated condition or event) is detected” can be interpreted as “when it is determined” or “in response to determining” or “when (a stated condition or event) is detected” or “in response to detecting (a stated condition or event)”.

[0203] The present application provides an AI generated image detection method based on multi-agent collaboration, as shown in Figure 1 and Figure 2 The method comprises:

[0204] Step 1, feature screening after pre-processing of the original image, obtain the image feature set.

[0205] In the embodiment of the application, the pre-processing in step 1 includes:

[0206] The original image set to be detected is denoted as , wherein N represents the number of original images to be detected; a single original image is denoted as a two-dimensional pixel matrix matrix:

[0207] ;

[0208] , wherein H and W are the height and width (unit: pixel) of the original image , respectively; represents the color value of the pixel in the s-th row and r-th column of the original image , under the RGB color space, , wherein , , , and , respectively correspond to the pixel intensity of the red, green, and blue channels; k=1, 2,..., N; s=1, 2,..., H; r=1, 2,..., W;

[0209] The image standardization processing aims to eliminate the differences in resolution, color range, noise interference, etc. of the original image, and output standardized images of uniform specifications, providing a consistent input basis for subsequent feature extraction, including three sub-steps:

[0210] a. Resolution unification, since the resolution (HxW) of the original image has differences (such as mobile phone captured images are 4032x3024, and AI generated images are 1024x1024), through the bilinear interpolation algorithm, all original images are unified to the target resolution (set to 1024x1024, according to actual needs);

[0211] Coordinate mapping relationship: for any pixel (x, y) in the original image , its corresponding coordinates in the image after standardization resolution The expression is:

[0212] ;

[0213] ;

[0214] , wherein floor represents the down rounding operation, 0.5 represents the interpolation offset, which is used to ensure the accuracy of coordinate mapping; , ;

[0215] Pixel color value calculation: for any pixel in the normalized resolution image , , , its RGB color value in the original image is determined by bilinear interpolation:

[0216] ;

[0217] ;

[0218] The interpolation weights are calculated based on the 4 pixels around the floating point coordinate , whose expression is:

[0219] ;

[0220] , ;

[0221] Finally, the expression of the RGB color value is:

[0222] ;

[0223] ;

[0224] ;

[0225] b. Color space normalization

[0226] The RGB pixel value range of the original image is [0, 255], in order to avoid the interference of pixel intensity difference on subsequent model training and inference, it is normalized to the interval [0, 1]; for the normalized resolution image , , the normalized RGB value expression of any pixel

[0227] ;

[0228] ;

[0229] ;

[0230] , , , , ,

[0231] c. Gaussian filter denoising

[0232] The original image can contain random noise (appearing as isolated high or low brightness pixels) such as sensor noise, transmission noise, etc., and the random noise is removed by Gaussian filtering to construct a 3*3 Gaussian filter kernel , the expression of which is:

[0233] ;

[0234] , wherein, , which represents the index of the filter kernel; , which represents the standard deviation of the Gaussian function;

[0235] The normalized image is filtered, and the filtered and denoised image is obtained , wherein the RGB value expression of any pixel in the filtered and denoised image is:

[0236] ;

[0237] ;

[0238] ;

[0239] When or , a boundary pixel replication strategy is adopted to supplement the pixel value, which is used to ensure the integrity of the filtering operation.

[0240] In the embodiment of the application, the features of the AI-generated image (such as pixel blur and light shadow contradiction) are mostly concentrated in the edge complex area, the texture-rich area or the key part of the object (such as the face and the hand), and the feature screening in step 1 includes: screening the high-value feature area by edge detection and texture complexity analysis;

[0241] d. Edge detection: the Canny edge detection algorithm is used to extract the edge information of the denoised image , and an edge image (binary image, edge pixel value is 1, and non-edge pixel value is 0) is output, which includes:

[0242] Step 11, gray image conversion: the RGB image is converted into a gray image, and the gray value of any pixel is expressed as:

[0243] ;

[0244] Step 12, gradient amplitude and direction calculation: the gradient amplitude and the gradient direction of the gray image are calculated by the Sobel operator, and the expression is: ​​

[0245] ;

[0246] ;

[0247] wherein, represents the horizontal direction gradient; represents the vertical direction gradient;

[0248] Step 13, non-maximum suppression, local maximum filtering of the gradient amplitude along the gradient direction, for eliminating redundant pixels on the edge to preserve thin edges;

[0249] Step 14, double threshold segmentation, setting high threshold = 0.2, low threshold = 0.1 (optimized based on massive sample experiments); retaining two types of pixels: pixels with gradient amplitude ≥ to determine the edge; ≤ < and pixels connected with the high threshold edge to supplement the edge, finally forming the edge image ;

[0250] e. Texture complexity calculation, using the Gray Level Co-occurrence Matrix (GLCM) to calculate the texture complexity of the image, including:

[0251] Step 15, gray value quantization, for the gray image , quantizing the gray value (range [0, 1]) into L = 16 levels to reduce the subsequent calculation amount;

[0252] Step 16, GLCM matrix construction, constructing the GLCM matrix M with distance d = 1 and angle , the size of which is L × L, wherein M (u, v) represents the co-occurrence frequency of the pixel with gray value u and the pixel with horizontal direction gray value v;

[0253] Step 17, texture entropy calculation, calculating the texture complexity index based on the GLCM matrix, the index of which is the texture entropy Entropy, and the higher the entropy value, the more complex the texture;

[0254] First, calculate the normalized co-occurrence probability P (u, v), the expression of which is:

[0255] ;

[0256] Then, calculate the texture entropy Entropy of the 3 × 3 window centered at ​, whose expression is:

[0257] ;

[0258] f, high-value feature area determination, set two determination thresholds, screen each 3x3 window in the image: edge density threshold =0.3, the proportion of edge pixels in the total pixels of the window; texture entropy threshold =3.0, determined based on real / AI-generated image sample statistics;

[0259] For any 3x3 window in the denoised image , if one of the following two conditions is met, the current window is determined to be a high-value feature area:

[0260] ;

[0261] Entropy ≥ ;

[0262] The pixel coordinate set of all high-value feature areas is recorded as , and M is the number of pixels in the high-value area; based on the coordinate set, the pixel information of the high-value area is extracted to form an image segment set ;

[0263] The final output is the image feature set after standardization and high-value feature area screening, recorded as , wherein a single output corresponds to the processing result of the original image , containing two parts of information:

[0264] The basic information of the standardized denoised image, the resolution is 512x512, the RGB channel pixel matrix, only the pixel value of the high-value feature area is retained, and the pixel value of the non-high-value area is marked as invalid value ;

[0265] The pixel coordinate set of the high-value feature area , records all pixel coordinates that meet the determination conditions, which is used for subsequent small model precise positioning feature extraction area.

[0266] Step 2, according to the image feature set, extract lightweight visual features, and obtain a comprehensive visual feature vector set.

[0267] In the embodiment of the application, step 2 comprises:

[0268] The input of step 2 is the output of step 1 , wherein a single contains an image segment set and the corresponding coordinate set .

[0269] To achieve the complementary extraction of micro-pixel features and macro-structure features, two small models are selected: MobileNet-V2, which realizes lightweight through depth separable convolution, captures pixel-level detail differences (such as pixel blur, color transition anomaly); Distilled ViT, which focuses on global structure logic through attention mechanism, identifies macroscopic problems such as object proportion imbalance and light shadow contradiction, and greatly reduces the parameter quantity;

[0270] I. Micro-pixel feature extraction branch based on MobileNet-V2;

[0271] For high-value feature area pixels in the image segment set , sequentially pass through feature mapping, bottleneck layer transformation and feature compression, output 256-dimensional micro-feature vectors;

[0272] Step 21, input definition and depth separable convolution;

[0273] Take the RGB pixel matrix in as input (based on in step 1, the coordinate corresponds to S k ), denoted as:

[0274] ;

[0275] Where, is the effective size of the high-value feature area (determined by the coordinate range in );

[0276] Depth separable convolution, independent convolution for each channel, convolution kernel size is 3x3, number is consistent with input channel number, output feature map :

[0277] ;

[0278] Where, is the depth convolution kernel, corresponds to the RGB channel;

[0279] Point convolution, the number of channels is raised to the expansion dimension t=6, output :

[0280] ;

[0281] Where, is the point convolution kernel, d is the output channel index;

[0282] Step 22, nonlinear activation and linear bottleneck layer;

[0283] Nonlinear activation ReLU6 is introduced to avoid gradient explosion, and its expression is:

[0284] ; ;

[0285] Linear bottleneck layer, the number of channels is compressed to the target dimension (64 dimensions) by 1x1 convolution, and no activation function is used to preserve feature information, and the output is:

[0286] ;

[0287] Step 23, feature compression and vector output;

[0288] Global average pooling, convert two-dimensional feature map to one-dimensional vector , its expression is:

[0289] ;

[0290] Where d is the output channel index;

[0291] Fully connected layer mapping, output 256-dimensional microscopic feature vector , its expression is:

[0292] ;

[0293] Where, is the weight matrix, is the bias vector;

[0294] II, macroscopic structure feature extraction branch based on Distilled ViT;

[0295] Step 24, image patching and input sequence construction;

[0296] Patch division, based on Determine the minimum enclosing rectangle of the high-value feature area, the size is , evenly divided into non-overlapping patches, the patch size P=16, each patch is flattened into dimensional vector, forming a patch sequence:

[0297] ;

[0298] Where, Vector representing the t-th patch, elements correspond to the RGB values of the pixels within the patch (based on the computation in step 1 、 、 ;

[0299] Input sequence augmentation, adding position embeddings (record spatial position) and distilled tokens (compress features), the final input sequence is:

[0300] ;

[0301] where, represents the position embedding vector, represents the distilled token;

[0302] Step 25, multi-head attention and feed-forward network;

[0303] Multi-head attention calculation: Map to query matrix Q, key matrix K, value matrix V (dimension ):

[0304] ;

[0305] where, is the mapping weight;

[0306] Divide into h=8 heads, each head dimension , calculate the single head attention score:

[0307] ;

[0308] where, 、 K h 、 is the sub-matrix of the h-th head, is used to scale the attention score;

[0309] Concatenate the head output and linearly map to get the multi-head attention result:

[0310] ;

[0311] where, is the mapping weight after concatenation;

[0312] Feed-forward network FFN: enhance feature expression, containing two linear layers and GELU activation function:

[0313] ;

[0314] wherein, , are weights of the feedforward network; , are biases; , is a standard normal distribution cumulative distribution function;

[0315] Step 26, macro feature vector output extraction The first element (corresponding to the distilled token The output of the output) is obtained , and then compressed to a 256-dimensional macro feature vector by a linear layer:

[0316] ;

[0317] wherein, is a compression weight, is a bias;

[0318] III. The micro feature vector is spliced with the macro feature vector to form a 512-dimensional comprehensive visual feature vector:

[0319] ;

[0320] wherein, T represents vector transposition;

[0321] The final output is a set of comprehensive visual feature vectors corresponding to all images to be detected:

[0322] ;

[0323] wherein, corresponds to the comprehensive feature of the original image .

[0324] Step 3, according to the original image and the preprocessed image, supplement non-visual features to obtain an enhanced comprehensive feature vector.

[0325] The input of step 3 is the output of step 2:

[0326] , and a single ∈R 512 .

[0327] In the embodiment of the application, step 3 comprises:

[0328] According to the metadata of the original image and the denoised image , an enhanced comprehensive feature vector is obtained;

[0329] Step 31, metadata validity determination quantifies the matching degree of real image features :

[0330] If there is a real device model , seconds, GPS position and device history record match, then:

[0331] ;

[0332] Among them, indicates the time difference between creation and shooting; the smaller the time difference, the higher the score.

[0333] EXIF similarity feature extraction and matching, by comparing the EXIF metadata of two images (such as query image and database image) to calculate the similarity score. First, extract the metadata feature vectors (such as the aforementioned 129-dimensional vector) of the two images respectively; then, use cosine similarity to calculate the similarity between the two feature vectors, the expression is: , where and are the metadata feature vectors of the query image and the database image respectively; the closer the EXIF value is to 1, the more similar the metadata is.

[0334] Invalid determination, if the metadata is missing (such as AI-generated images often delete EXIF) or there are obvious contradictions (such as >3600 seconds), then:

[0335] ;

[0336] Among them, the more missing fields, the lower the score.

[0337] Constructing a metadata feature vector, converting discrete information (such as ) into a 128-dimensional vector through one-hot encoding; and combining to form a 129-dimensional metadata feature vector, the expression is:

[0338] ;

[0339] Step 32, frequency domain feature extraction, AI-generated images often have abnormal energy distribution in high-frequency regions (such as missing high-frequency noise) in the frequency domain, based on the denoised image extract features:

[0340] Step 321, gray scale conversion and Fourier transform, the denoised image is converted into a gray scale image Step 1 (computational expression); converted into a frequency domain image by two-dimensional fast Fourier transform 2D-FFT, the expression is:

[0341]

[0342] wherein, is the complex amplitude of the (u, v) point in the frequency domain;

[0343] Step 322, frequency domain energy distribution calculation, taking the frequency domain center (256, 256) as the origin, the frequency domain is divided into three regions:

[0344] Low frequency region, radius r≤64; medium frequency region: 64<r≤128; high frequency region, r>128; wherein,

[0345] The energy of each region is calculated, and the expressions are respectively low frequency energy , medium frequency energy , high frequency energy , and total energy :

[0346]

[0347]

[0348]

[0349]

[0350] Step 323, construct a frequency domain feature vector, define a new 4-dimensional feature vector, the expression is:

[0351]

[0352] wherein, is the ratio of high frequency energy to low frequency energy;

[0353] Step 33, feature fusion, the comprehensive features , metadata feature vector , frequency domain feature vector of the original image are spliced, and the dimensions are unified by linear mapping, the expression is:

[0354]

[0355] wherein, ​​​​​​​​​is a mapping weight, is a bias.

[0356] Step 4, performing adversarial inference and result calibration on the large model by integrating the comprehensive feature vector set and the enhanced comprehensive feature vector to determine the determination result.

[0357] In the embodiment of the application, step 4 comprises:

[0358] Three large models based on the fine-tuned Llama 3-70B are selected: an AI generation tendency inference model Branch A for maximizing the recognition accuracy of AI generated images; a real image tendency inference model Branch B for maximizing the recognition accuracy of real images; and a threshold control and result calibration model Branch C for outputting the final determination result based on the adversarial result and the threshold library;

[0359] Step 41, adversarial inference stage;

[0360] Step 411, feature encoding maps the 512-dimensional comprehensive feature vector to an embedding vector processed by Llama 3-70B, with a dimension of 4096, and the expression is:

[0361] ;

[0362] wherein, is a feature mapping weight, is an embedding bias;

[0363] Step 412, probability output of the AI generation tendency inference model Branch A and the real image tendency inference model Branch B;

[0364] The AI generation tendency inference model Branch A inputs to the fine-tuned Transformer decoder, and outputs the AI generation probability through Sigmoid activation, while outputting the inference basis (such as based on the microscopic pixel blur feature, determining whether it conforms to the AI generation rule), the probability The expression is:

[0365] ;

[0366] wherein, is the L-th layer Transformer output hidden state of the AI generation tendency inference model Branch A, L=40; is an output weight; is a bias; is a Sigmoid function;

[0367] Real image tendency inference model Branch B, input is also , output real image probability , while outputing inference basis (such as judging consistent with real image rules based on macrostructure logical consistency features), probability The expression is:

[0368] ;

[0369] Wherein, is the Lth layer hidden state of the real image tendency inference model Branch B, L=40; , are weights and biases, respectively;

[0370] Step 42, the threshold judgment logic cycle rule is executed for the adversarial cycle, the divergence threshold =0.3(based on experimental optimization); the upper limit of the cycle number =3; the input of each round of cycle needs to fuse the inference basis of the previous round to form an enhanced feature vector;

[0371] Cycle flow: first round calculation, calculate the divergence value ; if , the divergence is small, and the threshold control and result calibration model Branch C is directly calibrated; if , the second round of cycle is started;

[0372] The inference basis of the previous round , is converted to vector , in the second round and subsequent cycles; the enhanced feature vector is formed by splicing, and the expression is:

[0373] ;

[0374] Wherein, the dimension 2560=dimension 512+dimension 1024+dimension 1024;

[0375] The feature mapping input AI generation tendency inference model Branch A, real image tendency inference model Branch B, calculate new probability , and divergence value ;

[0376] The cycle is terminated, and when or the cycle number reaches , the last round of probability is taken as the final result , , and the corresponding divergence value is ;

[0377] Step 43, threshold control and result calibration model C core threshold (based on 100,000 level sample ROC analysis), AI generated decision threshold =0.6; real image decision threshold =0.6; confidence threshold =0.3;

[0378] Calibration process: first, confidence calculation, comprehensive probability size and divergence degree, expression is:

[0379] ;

[0380] The higher the score, the higher the credibility of the decision;

[0381] Second, preliminary decision, if , And , the preliminary decision is high-confidence AI generation; if , And , the preliminary decision is high-confidence real image; if Or , the preliminary decision is low-confidence decision;

[0382] Second calibration, combined with Characteristic details adjust confidence, for example: if the preliminary decision is high-confidence AI generation, but the macrostructure feature is normal, the confidence is lowered and the basis is supplemented (such as pixel features consistent with AI generation, but structure logic is normal) Confidence down 5;

[0383] The final output is the decision result of each original image : decision label {high-confidence AI generation, high-confidence real}; confidence score (reserve two decimal places); calibration basis (associated pre-sequencing features).

[0384] Step 5, based on the decision result, output the structured detection report, and visualize through the visual interactive interface.

[0385] In the embodiment of the application, step 5 includes:

[0386] Input and output definition, input: decision result , pixel coordinates of high-value feature area , comprehensive features ; output: structured detection report and visual interactive interface, for realizing result interpretability and intuitiveness;

[0387] Step 51: The structured inspection report consists of four core parts:

[0388] Basic information, original image Resolution (original H×W and normalized 512×512); Processing time ;

[0389] Core judgment results, judgment tags (High-confidence AI-generated / High-confidence real-world image / Low-confidence judgment); Confidence score (Keep two decimal places, e.g., 0.85); Adversarial reasoning probability value and (For example, the probability of AI-generated images is 0.92, while the probability of real images is 0.15).

[0390] The basis for reasoning will Associated with preceding features, such as based on Microscopic pixel blurring features of the middle hand region (coordinates (120, 150) - (200, 250)). The eigenvalues ​​in dimensions 12-18 are abnormal, and the high-frequency energy proportion in the frequency domain is only 0.08 ( The third dimension value is used to determine the tendency of AI generation.

[0391] Suggestions and tips: If For low-confidence results, it is recommended to supplement image metadata or re-detect using a higher resolution version; for high-confidence results, key feature areas are highlighted (e.g., it is recommended to focus on checking the pixel consistency of the facial area).

[0392] Step 52: The visual interactive interface contains three core views, using color and markers to distinguish key information:

[0393] The original image is overlaid with a high-value feature region image. Marked with a red rectangle above High-value feature regions in the data; display region feature descriptions (e.g., texture entropy 3.2, above the threshold 3.0, containing AI-generated suspected features);

[0394] Feature vector heatmap, displayed by color intensity The 512-dimensional feature values ​​are displayed; red indicates abnormal feature values ​​(matching the AI-generated feature library), and blue indicates normal features (matching the real image feature library); clicking on the current one-dimensional feature displays the corresponding description (e.g., the 25th dimension: pixel blur feature, value 0.89, which conforms to the AI ​​generation pattern).

[0395] A line graph of the adversarial reasoning process, with the horizontal axis representing the number of cycles (1 to K). max ); the vertical axis is , With ; solid line represents , dashed line represents , dotted line represents ; intuitively show the trend of probability change (such as after the second round, the delta is raised from 0.25 to 0.35, reaching the threshold =0.3).

[0396] In order to further verify the performance of the constructed model in analyzing and processing information, the framework constructed by the application is compared with the current mainstream large model (LLava-1.5, qwen2.vl, gpt-oss, Qwen3-235B-A, Llama-4-Scout, Llama-Vision, Llama-3.2-11B, Llama-3.2-90B, Qwen2.5-VL) for comparative experiment, by making A and human experts sort the output of multiple models from four dimensions, the results shown in Table 1 are obtained, which shows that the best ranking is obtained in all dimensions of evaluation, and the effectiveness of the constructed framework is fully embodied.

[0397] Table 1 Performance comparison of multiple models

[0398] .

[0399] The method of the application breaks through the limitation of traditional detection technology through the three-layer architecture of small model fine extraction, large model strong reasoning and adversarial cycle verification. The light weight small model combination realizes the complementary extraction of micro and macro features, solves the problem of insufficient single feature dimension; the large model adversarial cycle mechanism improves the credibility of judgment through dynamic iteration, avoids the reasoning deviation of single model; the auxiliary feature enhancement module introduces metadata and frequency domain features, further widens the feature coverage range, and improves the detection precision in complex scenes (such as secondary editing, low resolution image).

[0400] The method provides a new paradigm of multi-dimensional feature fusion and adversarial reasoning verification for AI generated content detection, and can promote the development of detection technology from single model adaptation to multi-model collaborative generalization. From the application level, the structured report and visual interface of the method solve the black box problem of the detection result, and through feature tracing and process display, the judgment basis is verifiable and traceable, meeting the strict needs of the fields of justice, media and intellectual property protection. For example, in a copyright dispute case, high-value regional feature labeling and frequency energy analysis can be used to provide technical support for the identification of AI generated images; in the news review scene, false pictures can be quickly identified to assist in content authenticity verification. From the industry standard level, the method is helpful to build a technical standard framework for AI generated content detection, and the feature extraction logic, adversarial cycle threshold setting and result calibration rule can provide a reference for the development of subsequent detection tools, promote the balance between innovative application and risk control of AI generated image technology, and promote the healthy development of related industries.

[0401] The technical scheme provided by the application comprises the following steps: performing feature screening on a preprocessed original image to obtain an image feature set; extracting lightweight visual features from the image feature set to obtain a comprehensive visual feature vector set; supplementing non-visual features according to the original image and the preprocessed image to obtain an enhanced comprehensive feature vector; performing adversarial reasoning and result calibration on a large model through the comprehensive visual feature vector set and the enhanced comprehensive feature vector to determine a judgment result; and outputting a structured detection report based on the judgment result and visualizing the report through a visual interactive interface. The method improves the accuracy, reliability and generalization of detection and meets the actual application requirements.

[0402] The various steps of the embodiment of the application can be executed by an electronic device. The electronic device includes but is not limited to a tablet computer, a portable PC, a desktop computer, etc.

[0403] The embodiment of the application provides a computer readable storage medium, which comprises a stored program, wherein the program controls an electronic device in which the computer readable storage medium is located to execute the embodiment of the AI generated image detection method based on multi-agent collaboration when the program is running.

[0404] Figure 3 A schematic diagram of an electronic device provided by the embodiment of the application is shown in Figure 3 The electronic device 21 comprises a processor 211, a memory 212, and a computer program 213 stored in the memory 212 and executable on the processor 211. The computer program 213 is executed by the processor 211 to implement the AI generated image detection method based on multi-agent collaboration in the embodiment. To avoid repetition, details are not described here.

[0405] The electronic device 21 includes, but is not limited to, a processor 211, a memory 212. Those skilled in the art can understand that Figure 3 The electronic device 21 is merely an example and does not constitute a limitation on the electronic device 21, and can include more or fewer components than illustrated, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, etc.

[0406] The processor 211 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0407] The memory 212 can be an internal storage unit of the electronic device 21, such as a hard disk or a memory of the electronic device 21. The memory 212 can also be an external storage device of the electronic device 21, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 212 can include both the internal storage unit and the external storage device of the electronic device 21. The memory 212 is used to store computer programs and other programs and data required by the network device. The memory 212 can also be used to temporarily store data that has been output or will be output.

[0408] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0409] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An AI-generated image detection method based on multi-agent collaboration, characterized in that, The method comprises: Step 1, feature screening after pre-processing of the original image to obtain an image feature set; Step 2, extracting lightweight visual features according to the image feature set to obtain a comprehensive visual feature vector set; In order to realize the complementary extraction of micro-pixel features and macro-structure features, two models are selected: MobileNet-V2, which realizes lightweight through depth separable convolution; Distilled ViT, which focuses on global structure logic through attention mechanism; Step 3, supplementing non-visual features according to the original image and the pre-processed image to obtain an enhanced comprehensive feature vector; Step 4, determining the determination result by performing adversarial reasoning and result calibration on the large model based on the comprehensive visual feature vector set and the enhanced comprehensive feature vector; Three large models based on Llama 3-70B after fine-tuning are selected: AI generation tendency reasoning model Branch A, used to maximize the recognition accuracy of AI generated images; real image tendency reasoning model Branch B, used to maximize the recognition accuracy of real images; threshold control and result calibration model Branch C, used to output the final determination result based on the adversarial result and the threshold library; Step 5, outputting a structured detection report based on the determination result and visualizing through a visual interactive interface.

2. The method of claim 1, wherein, The pre-processing in step 1 comprises: Let the set of original images to be detected be denoted as where N denotes the number of original images to be detected; a single original image denoted as a two-dimensional pixel matrix: ; where H and W are the height and width of the original image, respectively; Rs,r denotes the color value of the pixel at the s-th row and r-th column of the original image in the RGB color space, where , , ∈ [0, 255] respectively correspond to the pixel intensity of the red, green, and blue channels; k = 1, 2,..., N; s = 1, 2,..., H; r = 1, 2,..., W.​​ a. Resolution unification, all original images are unified to the target resolution by bilinear interpolation algorithm ; Coordinate mapping relationship: For the original image For any pixel (x, y) in the image after normalization resolution, Corresponding coordinates in The expression is: ; ; Wherein, floor represents the down rounding operation, 0.5 represents the interpolation offset, and is used to ensure the accuracy of coordinate mapping. , ; Pixel color value computation: for the image after standardizing the resolution any pixel in the image its RGB color value Determine the corresponding floating-point coordinates in the original image by bilinear interpolation computation: ; ; The interpolation weights are calculated based on 4 pixels around the floating point coordinate The expression is: ; wherein ; Finally, the expression of the RGB color value is: ; ; ; b, color space normalization; The RGB pixel value range of the original image is [0, 255], which is normalized to the interval [0, 1]; for the image after standardizing the resolution , the normalized RGB value expression of any pixel is: ; ; ; in, , , These are the normalized images. The RGB value of the corresponding pixel; c, Gaussian filter denoising; Remove random noise by Gaussian filter, construct 3x3 Gaussian filter kernel The expression is: ; wherein which represents an index of a filter kernel; which represents a standard deviation of a Gaussian function; to the normalized image performing a filtering operation, the filtered denoised image any pixel The RGB value expression of the pixel ; ; ; wherein, when or a boundary pixel replication strategy is employed to supplement pixel values, for ensuring the integrity of the filtering operation.

3. The method of claim 2, wherein, The feature screening in step 1 comprises: screening high-value feature regions through edge detection and texture complexity analysis; d. Edge detection: The Canny edge detection algorithm is used to extract the denoised image. Edge information, output edge image ,include: Step 11, gray image conversion, convert the RGB image to a gray image, the gray value of any pixel is expressed as: is expressed as: ; Step 12, Gradient magnitude and direction calculation, the gradient magnitude of the gray image is calculated by Sobel operator with the gradient direction The expression is: ; ; wherein represents a horizontal direction gradient; represents a vertical direction gradient; Step 13, non-maximum suppression, local maximum screening of gradient amplitude along the gradient direction, used to eliminate redundant pixels on the edge to preserve thin edges; Step 14, double threshold segmentation, set high threshold = 0.2, low threshold = 0.1; retain two kinds of pixels: pixels with gradient amplitude ≥ to determine the edge; ≤ < and pixels connected with high threshold edge to supplement the edge, finally form edge image ; e, texture complexity calculation, using a gray level co-occurrence matrix GLCM to calculate the texture complexity of the image, including: Step 15, quantization of gray values, for gray scale images Quantize the gray values to L = 16 levels; Step 16, GLCM matrix construction, construct GLCM matrix M with distance d = 1, angle of L x L, where M(u, v) represents the co-occurrence frequency of the pixel with gray value u and the pixel with horizontal gray value v; Step 17, texture entropy calculation, calculating the texture complexity index based on the GLCM matrix, and the index is texture entropy Entropy, the higher the entropy value, the more complex the texture; First, calculate the normalized co-occurrence probability P(u,v), and its expression is: ; The texture entropy Entropy of the 3x3 window centered at (i,j) is recalculated as Entropy (i,j) = -log2 (P(i,j)) where P(i,j) is the probability of the 3x3 window centered at (i,j). ; f. High-value feature region determination, set two determination thresholds, screen each 3x3 window in the image: edge density threshold = 0.3; texture entropy threshold = 3.0; For any 3x3 window in the denoised image If one of the following two conditions is satisfied, the current window is determined as a high-value feature region: ; Entropy ≥ ; Collecting pixel coordinates of all high-value feature regions as , M is the pixel number of the high-value region; extracting pixel information of the high-value region based on the coordinate set to form an image segment set ; The final output is a set of image features after standardization and high-value feature region screening, denoted as wherein the single output corresponds to the processing result of the original image , containing two parts of information: The basic information of the standardized denoising image is a 512x512 resolution RGB channel pixel matrix, only the pixel values of the high-value feature area are retained, and the pixels in the non-high-value area are marked as invalid values ; Pixel coordinate set of a high-value feature region , records all pixel coordinates satisfying the determination condition.

4. The method of claim 3, wherein, The step 2 comprises: I, micro-pixel feature extraction branch based on MobileNet-V2; For high-value feature region pixels in the image segment set , 256-dimensional microscopic feature vectors are output in turn through feature mapping, bottleneck layer transformation and feature compression. Step 21, input definition and depth separable convolution; Taking the RGB pixel matrix in as input, denoted as:​ ; wherein, effective size of the high value feature area; Depthwise separable convolution, independent convolution for each channel, convolution kernel size is 3x3, the number is consistent with the number of input channels, output feature map : ; wherein is a depth convolutional kernel, corresponding to an RGB channel; pointwise convolution, lifting the number of channels to the expanded dimension t = 6, output : ; wherein, is a point convolution kernel, d is an output channel index; Step 22, nonlinear activation and linear bottleneck layer; Nonlinear activation ReLU6, introducing nonlinearity to avoid gradient explosion, and its expression is: ; ; Linear bottleneck layer, compressing the channel number to the target dimension through 1x1 convolution, without using activation function to preserve feature information, and the output is: ; Step 23, feature compression and vector output; global average pooling, converting a two-dimensional feature map into a one-dimensional vector whose expression is: ; Where d is the output channel index; Fully connected layer mapping, output 256 dimensional microfeature vector whose expression is: ; wherein, is a weight matrix, is a bias vector; II, macro-structure feature extraction branch based on Distilled ViT; Step 24, image blocking and input sequence construction; Patch division, based on Determine the minimum enclosing rectangle of the high-value feature region, size , evenly divided into non-overlapping patches, patch size P = 16, each patch flattened into dimensional vector, forming a patch sequence: ; wherein, denotes the vector of the t-th patch, the elements of which correspond to the RGB values of the pixels within the patch; Input sequence enhancement, adding position embedding and distillation token, and the final input sequence is: ; wherein, represents a position embedding vector, represents a distillation token; Step 25, multi-head attention and feed-forward network; Multi-headed attention computation: is mapped to a query matrix Q, a key matrix K, and a value matrix V: ​ ; wherein is a mapping weight; Split into h = 8 heads, each head dimension , compute individual head attention scores: ; wherein, , K h , is a sub-matrix of the h-th head, for scaling the attention scores; The splice head outputs and linearly maps to get a multi-head attention result: ; wherein, is the mapped weight after stitching; Feed-forward network FFN: enhance feature expression, including two linear layers and GELU activation function: ; wherein , are weights of the feedforward network; , , are biases; , is a standard normal distribution cumulative distribution function; Step 26, macro feature vector output extraction The first element of the macro feature vector is obtained by The macro feature vector is compressed to 256 dimensions by a linear layer : ; wherein, is a compression weight, is a bias; III. Feature fusion combines micro-feature vectors with macro-feature vectors to form a 512-dimensional integrated visual feature vector: ; Where T represents vector transposition; The final output is a set of comprehensive visual feature vectors corresponding to all images to be detected: ; wherein corresponding original image of the integrated features.

5. The method of claim 4, wherein, The step 3 includes: According to the metadata of the original image and the denoised image , an enhanced comprehensive feature vector is obtained; Step 31, metadata validity determination quantifies real image feature matching degree : Effective determination if there is a real device model , seconds, GPS location matches device history, then: ; wherein, represents the time difference between the creation and the shooting; Invalidity judgment, if the metadata is missing: ; Constructing the metadata feature vector, discrete information is converted to a 128-dimensional vector through one-hot encoding ; and combining a 129-dimensional metadata feature vector is formed, whose expression is ; Step 32, frequency domain feature extraction, based on the denoised image Extracted features: Step 321, gray scale conversion and Fourier transform, the denoised image is converted into a gray scale image ; and a frequency domain image is obtained by two-dimensional fast Fourier transform (2D-FFT), and the expression is as follows:​ ; wherein is the complex amplitude of the (u, v) point in the frequency domain; Step 322, frequency domain energy distribution calculation, taking the frequency domain center (256, 256) as the origin, divide the frequency domain into three regions: Low frequency region, radius r < 64; mid frequency region: 64 < r < 128; high frequency region, r > 128; where, ; The energy of each region is calculated, expressed as low frequency energy , mid frequency energy , high frequency energy and total energy : ; ; ; ; Step 323, construct the frequency domain feature vector, define a 4-dimensional new feature vector, its expression is: ; wherein, is the ratio of high frequency energy to low frequency energy; Step 33, feature fusion, the original image comprehensive features , metadata feature vector , frequency domain feature vector are spliced, and the dimensions are unified through linear mapping, and the expression is: ; wherein, is a mapping weight, is a bias.

6. The method of claim 5, wherein, The step 4 includes: Step 41, adversarial reasoning stage; Step 411, feature encoding maps the 512-dimensional comprehensive feature vector to the embedding vector processed by Llama 3-70B, with a dimension of 4096, its expression is: ; wherein, is a feature mapping weight, is an embedding bias; Step 412, the probability output of AI-generated inclination reasoning model Branch A and real image inclination reasoning model Branch B; AI-generated propensity-to-reason model Branch A, input to fine-tuned Transformer decoder, output AI-generated probability via Sigmoid activation with output reasoning basis , probability Expression: ; wherein, is the AI-generated propensity-to-reasoning model Branch A L-th layer Transformer output hidden state, L = 40; is the output weight; is the bias; is the Sigmoid function; The real image tendency inference model Branch B, input is also , output real image probability , while outputting the inference basis , probability The expression is: ; wherein, is the real image tendency inference model Branch B L-th layer hidden state, L = 40; , are the weight and bias, respectively. Step 42, execute the threshold decision logic cycle rule with the cycle of confrontation, divergence threshold = 0.3; upper limit of cycle number = 3; each round of cycle input needs to fuse the previous round of reasoning basis to form an enhanced feature vector; Circulation process: first round calculation, calculate the divergence value If , the divergence is small, directly enter the threshold control and result calibration model Branch C calibration; if , start the second round of circulation; In the second round and subsequent cycles, the previous round of reasoning is converted into a vector , , , ; spliced to form an enhanced feature vector, the expression is: ; Where, dimension 2560 = dimension 512 + dimension 1024 + dimension 1024; Feature mapping after input AI generates tendency inference model Branch A, real image tendency inference model Branch B, calculates new probability , and divergence value ; The cycle terminates when or the number of cycles reaches , taking the last round probability as the final result , , the corresponding divergence value ; Step 43, threshold control and result calibration model C core threshold, AI generates a determination threshold = 0.6; real image determination threshold = 0.6; confidence threshold = 0.3; Calibration process: first, confidence calculation, comprehensive probability size and divergence degree, expression is: ; The higher its score, the higher the credibility; Second, a preliminary determination is made that if , and , then the preliminary determination is high confidence AI-generated; if , and , then the preliminary determination is high confidence real image; if or , then the preliminary determination is low confidence determination. Secondary calibration, in combination Feature detail adjustment confidence; Final output is the decision result for each original image : decision label {High-confidence AI-generated, High-confidence real}; confidence score ; calibration basis .

7. The method of claim 6, wherein, The step 5 includes: Input and output definitions, input: decision result , pixel coordinates of high value feature regions , integrated features ; output: structured detection report and visual interactive interface for realizing result interpretability and intuitiveness; Step 51, structured detection report contains four core parts: Basic information, resolution of the original image processing time ; core determination result, determination label ; confidence score ; adversarial inference probability value with ; inference basis, will be associated with the antecedent feature; ​ Suggest to add image metadata or re-detect with higher resolution version if For low confidence decision, suggest to add image metadata or re-detect with higher resolution version; for high confidence result, suggest to add key feature region; Step 52, the visual interactive interface contains three core views, which distinguish key information through color and markers: The original image is overlaid with a high value feature region map, in the original image annotated with a red rectangular box in the original image; display region feature description; Feature vector heatmap, displayed by color intensity The size of the 512-dimensional feature values; red indicates abnormal feature values, and blue indicates normal features; clicking on the current one-dimensional feature displays the corresponding description; The horizontal axis of the graph is the cycle round; the vertical axis is , and ; the solid line represents , the dashed line represents , and the dotted line represents ; the probability trend is intuitively displayed.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored program, wherein when the program runs, the device where the computer readable storage medium is located executes the multi-agent collaborative based AI generated image detection method in any one of claims 1-7.

9. An electronic device, comprising: Including: One or more processors; Memory; And one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs include instructions, when the instructions are executed by the device, the device executes the multi-agent collaborative based AI generated image detection method in any one of claims 1-7.

Citation Information

Patent Citations

  • AI (Artificial Intelligence) generated face image authenticity judgment method and device and storage medium

    CN119992630A

  • Deep fake face image detection method based on double-flow CNN and ViT hybrid model

    CN120833637A