Image detection method and device, electronic equipment and storage medium

By combining CLIP network, multi-head attention network and forgery adaptation network, the problem of insufficient generalization ability of AIGC detection model under unknown generated content and image processing operations is solved, realizing accurate detection of forged images and improving detection accuracy and efficiency.

CN120747586BActive Publication Date: 2026-06-05BEIZHI TECHNOLOGY (ANJI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIZHI TECHNOLOGY (ANJI) CO LTD
Filing Date
2025-06-19
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing AIGC detection models lack generalization ability when faced with unknown generated content, and their robustness to common image processing operations needs to be improved, making it difficult to accurately distinguish between fake and real images.

Method used

By employing a combination of CLIP network, multi-head attention network, spoofing adaptation network, and classification network, enhanced image-text features are generated using quality evaluation text, content description text, and image patch information to improve the adaptability and accuracy of the detection model.

Benefits of technology

It improves the model's ability to adapt to unknown generated content, accurately distinguishes between fake and real images, and enhances the accuracy and efficiency of AIGC detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120747586B_ABST
    Figure CN120747586B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and provides an image detection method and device, electronic equipment and a storage medium. The method comprises the following steps: firstly, determining quality evaluation text and content description text of a to-be-processed image and a plurality of image block information; then, using a CLIP network of an image detection model, obtaining quality text features, content text features and image features according to the quality evaluation text, the content description text and the plurality of image block information; next, using a multi-head attention network of the image detection model, obtaining fused text features according to the quality text features and the content text features; then, using a forgery adaptation network of the image detection model, obtaining enhanced graph-text features according to the fused text features and the image features; finally, using a classification network of the image detection model, obtaining a detection result representing whether the to-be-processed image is a forged image according to the enhanced graph-text features. The detection model can accurately distinguish between forged images and real images, and the accuracy of AIGC detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and more specifically, to an image detection method, apparatus, electronic device, and storage medium. Background Technology

[0002] In recent years, the rapid development of generative artificial intelligence technologies such as Generative Adversarial Networks (GANs) and Diffusion Models (DMs) has significantly promoted progress in the field of Artificial Intelligence Generated Content (AIGC), bringing revolutionary changes to image generation and editing technologies. Based on these advanced generative models, users can generate and edit high-quality images simply by inputting brief text prompts, thus giving rise to commercial applications such as DALLE-2, Midjourney, and Adobe Firefly. Among them, diffusion models, with their superior controllability and excellent generation effects, have demonstrated enormous transformative potential in creative design, digital media, and content creation.

[0003] However, the rapid popularization of AIGC technology has also brought unprecedented security challenges. Highly realistic synthetic images are increasingly blurring the line between real and fake content, making it difficult for the public to distinguish between genuine and fake information, leading to a series of problems such as the spread of misinformation and digital forgery. Against this backdrop, how to accurately detect fake and real images while ensuring technological development, in order to prevent the potential risks posed by AIGC technology, has become a crucial issue. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide an image detection method, apparatus, electronic device and storage medium.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0006] In a first aspect, the present invention provides an image detection method, the method comprising:

[0007] Determine the quality evaluation text and content description text of the image to be processed, as well as the information of multiple image blocks of the image to be processed;

[0008] Using the CLIP network of the image detection model, the quality text features and content text features of the image to be processed are obtained based on the quality evaluation text and content description text of the image to be processed, and the image features of the image to be processed are obtained based on multiple image patch information of the image to be processed.

[0009] Using a multi-head attention network of an image detection model, the fused text features of the image to be processed are obtained based on the quality text features and content text features of the image to be processed.

[0010] By utilizing the forgery adaptation network of the image detection model, the enhanced image-text features of the image to be processed are obtained based on the fused text features and image features of the image to be processed.

[0011] By utilizing the classification network of the image detection model, a detection result indicating whether the image to be processed is a forged image is obtained based on the enhanced image-text features of the image to be processed.

[0012] In an optional implementation, the CLIP network includes a text encoder and multiple visual encoders;

[0013] Using the CLIP network of the image detection model, quality text features and content text features of the image to be processed are obtained based on the quality evaluation text and content description text of the image to be processed. Furthermore, image features of the image to be processed are obtained based on multiple image patch information, including:

[0014] Using the text encoder, the quality evaluation text and content description text of the image to be processed are encoded respectively to obtain the quality text features and content text features of the image to be processed.

[0015] Each visual encoder is used sequentially to encode multiple image block information of the image to be processed, thereby obtaining the image features of the image to be processed;

[0016] The image features include global image features and multiple local image features; the global image features represent the correlation between the global information of the image and the local information of each image block; each local image feature represents the correlation between the local information of an image block and the local information of other image blocks.

[0017] In an optional implementation, the multi-head attention network includes multiple attention layers and a splicing layer, each attention layer having a query vector, a key vector, and a numerical vector, and the splicing layer having fusion parameters;

[0018] Using a multi-head attention network of an image detection model, the fused text features of the image to be processed are obtained based on the quality text features and content text features of the image to be processed, including:

[0019] By using each attention layer, an aggregation operation is performed based on the query vector, key vector, and numerical vector of that attention layer, as well as the quality text features and content text features of the image to be processed, to obtain the attention text features of that attention layer, thus obtaining the attention text features of each attention layer;

[0020] Using the splicing layer, splicing operations are performed based on the attention text features of all attention layers to obtain spliced ​​text features, and the spliced ​​text features are multiplied by the fusion parameters to obtain the fused text features of the image to be processed.

[0021] In an optional implementation, the forgery adaptation network includes a connection layer, a transformation layer, and an interaction layer; the image features include global image features and multiple local image features.

[0022] Using a forgery adaptation network in an image detection model, enhanced image-text features of the image to be processed are obtained based on the fused text and image features of the image to be processed, including:

[0023] Using the connection layer, fusion and extraction operations are performed based on the fused text features of the image to be processed and the global image features to obtain fused image-text features. Then, based on the fused image-text features and the multiple local image features, a splicing operation is performed to obtain the initial image-text features of the image to be processed.

[0024] Using the transformation layer, a transformation operation is performed based on the initial image and text features of the image to be processed to obtain the transformed image and text features of the image to be processed.

[0025] Using the interaction layer, enhancement operations are performed based on the transformed graphic features of the image to be processed to obtain the enhanced graphic features of the image to be processed.

[0026] In an optional implementation, the transformation layer is used to perform a transformation operation based on the initial image-text features of the image to be processed, to obtain the transformed image-text features of the image to be processed, including:

[0027] Using the transformation layer, a dimensionality reduction operation is performed based on the initial image and text features of the image to be processed to obtain the first image and text features;

[0028] Using the transformation layer, Fourier transform and inverse Fourier transform operations are performed based on the first image and text features to obtain the second image and text features;

[0029] Using the transformation layer, a dimension restoration operation is performed based on the second image-text features to obtain the transformed image-text features of the image to be processed.

[0030] In an optional implementation, the interaction layer is used to perform enhancement operations based on the transformed graphic features of the image to be processed, resulting in enhanced graphic features of the image to be processed, including:

[0031] Using the interaction layer, wavelet transform is performed on the transformed graphic features of the image to be processed to obtain multi-band features;

[0032] Using the interaction layer, high-frequency band features are obtained from the multi-frequency band features and enhanced and wavelet inverse transform operations are performed to obtain high-frequency image and text features;

[0033] Using the interaction layer, a fusion operation is performed based on high-frequency image features and transformed image features to obtain the enhanced image features of the image to be processed.

[0034] In an optional implementation, the image detection model is obtained in the following manner:

[0035] Based on multiple image samples and their labels, obtain the quality evaluation text and content description text for each image sample, as well as information on multiple image blocks for each image sample;

[0036] Using the CLIP network of the image detection model to be trained, the quality text features and content text features of the image sample are obtained based on the quality evaluation text and content description text of the image sample, and the image features of the image sample are obtained based on multiple image patch information of the image sample.

[0037] Using a multi-head attention network of the image detection model to be trained, the fused text features of the image samples are obtained based on the quality text features and content text features of the image samples.

[0038] By utilizing the forgery adaptation network of the image detection model to be trained, the enhanced image-text features of the image samples are obtained based on the fused text features and image features of the image samples.

[0039] By utilizing the classification network of the image detection model to be trained, and based on the enhanced image and text features of the image sample, a detection result indicating whether the image sample is a forged image is obtained;

[0040] The image detection model is trained based on the label and detection result of each image sample to obtain the image detection model.

[0041] In a second aspect, the present invention provides an image detection apparatus, the apparatus comprising:

[0042] The preprocessing module is used to determine the quality evaluation text and content description text of the image to be processed, as well as multiple image block information of the image to be processed;

[0043] The detection module is used to obtain the quality text features and content text features of the image to be processed based on the quality evaluation text and content description text of the image to be processed using the CLIP network of the image detection model, and to obtain the image features of the image to be processed based on multiple image patch information of the image to be processed.

[0044] Using a multi-head attention network of an image detection model, the fused text features of the image to be processed are obtained based on the quality text features and content text features of the image to be processed.

[0045] By utilizing the forgery adaptation network of the image detection model, the enhanced image-text features of the image to be processed are obtained based on the fused text features and image features of the image to be processed.

[0046] By utilizing the classification network of the image detection model, a detection result indicating whether the image to be processed is a forged image is obtained based on the enhanced image-text features of the image to be processed.

[0047] Thirdly, the present invention provides an electronic device including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the image detection method described in any of the foregoing embodiments.

[0048] Fourthly, the present invention provides a storage medium storing a computer program, which, when executed by a processor, implements the image detection method described in any of the foregoing embodiments.

[0049] The image detection method, apparatus, electronic device, and storage medium provided in this invention include: first, determining the quality evaluation text and content description text of the image to be processed, as well as multiple image patch information of the image to be processed; then, using the CLIP network of the image detection model, obtaining quality text features, content text features, and image features based on the quality evaluation text, content description text, and multiple image patch information; next, using the multi-head attention network of the image detection model, obtaining fused text features based on the quality text features and content text features; then, using the forgery adaptation network of the image detection model, obtaining enhanced image-text features based on the fused text features and image features; finally, using the classification network of the image detection model, obtaining a detection result indicating whether the image to be processed is a forged image based on the enhanced image-text features. This improves the detection model's adaptability to unknown generated content, enabling the model to accurately distinguish between forged and real images, and improving the accuracy and efficiency of AIGC detection.

[0050] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0051] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 A flowchart illustrating the image detection method provided in an embodiment of the present invention is shown;

[0053] Figure 2 An example diagram of the image detection method provided in an embodiment of the present invention is shown;

[0054] Figure 3 An example structural diagram of the transformation layer provided in an embodiment of the present invention is shown;

[0055] Figure 4 This diagram illustrates an example of the structure of the interaction layer provided in an embodiment of the present invention.

[0056] Figure 5 A schematic diagram of the training process of the image detection model provided in an embodiment of the present invention is shown;

[0057] Figure 6 A functional block diagram of the image detection device provided in an embodiment of the present invention is shown;

[0058] Figure 7 A block diagram of an electronic device provided in an embodiment of the present invention is shown.

[0059] Icons: 100 - Electronic device; 110 - Processor; 120 - Memory; 130 - Communication module; 300 - Image detection device; 310 - Preprocessing module; 330 - Detection module. Detailed Implementation

[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0061] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0062] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0063] Currently, the field of AIGC detection faces two main challenges: firstly, the models lack the ability to generalize to unknown generated content; and secondly, their robustness to common image processing operations (such as compression, blurring, and noise addition) needs improvement. To address these issues, it is necessary to design image detection methods that can effectively capture potential forgery features while possessing both high discriminative and generalizable capabilities, in order to adapt to the increasingly complex and diverse environment of generated content.

[0064] Early AIGC detection research primarily addressed the generalization challenge through two strategies. The first approach employed data augmentation techniques (such as blurring, JPEG compression, and hybrid transformations) to enhance the diversity of training data, thereby improving the model's adaptability to different generated content and common image processing attacks. The second approach focused on mining transferable forgery features, including detectable forgery artifacts, facial structural anomalies (such as anomalies in the eye region), and discriminative features in the spatial and frequency domains. While these methods achieved some success, their reliance on explicit learning of specific forgery patterns made the detection models prone to overfitting during training, leading to a significant decline in generalization performance when faced with unknown generated images. Therefore, this invention provides an image detection method to address these issues.

[0065] Please see Figure 1 This is a flowchart illustrating the image detection method provided in an embodiment of the present invention.

[0066] Step S202: Determine the quality evaluation text and content description text of the image to be processed, as well as the information of multiple image blocks of the image to be processed.

[0067] In this embodiment, the image input by the user can be acquired, thus obtaining the image to be processed. Then, a preset image quality assessment model is used to evaluate the quality of the image to be processed, resulting in a quality assessment text. Furthermore, a preset image content generation model is used to extract content from the image to be processed, resulting in a content description text.

[0068] The image quality assessment model can adopt the LIQE (Language-Image Quality Evaluator) model, and the image content generation model can adopt the BLIP (Bootstrapping Language-Image Pre-training) model. Furthermore, the quality assessment text can be understood as text used to represent the distortion or quality characteristics of an image, such as blurriness, compression levels, and noise levels; the content description text can be understood as text used to describe the specific content of the image.

[0069] Meanwhile, according to the preset block parameter N, the image to be processed is divided into N image blocks. In order to ensure that the data dimension of each image block is consistent with the input data dimension of the image detection model, a linear mapping operation is performed on each image block to convert the data dimension of each image block into the input data dimension of the image detection model, thus obtaining the information of N image blocks of the image to be processed.

[0070] Step S204: Using the CLIP network of the image detection model, the quality text features and content text features of the image to be processed are obtained based on the quality evaluation text and content description text of the image to be processed, and the image features of the image to be processed are obtained based on the information of multiple image patches of the image to be processed.

[0071] Step S206: Using the multi-head attention network of the image detection model, the fused text features of the image to be processed are obtained based on the quality text features and content text features of the image to be processed.

[0072] Step S208: Using the forgery adaptation network of the image detection model, the enhanced image-text features of the image to be processed are obtained based on the fused text features and image features of the image to be processed.

[0073] Step S210: Using the classification network of the image detection model, a detection result indicating whether the image to be processed is a forged image is obtained based on the enhanced image and text features of the image to be processed.

[0074] In this embodiment, the image detection model sequentially includes a CLIP (Contrastive Language-Image Pre-Training) network, a multi-head attention network, a spoofing adaptation network, and a classification network. The CLIP network is then used to obtain the quality text features and content text features of the image to be processed based on the quality evaluation text and content description text. Furthermore, based on the information from N image patches of the image to be processed, the image features are obtained.

[0075] Then, a multi-head attention network is used to obtain fused text features of the image to be processed based on the quality text features and content text features, thereby enhancing semantic expressiveness. Next, a spoofing adaptation network is used to obtain enhanced image-text features of the image to be processed based on the fused text features and image features, thereby improving the ability to capture artifact features.

[0076] Finally, using a classification network such as a fully connected layer, based on the enhanced image-text features of the image to be processed, the first probability that the image belongs to a forged image and the second probability that it belongs to a real image are calculated. Based on the comparison between the first and second probabilities, it is determined whether the image to be processed is a forged image, thus obtaining the detection result. If the first probability is greater than or equal to the second probability, the detection result is that the image to be processed is a forged image; if the second probability is less than the first probability, the detection result is that the image to be processed is not a forged image, i.e., the image to be processed is a real image.

[0077] In essence, this invention uses quality assessment text and content description text to help the model understand the semantic features of an image. Simultaneously, by fusing quality text features and content text features, the model's semantic expressive ability is enhanced, and by generating enhanced image-text features, the model's ability to capture artifact features is improved. This enhances the detection model's adaptability to unknown generated content, enabling the model to accurately distinguish between forged and real images, thus improving the accuracy and efficiency of AIGC detection.

[0078] Optionally, for step S204, this embodiment of the invention provides a possible implementation.

[0079] Step S204-1: Using a text encoder, the quality evaluation text and content description text of the image to be processed are encoded to obtain the quality text features and content text features of the image to be processed.

[0080] Step S204-2: Each visual encoder is used sequentially to encode multiple image block information of the image to be processed, thereby obtaining the image features of the image to be processed.

[0081] Image features include global image features and multiple local image features; global image features represent the degree of correlation between global information of an image and local information of each image patch; a local image feature represents the degree of correlation between local information of an image patch and local information of other image patches.

[0082] In this embodiment, the CLIP network includes a text encoder and multiple visual encoders, whereby the text encoder processes text information and the visual encoders process image information. For ease of understanding, an example diagram is provided in this embodiment; please refer to [reference needed]. Figure 2 The following will combine Figure 2 Steps S204-1 and S204-2 will be explained.

[0083] First, the quality assessment text, content description text, and information from N image patches of the image to be processed are input into the image detection module. Then, the text encoder of the CLIP network in the image detection module encodes the quality assessment text of the image to be processed, thus obtaining the quality text features of the image to be processed, i.e., f. q Furthermore, by using a text encoder to encode the content description text of the image to be processed, the content text features of the image to be processed, i.e., f, are obtained. c .

[0084] Next, the information of N image patches from the image to be processed is input into the first visual encoder of the CLIP network. The first visual encoder encodes these N image patches to obtain the intermediate image features output by the first visual encoder. Furthermore, for each of the other visual encoders, the intermediate image features output by the previous visual encoder are encoded to obtain the intermediate image features output by that other visual encoder. Finally, the intermediate image features output by the last visual encoder are used as the image features of the image to be processed, i.e., f. x .

[0085] Each visual encoder in the CLIP network has the same structure, comprising a first normalization layer, an attention layer, a second normalization layer, and an MLP (Multilayer Perceptron). The process by which the visual encoder encodes input data to obtain output data is as follows: the first normalization layer normalizes the input data to obtain first normalized data; the attention layer then aggregates the first normalized data to obtain aggregated data; the second normalization layer normalizes the fused input and aggregated data to obtain second normalized data; the MLP then transforms the second normalized data to obtain transformed data; finally, the fused aggregated and transformed data is used as the output data of the visual encoder.

[0086] Furthermore, the image features, i.e., f x The dimension is N+1, which includes a global image feature, i.e. and N local image features Furthermore, global image features, i.e. The global image feature represents all information about the image to be processed, as well as the correlation between this global information and the local information of N image patches. A local image feature represents the local information of an image patch in the image to be processed, as well as the correlation between this local information and the local information of the other N-1 image patches. It is understood that the image features obtained in the embodiments of the present invention not only contain local details but also reflect the global structure, thereby providing multi-level information support for subsequent feature fusion.

[0087] It can be understood that the CLIP network in this embodiment of the invention ensures the effective extraction of text and image information through the collaborative work of the text encoder and the visual encoder, laying a solid foundation for the feature fusion and enhancement of the subsequent multi-head attention network and spoofing adaptation network.

[0088] Optionally, for step S206, this embodiment of the invention provides a possible implementation.

[0089] Step S206-1: Using each attention layer, perform an aggregation operation based on the query vector, key vector, and numerical vector of that attention layer, as well as the quality text features and content text features of the image to be processed, to obtain the attention text features of that attention layer, thus obtaining the attention text features of each attention layer.

[0090] Step S206-2: Using the splicing layer, splicing operation is performed based on the attention text features of all attention layers to obtain spliced ​​text features, and the spliced ​​text features are multiplied with the fusion parameters to obtain the fused text features of the image to be processed.

[0091] In this embodiment, the multi-head attention network includes multiple attention layers and a splicing layer, and each attention layer has a query vector, a key vector, and a numerical vector, while the splicing layer has fusion parameters.

[0092] To facilitate understanding, we will continue with the following... Figure 2 Steps S206-1 and S206-2 will be explained below. For example, suppose a multi-head attention network includes z attention layers, and the query vector, key vector, and numerical vector of the i-th attention layer are represented as follows: Moreover, the fusion parameter is expressed as W. O .

[0093] First, using these z attention layers respectively, the quality text features of the image to be processed, i.e., f q and content text features, i.e. f c An aggregation operation is performed to obtain the attention text features of each of the z attention layers. It is understood that the processing method for each attention layer is similar; for brevity, this embodiment of the invention uses the i-th attention layer as an example. According to the preset clustering formula, the query vector based on the i-th attention layer is... Key vector And numerical vectors There are also the quality text features of the image to be processed, namely f. q Clustering the content text features yields the attention text features h of the i-th attention layer. i The clustering formula is shown below:

[0094]

[0095] Among them, h i f represents the attention text feature of the i-th attention layer. q f represents the quality text features of the image to be processed. c The text features representing the content of the image to be processed. This represents the query vector for the i-th attention layer. This represents the key vector of the i-th attention layer. Let represent the numerical vector of the i-th attention layer, d represent the dimension of the quality text feature, which has the same dimension as the content text feature, and softmax() represents the normalization function.

[0096] Then, each attention layer is processed in a similar manner as described above, resulting in z attention text features, i.e., h1 to h2. z The data is then input into the concatenation layer. Subsequently, the concatenation layer is used to process these z attention text features, i.e., h1 to h2. zPerform a concatenation operation to obtain the concatenated text features. Then, combine the concatenated text features with the fusion parameter W. O Multiplying them yields the fused text features of the image to be processed, i.e., t. x This process can be represented as: t x =Concat(h1,h2,…h i ,…,h z )*W O ; where t x h represents the fused text features of the image to be processed. i W represents the attention text feature of the i-th attention layer. O This represents the fusion parameter, and Concat() represents the concatenation operation.

[0097] In essence, the multi-head attention network in this embodiment of the invention achieves effective fusion of quality text features and content text features of the image to be processed through the collaborative work of its multiple attention layers and splicing layers. This process not only preserves the key information of the input features but also enhances the model's ability to focus on important features through the attention mechanism, laying the foundation for feature enhancement in subsequent forgery adaptation networks.

[0098] Optionally, for step S208, this embodiment of the invention provides a possible implementation.

[0099] Step S208-1: Using the connection layer, perform fusion and extraction operations based on the fused text features and global image features of the image to be processed to obtain fused image-text features. Then, perform a stitching operation based on the fused image-text features and multiple local image features to obtain the initial image-text features of the image to be processed.

[0100] Step S208-2: Using a transform layer, a transform operation is performed based on the initial image and text features of the image to be processed to obtain the transformed image and text features of the image to be processed.

[0101] Step S208-3: Using the interaction layer, an enhancement operation is performed based on the transformed graphic features of the image to be processed to obtain the enhanced graphic features of the image to be processed.

[0102] In this embodiment, the spoofing adaptation network sequentially includes a connection layer, a transformation layer, and an interaction layer. For ease of understanding, the following will continue to describe... Figure 2 Steps S208-1 to S208-3 will be explained.

[0103] First, using a connection layer, based on the fused text features of the image to be processed, i.e., t x and global image features A fusion operation is performed to obtain fused features. Furthermore, the fast feedforward network block in the connection layer is used to extract these fused features, enriching the feature representation, thus obtaining the fused image-text features. Furthermore, the fast forward network consists of a normalization layer, a linear layer, an activation layer, and a dropout layer in sequence.

[0104] Subsequently, using a connection layer, based on the fused image and text features, and N local image features By performing the stitching operation, the initial image-text features of the image to be processed, i.e., f′, are obtained. x This process can be represented as: Where, f′ x This represents the initial image and text features of the image to be processed. This indicates the fusion of text and image features. This represents N local image features of the image to be processed, and Concat() represents the concatenation operation.

[0105] Next, using a transform layer, based on the initial image-text features of the image to be processed, i.e., f′ x By performing a transformation operation, the transformed graphic features of the image to be processed are obtained. Finally, using the interaction layer, the transformed image features of the image to be processed are... After performing enhancement operations, the enhanced image features f of the image to be processed are obtained. These enhanced image features f are then input into the classification network of the image detection module. Using this classification network, the system determines whether the image to be processed is a forged image based on its enhanced image features f, thus obtaining the detection result.

[0106] It can be understood that the forgery adaptation network in this embodiment of the invention combines fused text features with visual features, i.e., image features, through step-by-step processing of connection layer, transformation layer and interaction layer, which enhances the model's ability to identify visual forgery features, improves the model's generalization ability in the face of unknown AIGC images, and lays a solid foundation for subsequent accurate detection of image categories.

[0107] Optionally, for step S208-2, this embodiment of the invention provides a possible implementation.

[0108] Step S208-2-1: Using a transformation layer, a dimensionality reduction operation is performed based on the initial image and text features of the image to be processed to obtain the first image and text features.

[0109] Step S208-2-2: Using the transform layer, perform Fourier transform and inverse Fourier transform operations based on the first image and text features to obtain the second image and text features.

[0110] Step S208-2-3: Using the transform layer, perform dimensionality restoration based on the second image-text features to obtain the transformed image-text features of the image to be processed.

[0111] For ease of understanding, the embodiments of the present invention provide an example diagram of the transformation layer structure. Please refer to [link / reference]. Figure 3 The following will combine Figure 3 Steps S208-2-1 to S208-2-3 will be explained.

[0112] For example, the transform layer sequentially includes a first network block, a second network block, and an upsampling convolutional layer. The first network block includes a downsampling convolutional layer, an activation layer, and a dropout layer, while the second network block includes a Fourier transform layer, a convolutional layer, a batch normalization layer, an activation layer, and an inverse Fourier transform layer.

[0113] First, using the first network block of the transform layer, based on the initial image-text features of the image to be processed, i.e., f′ x Dimensionality reduction is performed. This involves using downsampling convolutional layers to reduce the initial image features, f′, of the image to be processed. x Perform a downsampling operation to reduce the initial image and text features, i.e., f′. x The dimension is halved to obtain downsampled image-text features; then, an activation layer is used to activate the downsampled image-text features to obtain activated image-text features; and finally, a dropout layer is used to discard the activated image-text features to obtain the first image-text feature.

[0114] This process can be represented as: in, f′ represents the first image-text feature. x This represents the initial image and text features of the image to be processed. Conv1() represents the downsampling operation, ReLU() represents the activation operation, and Dropout() represents the dropout operation.

[0115] Then, using the second network block of the transform layer, based on the first image and text features, Perform Fourier transform and inverse Fourier transform operations. That is, use the Fourier transform layer to process the first image / text features... A Fourier transform operation is performed to obtain the transformed features; then, a convolutional layer is used to perform a convolution operation on the transformed features to obtain convolutional features; a batch normalization layer is used to perform a batch normalization operation on the convolutional features to obtain normalized features; an activation layer is used to perform an activation operation on the normalized features to obtain activated features; finally, an inverse Fourier transform layer is used to perform an inverse Fourier transform operation on the activated features to obtain the second image-text feature.

[0116] This process can be represented as: in, Indicates the second graphic feature; The first image and text feature is represented by FFT(), which represents the Fourier transform operation; Conv() represents the convolution operation; BN() represents the batch normalization operation; ReLU() represents the activation operation; and IFFT() represents the inverse Fourier transform operation.

[0117] Finally, using the upsampling convolutional layer of the transform layer, an upsampling operation is performed based on the second image-text features to restore the dimension of the second image-text features to the dimension of the initial image-text features, thus obtaining the transformed image-text features of the image to be processed. This process can be represented as: in, Represents the transformed graphic features of the image to be processed; This indicates the second image / text feature; Conv2() indicates the upsampling operation.

[0118] In essence, the transform layer in this invention converts image and text features into frequency features through dimensionality reduction and Fourier transform, restores the frequency features to the spatial domain through inverse Fourier transform, and obtains high-frequency detail information through upsampling. That is, by effectively combining the spatial and frequency domains, the model's ability to capture image artifacts and distortion patterns is improved, thereby enhancing the model's discriminative ability.

[0119] Optionally, for step S208-3, this embodiment of the invention provides a possible implementation.

[0120] Step S208-3-1: Using the interactive layer, wavelet transform is performed on the transformed image features of the image to be processed to obtain multi-band features.

[0121] Step S208-3-2: Using the interaction layer, high-frequency band features are obtained from the multi-frequency band features and enhanced and wavelet inverse transform operations are performed to obtain high-frequency image and text features.

[0122] Step S208-3-3: Using the interaction layer, a fusion operation is performed based on high-frequency image and text features and transformed image and text features to obtain the enhanced image and text features of the image to be processed.

[0123] For ease of understanding, this embodiment of the invention provides a structural example diagram of the interaction layer. Please refer to [link / reference]. Figure 4 The following will combine Figure 4 Steps S208-3-1 to S208-3-3 will be explained.

[0124] For example, the interaction layer sequentially includes a wavelet transform layer, two attention blocks, a linear block, a normalization layer, an inverse wavelet transform layer, and a fusion layer. The attention block includes an attention layer, a dropout layer, and a standard deviation layer; the linear block includes a first network layer composed of a linear layer, an activation layer, and a dropout layer, and a second network layer composed of a linear layer and a dropout layer.

[0125] First, using the wavelet transform layer of the interactive layer, the transformed image features of the image to be processed are... A wavelet transform operation is performed to obtain multi-band features. These multi-band features include low-frequency band features, i.e. And high-frequency band features, and the high-frequency band features include three high-frequency sub-band features, namely the first high-frequency sub-band feature, i.e. The second high-frequency sub-band characteristic is... The third high-frequency sub-band characteristic is... Moreover, the first high-frequency subband characteristic is... This indicates the transformation of graphic features, i.e. The vertical edge features, the second high-frequency sub-band features, are This indicates the transformation of graphic features, i.e. The lateral edge features, the third high-frequency sub-band features, are This indicates the transformation of graphic features, i.e. The diagonal features.

[0126] Then, using the two attention blocks, linear block, and normalization layer of the interaction layer, the features of these three high-frequency sub-bands are processed. Enhancement operations are performed to obtain high-frequency enhanced features; then, using the wavelet inverse transform layer of the interactive layer, an inverse wavelet transform operation is performed on the high-frequency enhanced features to obtain the high-frequency image-text features.

[0127] Finally, utilizing the fusion layer of the interaction layer, based on high-frequency image and text features, and transforming image and text features A fusion operation is performed. This involves using a fusion layer to combine a preset adjustment parameter α with high-frequency image and text features. The result of the multiplication, along with the transformed graphic features, is... Adding these features together yields the enhanced image-text features, f, of the image to be processed. This process can be represented as: Where f represents the enhanced image-text features of the image to be processed; Indicates the transformation of graphic features; α represents the adjustment parameter; It represents high-frequency graphic and textual features.

[0128] It can be understood that the interaction layer of this invention combines high-frequency information through wavelet transform, high-frequency enhancement, inverse wavelet transform, and fusion operations to enhance the model's sensitivity to artifact features and improve the model's discrimination ability.

[0129] Optionally, for the image detection model described above, this invention also provides an implementation method for training the image detection model; please refer to [link to relevant documentation]. Figure 5 .

[0130] Step S212: Based on multiple image samples and their labels, obtain the quality evaluation text and content description text for each image sample, as well as multiple image block information for each image sample.

[0131] In this embodiment, multiple original images can be acquired first, and each original image can be preprocessed. For example, after performing operations such as scaling, data augmentation, standardization, and regularization on each original image in sequence, each image sample is obtained. The size of the image sample is a preset size, such as 224*224. Data augmentation refers to randomly adjusting the brightness, saturation, and chroma of the original image. It should be understood that the size of the image sample can be set according to actual conditions, and this invention is not limited thereto.

[0132] Then, the image quality assessment model is used to evaluate the quality of each image sample, and the quality assessment text of each image sample is obtained. The image content generation model is used to extract the content of each image sample, and the initial content description text of each image sample is obtained.

[0133] Next, based on the label and initial content description text of each image sample, a content description text for each image sample is generated. For example, the initial content description text of an image sample is "an image of a dog"; if the label of the image sample is real, then the content description text of the image sample is "a real image of a dog"; if the label of the image sample is fake, then the content description text of the image sample is "a fake image of a dog".

[0134] It should be noted that during model training, an initial content description text for the image is generated from the image's label and content, which is then used to generate the image's content description text. However, when using the model, this content description text, generated from the image content generation model, is directly used as the final content description text for the image.

[0135] Meanwhile, according to the preset block parameter N, each image sample is divided into N image blocks, and a linear mapping operation is performed on all image blocks in each image sample to obtain the N image block information of each image sample.

[0136] Step S214: Using the CLIP network of the image detection model to be trained, the quality text features and content text features of the image samples are obtained based on the quality evaluation text and content description text of the image samples, and the image features of the image samples are obtained based on the information of multiple image blocks of the image samples.

[0137] Step S216: Using the multi-head attention network of the image detection model to be trained, the fused text features of the image samples are obtained based on the quality text features and content text features of the image samples.

[0138] Step S218: Using the forgery adaptation network of the image detection model to be trained, the enhanced image-text features of the image samples are obtained based on the fusion of text features and image features of the image samples.

[0139] Step S220: Using the classification network of the image detection model to be trained, a detection result indicating whether an image sample is a forged image is obtained based on the enhanced image and text features of the image sample.

[0140] In this embodiment, the image detection model to be trained has the same structure as the image detection model, except that the network parameters differ. Specifically, the image detection model to be trained includes a CLIP network, a multi-head attention network, a spoofing adaptation network, and a classification network. For each image sample, the CLIP network is first used to obtain the quality text features and content text features of the image sample based on its quality evaluation text and content description text. Furthermore, based on the information from N image patches of the image sample, the image features of the image sample are obtained.

[0141] Then, a multi-head attention network is used to obtain the fused text features of the image samples based on the quality text features and content text features. Next, a forgery adaptation network is used to obtain the enhanced image-text features of the image samples based on the fused text features and image features. Finally, a classification network is used to determine whether the image sample is a forgery based on the enhanced image-text features, thus obtaining the detection result of the image sample.

[0142] Step S222: Train the image detection model to be trained based on the label and detection result of each image sample to obtain the image detection model.

[0143] In this embodiment, each image sample is processed in a similar manner to obtain the detection result for each image sample. Then, using a preset cross-loss function, a cross-loss value is calculated based on the label and detection result of each image sample. Furthermore, using a preset contrastive loss function, a contrastive loss value is calculated based on the fused text features and image features of each image sample.

[0144] Next, the result of multiplying the preset hyperparameters by the contrastive loss value is added to the crossover loss value to obtain the total loss value. This process can be represented as: in, This represents the total loss value. Let λ represent the cross-loss value, and let λ represent the hyperparameter. This indicates the comparison loss value.

[0145] Finally, the backpropagation algorithm is used to guide the training of the image detection model based on the total loss value, thereby updating the network parameters in the model and obtaining the image detection model. It should be noted that during model training, since the CLIP network is a pre-trained network, its parameters are frozen and not updated; however, the multi-head attention network, spoofing adaptation network, and classification network are untrained, and their parameters are updated.

[0146] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of an image detection device is given below. Please refer to... Figure 6 This is a functional block diagram of the image detection device provided in this embodiment of the invention. It should be noted that the image detection device 300 provided in this embodiment has the same basic principle and technical effects as the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The image detection device 300 includes:

[0147] The preprocessing module 310 is used to determine the quality evaluation text and content description text of the image to be processed, as well as information on multiple image blocks of the image to be processed.

[0148] The detection module 330 is used to obtain quality text features and content text features of the image to be processed based on the quality evaluation text and content description text of the image to be processed using the CLIP network of the image detection model, and to obtain image features of the image to be processed based on multiple image patch information of the image to be processed; to obtain fused text features of the image to be processed based on the quality text features and content text features of the image to be processed using the multi-head attention network of the image detection model; to obtain enhanced image-text features of the image to be processed based on the fused text features and image features of the image to be processed using the forgery adaptation network of the image detection model; and to obtain a detection result indicating whether the image to be processed is a forged image based on the enhanced image-text features of the image to be processed using the classification network of the image detection model.

[0149] Optionally, the detection module 330 is further configured to: use a text encoder to encode the quality evaluation text and content description text of the image to be processed, respectively, to obtain the quality text features and content text features of the image to be processed; and sequentially use each visual encoder to encode the information of multiple image blocks of the image to be processed, to obtain the image features of the image to be processed; wherein, the image features include global image features and multiple local image features; the global image features represent the degree of correlation between the global information of the image and the local information of each image block; and a local image feature represents the degree of correlation between the local information of an image block and the local information of other image blocks.

[0150] Optionally, the detection module 330 is further configured to: utilize each attention layer, perform an aggregation operation based on the query vector, key vector, and numerical vector of that attention layer, as well as the quality text features and content text features of the image to be processed, to obtain the attention text features of that attention layer, thus obtaining the attention text features of each attention layer; utilize the splicing layer, perform a splicing operation based on the attention text features of all attention layers to obtain spliced ​​text features, and multiply the spliced ​​text features with the fusion parameters to obtain the fused text features of the image to be processed.

[0151] Optionally, the detection module 330 is further configured to: utilize a connection layer to perform fusion and extraction operations based on the fused text features and global image features of the image to be processed, to obtain fused image-text features, and perform a concatenation operation based on the fused image-text features and multiple local image features to obtain the initial image-text features of the image to be processed; utilize a transformation layer to perform a transformation operation based on the initial image-text features of the image to be processed, to obtain the transformed image-text features of the image to be processed; and utilize an interaction layer to perform an enhancement operation based on the transformed image-text features of the image to be processed, to obtain the enhanced image-text features of the image to be processed.

[0152] Optionally, the detection module 330 is further configured to: use a transform layer to perform dimensionality reduction based on the initial image and text features of the image to be processed to obtain first image and text features; use a transform layer to perform Fourier transform and inverse Fourier transform operations based on the first image and text features to obtain second image and text features; and use a transform layer to perform dimensionality restoration operations based on the second image and text features to obtain transformed image and text features of the image to be processed.

[0153] Optionally, the detection module 330 is further configured to: use the interaction layer to perform wavelet transform operation on the transformed image features of the image to be processed to obtain multi-band features; use the interaction layer to obtain high-frequency band features from the multi-band features and perform enhancement operation and inverse wavelet transform operation to obtain high-frequency image features; and use the interaction layer to perform fusion operation based on high-frequency image features and transformed image features to obtain enhanced image features of the image to be processed.

[0154] Optionally, the image detection model is obtained as follows: Based on multiple image samples and their labels, quality evaluation text and content description text for each image sample, as well as multiple image patch information for each image sample; using the CLIP network of the image detection model to be trained, quality text features and content text features of the image sample are obtained based on the quality evaluation text and content description text, and image features of the image sample are obtained based on the multiple image patch information; using the multi-head attention network of the image detection model to be trained, fused text features of the image sample are obtained based on the quality text features and content text features; using the forgery adaptation network of the image detection model to be trained, enhanced image-text features of the image sample are obtained based on the fused text features and image features; using the classification network of the image detection model to be trained, a detection result indicating whether the image sample is a forged image is obtained based on the enhanced image-text features; and the image detection model to be trained is trained based on the label and detection result of each image sample to obtain the image detection model.

[0155] Please see Figure 7 This is a block diagram of an electronic device provided in an embodiment of the present invention. The electronic device 100 includes a processor 110, a memory 120, and a communication module 130. These components are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0156] The processor 110 is used to read / write data or programs stored in the memory 120 and perform corresponding functions. It can be a general-purpose processor, including CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be a DSP digital signal processor, ASIC application-specific integrated circuit, FPGA off-the-shelf programmable gate array or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0157] The memory 120 is used to store programs or data. The memory 120 can be RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0158] The communication module 130 is used for signaling or data communication with other devices.

[0159] Understandable, Figure 7 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 7 The more or fewer components shown, or having the same Figure 7 The different configurations shown. Figure 7 The components shown can be implemented using hardware, software, or a combination thereof.

[0160] The electronic device provided in this embodiment of the invention has a memory that stores a computer program. When the processor executes the computer program, it implements the image detection method disclosed in this embodiment of the invention.

[0161] This invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the image detection method disclosed in this invention.

[0162] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0163] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0164] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0165] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An image detection method, characterized in that, The method includes: The quality evaluation text and content description text of the image to be processed are determined, as well as multiple image patch information of the image to be processed. The quality evaluation text is used to represent the distortion or quality characteristics of the image to be processed, and the content description text is used to describe the specific content of the image to be processed. Using the CLIP network of the image detection model, the quality text features and content text features of the image to be processed are obtained based on the quality evaluation text and content description text of the image to be processed, and the image features of the image to be processed are obtained based on multiple image patch information of the image to be processed. Using a multi-head attention network of an image detection model, the fused text features of the image to be processed are obtained based on the quality text features and content text features of the image to be processed. By utilizing the forgery adaptation network of the image detection model, the enhanced image-text features of the image to be processed are obtained based on the fused text features and image features of the image to be processed. By utilizing the classification network of the image detection model, a detection result indicating whether the image to be processed is a forged image is obtained based on the enhanced image-text features of the image to be processed.

2. The image detection method according to claim 1, characterized in that, The CLIP network includes a text encoder and multiple visual encoders; Using the CLIP network of the image detection model, quality text features and content text features of the image to be processed are obtained based on the quality evaluation text and content description text of the image to be processed. Furthermore, image features of the image to be processed are obtained based on multiple image patch information, including: Using the text encoder, the quality evaluation text and content description text of the image to be processed are encoded respectively to obtain the quality text features and content text features of the image to be processed. Each visual encoder is used sequentially to encode multiple image block information of the image to be processed, thereby obtaining the image features of the image to be processed; The image features include global image features and multiple local image features; the global image features represent the correlation between the global information of the image and the local information of each image block; each local image feature represents the correlation between the local information of an image block and the local information of other image blocks.

3. The image detection method according to claim 1, characterized in that, The multi-head attention network includes multiple attention layers and a splicing layer. Each attention layer has a query vector, a key vector, and a numerical vector. The splicing layer has fusion parameters. Using a multi-head attention network of an image detection model, the fused text features of the image to be processed are obtained based on the quality text features and content text features of the image to be processed, including: By using each attention layer, an aggregation operation is performed based on the query vector, key vector, and numerical vector of that attention layer, as well as the quality text features and content text features of the image to be processed, to obtain the attention text features of that attention layer, thus obtaining the attention text features of each attention layer; Using the splicing layer, splicing operations are performed based on the attention text features of all attention layers to obtain spliced ​​text features, and the spliced ​​text features are multiplied by the fusion parameters to obtain the fused text features of the image to be processed.

4. The image detection method according to claim 1, characterized in that, The forgery adaptation network includes a connection layer, a transformation layer, and an interaction layer; the image features include global image features and multiple local image features. Using a forgery adaptation network in an image detection model, enhanced image-text features of the image to be processed are obtained based on the fused text and image features of the image to be processed, including: Using the connection layer, fusion and extraction operations are performed based on the fused text features of the image to be processed and the global image features to obtain fused image-text features. Then, based on the fused image-text features and the multiple local image features, a splicing operation is performed to obtain the initial image-text features of the image to be processed. Using the transformation layer, a transformation operation is performed based on the initial image and text features of the image to be processed to obtain the transformed image and text features of the image to be processed. Using the interaction layer, enhancement operations are performed based on the transformed graphic features of the image to be processed to obtain the enhanced graphic features of the image to be processed.

5. The image detection method according to claim 4, characterized in that, Using the transformation layer, a transformation operation is performed based on the initial image-text features of the image to be processed to obtain the transformed image-text features of the image to be processed, including: Using the transformation layer, a dimensionality reduction operation is performed based on the initial image and text features of the image to be processed to obtain the first image and text features; Using the transformation layer, Fourier transform and inverse Fourier transform operations are performed based on the first image and text features to obtain the second image and text features; Using the transformation layer, a dimension restoration operation is performed based on the second image-text features to obtain the transformed image-text features of the image to be processed.

6. The image detection method according to claim 4, characterized in that, Using the interaction layer, enhancement operations are performed based on the transformed image-text features of the image to be processed to obtain the enhanced image-text features of the image to be processed, including: Using the interaction layer, wavelet transform is performed on the transformed graphic features of the image to be processed to obtain multi-band features; Using the interaction layer, high-frequency band features are obtained from the multi-frequency band features and enhanced and wavelet inverse transform operations are performed to obtain high-frequency image and text features; Using the interaction layer, a fusion operation is performed based on high-frequency image features and transformed image features to obtain the enhanced image features of the image to be processed.

7. The image detection method according to claim 1, characterized in that, The image detection model was obtained in the following manner: Based on multiple image samples and their labels, obtain the quality evaluation text and content description text for each image sample, as well as information on multiple image blocks for each image sample; Using the CLIP network of the image detection model to be trained, the quality text features and content text features of the image sample are obtained based on the quality evaluation text and content description text of the image sample, and the image features of the image sample are obtained based on multiple image patch information of the image sample. Using a multi-head attention network of the image detection model to be trained, the fused text features of the image samples are obtained based on the quality text features and content text features of the image samples. By utilizing the forgery adaptation network of the image detection model to be trained, the enhanced image-text features of the image samples are obtained based on the fused text features and image features of the image samples. By utilizing the classification network of the image detection model to be trained, and based on the enhanced image-text features of the image sample, a detection result indicating whether the image sample is a forged image is obtained; The image detection model is trained based on the label and detection result of each image sample to obtain the image detection model.

8. An image detection device, characterized in that, The device includes: The preprocessing module is used to determine the quality evaluation text and content description text of the image to be processed, as well as multiple image block information of the image to be processed. The quality evaluation text is used to represent the distortion or quality characteristics of the image to be processed, and the content description text is used to describe the specific content of the image to be processed. The detection module is used to obtain the quality text features and content text features of the image to be processed based on the quality evaluation text and content description text of the image to be processed using the CLIP network of the image detection model, and to obtain the image features of the image to be processed based on multiple image patch information of the image to be processed. Using a multi-head attention network of an image detection model, the fused text features of the image to be processed are obtained based on the quality text features and content text features of the image to be processed. By utilizing the forgery adaptation network of the image detection model, the enhanced image-text features of the image to be processed are obtained based on the fused text features and image features of the image to be processed. By utilizing the classification network of the image detection model, a detection result indicating whether the image to be processed is a forged image is obtained based on the enhanced image-text features of the image to be processed.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and when the processor executes the computer program, it implements the image detection method according to any one of claims 1-7.

10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the image detection method according to any one of claims 1-7.