A method, device, medium and product for detecting a fake image
By dividing an image into local regions, constructing a region dependency map, and extracting style features, the shortcomings of existing technologies in small sample and cross-domain forgery detection are addressed, achieving efficient forgery image detection.
Patent Information
- Application Number
- CN202511493310.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing technologies for detecting forged images perform poorly in scenarios with small samples or scarce labels, neglect the sensitivity of local regions, and have poor cross-domain adaptability, making it difficult to meet diverse forgery detection needs.
By dividing an image into multiple local regions and constructing a region dependency map, style features are extracted using local and global network models, fused through an attention model, and combined with a classifier for forgery detection.
It improves the sensitivity and detection accuracy of local forgery under conditions with few samples, enhances the model's generalization ability, and adapts to complex and diverse forgery detection scenarios.
Smart Images

Figure CN120953779B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of fake image detection, in particular, to a fake image detection method, device, medium and product. BACKGROUND
[0002] With the rapid development of deep learning technology, especially the wide application of generative adversarial networks (GAN) in image generation field, the generation quality of fake images has reached the level of false appearance. Such technology is widely used in visual tasks such as face replacement, expression migration, image repair, style migration, etc., which brings convenience, but also poses a serious challenge to the authenticity of image content. At present, fake images have potential misleading and harmfulness in the fields of news media, social platforms, financial security, etc., therefore, it is of great significance to carry out high-precision and strong-robustness fake image detection research.
[0003] The current mainstream image fake detection methods can be roughly divided into the following three categories:
[0004] (1) End-to-end detection method based on classifier, which directly classifies real and fake images by constructing a deep neural network model;
[0005] (2) Feature extraction and anomaly detection based method, which extracts some level of features of the image first, and then detects the fake anomaly;
[0006] (3) Frequency domain analysis based method, which captures the abnormal pattern of frequency domain signal in fake images through Fourier transform and other means.
[0007] Although the above methods improve the detection performance and automation to some extent, there are still the following significant deficiencies in practical application:
[0008] (1) Strong dependence on a large number of labeled fake samples: current methods usually rely on large-scale fake image datasets for supervised training, and perform significantly worse in small sample or label-scarce scenarios, making it difficult to apply to actual environments where data is insufficient or emerging fake methods are constantly emerging;
[0009] (2) Ignoring the sensitivity of local regions of the image: most detection methods focus on the statistical distribution and structural information of the whole image, often ignoring the style abnormalities exhibited by local regions (such as edges, textures, etc.) in fake images, resulting in insufficient recognition ability for detail forgery;
[0010] (3) Insufficient model generalization ability and poor cross-domain adaptability: when facing unknown forgery methods or different data distributions (such as different image styles, sources or forgery tools), the model shows poor transferability and is difficult to meet the complex and diverse forgery detection scenarios.
[0011] In summary, the prior art still has significant bottlenecks in dealing with insufficient samples, local forgery identification and cross-domain detection. Therefore, it is urgent to propose a new method for detecting forged images that can effectively model local area features under the condition of few samples and has good generalization ability to adapt to the current multi-source, diversified and high-precision forgery detection needs. SUMMARY
[0012] In view of the problems in the prior art that the method is strongly dependent on a large number of forged samples, lacks sensitivity to key local areas, and has weak generalization ability in cross-domain detection tasks, the present application provides a forged image detection method, device, medium and product, which is oriented to local areas, fuses style features and has few sample detection capability, and can improve the forged image detection capability.
[0013] In a first aspect, the present application provides a forged image detection method, comprising:
[0014] dividing the input image into a plurality of local areas to construct a region dependency graph of the local areas;
[0015] extracting local style features from the region dependency graph using a local network model;
[0016] extracting global style features of the input image using a global network model;
[0017] performing attention fusion on the local style features and the global style features using an attention model to obtain a fusion vector;
[0018] performing image forgery detection on the fusion vector using a classifier;
[0019] wherein the local network model, the global network model, the attention model and the classifier are optimized through training.
[0020] In a preferred embodiment, the input image is divided into a plurality of local areas to construct a region dependency graph of the local areas, comprising:
[0021] applying a local key point detector to the input image to obtain local key point coordinate information, thereby dividing the input image into a plurality of semantically related local areas;
[0022] constructing a region dependency graph according to the divided local areas; the region dependency graph is represented as wherein each node in the node set corresponds to a local area, and each edge in the edge set represents that the corresponding local areas have dependency or semantic correlation.
[0023] In a preferred embodiment, the local network model is a first UNet-GRU network, the first UNet-GRU network comprising a UNet encoder and a GRU network connected in sequence; wherein an independent first UNet-GRU network is used to extract local style features for each region dependency graph.
[0024] In a preferred embodiment, the global network model is a second UNet-GRU network, the second UNet-GRU network comprising a UNet encoder and a GRU network connected in sequence.
[0025] In a preferred embodiment, the attention model is used to fuse the local style features and the global style features to obtain a fusion vector, comprising:
[0026] Inputting all local region features into an LSTM network to obtain dependency features of the local region;
[0027] For each local region, the dependency features of the neighbor local regions are weighted according to the weighted fusion of the region dependency graph to obtain weighted dependency features of the local region;
[0028] Fusing the global style features with each weighted dependency feature to obtain region fusion features;
[0029] Based on the region fusion features, an image-level fusion vector is generated through attention pooling.
[0030] In a preferred embodiment, the weighted fusion in the region dependency graph is a weighted fusion dependency based on spatial dependency and style dependency.
[0031] The spatial dependency is a spatial dependency based on weighted Euclidean distance.
[0032] The style dependency is a style dependency based on feature vector similarity.
[0033] In a preferred embodiment, the classifier is an MLP classifier, the fusion vector is input into the MLP classifier, and the MLP classifier outputs an image forgery probability score and a classification result.
[0034] In a second aspect, the present application provides an electronic device, comprising:
[0035] at least one processor; and a memory connected in communication with the at least one processor;
[0036] The memory stores instructions executable by the at least one processor, and the at least one processor executes the instructions stored in the memory, so that the at least one processor executes the above-mentioned method.
[0037] In a third aspect, the present application provides a computer readable storage medium for storing instructions which, when executed, cause the above method to be implemented.
[0038] In a fourth aspect, the present application provides a computer program product which, when invoked by a computer, causes the computer to perform the above method.
[0039] In summary, due to the adoption of the above technical solutions, the present application has the following beneficial effects:
[0040] 1. Reducing dependence on the number of counterfeit samples
[0041] The present application introduces a region-dependent graph and a style modeling mechanism, so that the model can capture key counterfeit features even in the case of limited counterfeit samples, effectively alleviating the problem of performance decline of traditional methods in the few-sample scenario.
[0042] 2. Enhancing sensitivity to local detail forgery
[0043] The present application divides the image into multiple semantically related local regions and independently extracts the style features of each local region, and combines the dependency relationship of the region-dependent graph for fusion, significantly improving the model's detection ability for subtle forgery (such as eye reflection, mouth edge, etc.), and improving the discriminability of local regions.
[0044] 3. Improving the discriminability and generalization performance of the model
[0045] The present application introduces a style-aware attention mechanism, enabling the model to adaptively focus on local regions with high forgery likelihood and integrate global style context information, thereby improving the accuracy and robustness of forgery detection, especially when dealing with different forgery sources or cross-domain forged images, showing better generalization ability.
[0046] Thus, the present application is not only suitable for the sample insufficient scenario, but also can realize forgery image detection in complex forgery environment, having important theoretical value and wide practical application prospect. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 A flowchart of a forgery image detection method based on few-sample local region sensitive style provided by an embodiment of the present application.
[0048] Figure 2 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will be combined with the drawings in the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0051] Embodiments
[0052] In view of the problems in the prior art that a large number of fake samples are strongly dependent, the sensitivity to key local areas is insufficient, and the generalization ability in cross-domain detection tasks is weak, the embodiments of the present application provide a fake image detection method, which can maintain high recognition accuracy and robustness in sample scarce, local detail fake and cross-domain fake detection scenes. The method realizes fake image detection through the steps of region division, modeling region dependency graph, local and global style feature extraction, attention fusion and discriminant classification.
[0053] In view of this, as Figure 1 shown, the embodiments of the present application provide a fake image detection method based on few-sample local region sensitive style, including the following steps:
[0054] S100, dividing an input image into a plurality of local regions to construct a region dependency graph of the local regions;
[0055] S200, extracting local style features from the region dependency graph using a local network model;
[0056] S300, extracting global style features of the input image using a global network model;
[0057] S400, performing attention fusion on the local style features and the global style features using an attention model to obtain a fusion vector;
[0058] S500, performing image fake detection on the fusion vector using a classifier;
[0059] Among them, the local network model, the global network model, the attention model and the classifier are optimized through training.
[0060] The specific implementation of the above fake image detection method is described below.
[0061] S100: Divide the input image into multiple local regions and construct region dependency maps for each local region.
[0062] In this embodiment of the invention, a local keypoint detector is applied to the input image to obtain the coordinate information of local keypoints, thereby dividing the input image into semantically relevant categories. Local area For example, a face image can be divided into local areas such as the left eye, right eye, nose tip, corner of mouth, forehead, and chin.
[0063] Subsequently, a Region Dependency Graph (RDG) is constructed based on the divided local regions. This Region Dependency Graph is represented as follows: , where the node set Each node in the set corresponds to a local region, and the edge set Each edge in the diagram represents a dependency or semantic correlation between corresponding local regions, which guides subsequent feature fusion and attention allocation.
[0064] To facilitate subsequent feature fusion and attention allocation, the following three dependencies are calculated for each pair of local regions:
[0065] (1) Spatial dependence based on weighted Euclidean distance:
[0066]
[0067] in, Indicates a local area and local areas Spatial dependency between them For the first A local area, For the first A local area, Indicates a local area and local areas The weighted Euclidean distance between them It is an exponential function with the natural constant e as its base. The spatial scale factor controls the effect of the weighted Euclidean distance on the weight decay.
[0068] The weighted Euclidean distance It can be represented as:
[0069]
[0070] in, For local areas The weight, For local areas The weights can be adjusted based on the size, shape, or other important factors of the local region; For local areas coordinates For local areas The coordinates.
[0071] (2) Style dependency based on feature vector similarity:
[0072]
[0073]
[0074] in, For local areas and local areas Style dependency between them For local areas and local areas cosine similarity, For local areas eigenvectors, For local areas eigenvectors, To indicate the calculation of the norm, It is an exponential function with the natural constant e as its base. The style scaling factor adjusts the effect of cosine similarity on the weights.
[0075] Local area eigenvectors Deep convolutional neural networks can be used to extract local regions Extracting from the local region, the deep convolutional neural network can be selected from networks such as ResNet (Residual Network) and VGG (Visual Geometry Group). Specifically, it extracts from the local region. The input is fed into a trained deep convolutional neural network. The feature map output by the deep convolutional neural network undergoes pooling or dimensionality reduction operations to generate a fixed-size feature vector, which represents the local region. eigenvectors .
[0076] (3) Weighted fusion dependency based on spatial and style dependencies:
[0077]
[0078] in, Indicates a local area and local areas Weighted fusion dependency between them These represent the weighting coefficients of spatial dependency, controlling the proportion of spatial information in the final dependency. This represents the weighting coefficients for style dependence, controlling the proportion of style information.
[0079] In this step, the region dependency graph serves as a static prior structure. This invention divides the input image into several local regions with semantic or structural consistency and constructs a region dependency graph between these regions. This graph describes the spatial or stylistic relationships between local regions, clearly defining the relationships between them and helping to allocate appropriate attention during feature fusion, avoiding interference from redundant information. Furthermore, this region dependency graph modeling mechanism is flexibly applicable to various image types, effectively expressing the internal structural features of the image, effectively focusing on local details, and enhancing sensitivity to forged regions, making it particularly suitable for few-sample forged image detection scenarios. In addition, this region dependency graph will be used in subsequent attention fusion to guide the information flow and saliency allocation between local regions.
[0080] S200 utilizes a local network model to extract local style features from a region dependency graph.
[0081] In this embodiment of the invention, the local network model employs a first UNet-GRU network, which includes a connected UNet (Convolutional Networks for Biomedical Image Segmentation) encoder and a GRU (Gated Recurrent Unit) network; wherein, for each region dependency map, an independent first UNet-GRU network is used to extract local style features. Specifically:
[0082] The region dependency map is input into the UNet encoder to extract the first style features of the local regions, such as color and texture, which are represented as follows:
[0083]
[0084] in, Indicates a local area stylistic features, This indicates the operation of the UNet encoder.
[0085] The first style feature is input into the GRU network to model the spatial dependencies within a local region, resulting in the second style feature of that local region, represented as:
[0086]
[0087] in, for the GRU network operation, for the local region The second style feature is the local style feature to be extracted in this step.
[0088] In this step, each local region in the present application extracts local style features (such as color, texture, contrast, etc.) through a UNet encoder, and models the spatial dependency between local regions through a GRU network to mine potential forgery traces, which can significantly enhance the sensitivity of the model to image detail changes and improve the recognition ability of local forgery.
[0089] S300, extracting global style features of the input image using a global network model;
[0090] In the embodiment of the present application, the global network model is a second UNet-GRU network, and the second UNet-GRU network comprises a UNet encoder and a GRU network connected in series. Specifically:
[0091] The entire input image is input into the second UNet-GRU network to extract the global style features of the input image to provide context information to assist local region judgment, which is represented as:
[0092]
[0093] Wherein, is the global style feature of the input image.
[0094] The second UNet-GRU network provides image overall style information and context constraints, implicitly global dependency between local regions, provides overall reference for local feature fusion, and ensures local and global style consistency. Therefore, the global style encoding of the image is introduced as the global style feature in the present application, which is fused with each local style feature to effectively capture the inconsistency in the image style level and enhance the recognition ability of the model under complex image attack methods such as style transfer forgery and fusion forgery. The global style feature will participate in the subsequent fusion process together with the local style feature to enhance the style consistency judgment ability.
[0095] S400, attention fusion of the local style feature and the global style feature using an attention model to obtain a fusion vector;
[0096] In the embodiment of the present application, the basic network of the attention model LSTM-Attention adopts an LSTM network (Long Short-Term Memory, long short-term memory network), and on this basis, the weighted fusion dependency in the region dependency graph is introduced for attention (Attention) based weight adjustment. Specifically:
[0097] S401, all local region features are input into the LSTM network to model the context relationship between local regions and obtain the dependency features of the local regions, denoted as:
[0098]
[0099] wherein, is the dependency feature of the i-th local region, is the number of features, is the LSTM network operation. n S402, for each local region , the weighted fusion dependency
[0100] of the neighbor local region is obtained according to the weighted fusion dependency graph of the region, and the weighted dependency feature of the local region is obtained by weighting the dependency features of the neighbor local regions:
[0101]
[0102] wherein, is the weighted dependency feature of the local region, is the dependency feature of the i-th neighbor local region in the neighborhood of the local region, is the number of neighbor local regions in the neighborhood of the local region, and the neighbor dependency features are weighted using the structured attention to highlight important regions and suppress irrelevant information; thus, the weighted dependency feature not only contains its own information, but also integrates the neighborhood context to form a more discriminative feature representation. j M S403, the global style feature is fused with each weighted dependency feature to obtain the region fusion feature , denoted as:
[0103]
[0104]
[0105] wherein, denotes a linear projection matrix to make the global style feature consistent with dimension.
[0106] S404, based on the region fusion feature , an image-level fusion vector is generated through attention pooling, denoted as:
[0107]
[0108] wherein, is a fusion vector, is an activation function, denotes the attention weight of the regional fusion feature , is a learnable parameter vector.
[0109] In the feature fusion process, the LSTM network is used to model the contextual relationship between regions, the distribution of attention is limited in combination with the region dependency graph, the saliency of the forged region is helped to be identified, and structured attention fusion is performed, which can automatically identify the saliency of the forged region, and higher weight is allocated to the key region, so as to highlight the key region and suppress the background redundant interference, and the discrimination effect on the local forged region is improved.
[0110] S500, performing image forgery detection on the fusion vector by using a classifier;
[0111] In the embodiment of the application, the classifier adopts an MLP (Multi-Layer Perceptron) classifier. The fusion vector is input into the MLP classifier, and the MLP classifier outputs an image forgery probability score and a classification result.
[0112] The probability score is represented as:
[0113]
[0114] wherein, denotes the probability score of the input image being real (Real) or the probability score of the input image being forged (Fake) , denotes the weight parameter of the MLP classifier, denotes a bias vector.
[0115] The final classification result is represented as:
[0116]
[0117] wherein, the final classification result , denotes the result corresponding to the maximum probability score, that is:
[0118] If the probability score is greater than the probability score , the final classification result is , indicating that the input image is real;
[0119] If the probability score Less than probability score Then the final classification result is , indicating that the input image is fake.
[0120] S600, the local network model, the global network model, the attention model and the classifier can be optimized by repeatedly performing steps S100-S500. In the training phase, a weighted cross-entropy loss function can be used in combination with region regularization, fake sample balancing strategy and other optimization means to improve the stability and generalization ability of the model under the condition of few samples, so as to adapt to the detection requirements of multi-source, diversified and high-precision fake images. The training data can include multiple types of fake images and real images, which can enhance the recognition ability of the model to unknown fake styles.
[0121] Based on the same technical concept, the embodiment of the application also provides an electronic device which can implement the fake image detection method provided by the above-mentioned embodiments of the application. In an embodiment, the electronic device can be a server, a terminal device or other electronic device. As shown in Figure 2 , the electronic device can include:
[0122] at least one processor, and a memory connected with the at least one processor, and the specific connection medium between the processor and the memory in the embodiment of the application is not limited, Figure 2 In the embodiment, the connection between the processor and the memory is taken by bus connection as an example. The bus is represented by a thick line in Figure 2 , and the connection mode between other components is only schematically illustrated and is not limited. The bus can be divided into address bus, data bus, control bus, etc. For convenience, in Figure 2 , only one thick line is used to represent, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor can also be called a controller, and the name is not limited.
[0123] In the embodiment of the application, the memory stores instructions executable by the at least one processor, and the at least one processor can execute the foregoing fake image detection method by executing the instructions stored in the memory.
[0124] The processor is the control center of the device, and can connect all parts of the control device through various interfaces and lines. By running or executing the instructions stored in the memory and calling the data stored in the memory, the device can process various functions and data, thereby monitoring the whole device.
[0125] In an alternative design, the processor can include one or more processing units, and the processor can integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor can also not be integrated into the processor. In some embodiments, the processor and the memory can be implemented on the same chip, and in some embodiments, they can also be implemented on separate chips, respectively.
[0126] The processor can be a general purpose processor, such as a CPU, a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general purpose processor can be a microprocessor or any conventional processor. The steps of the method for detecting a fake image disclosed in conjunction with the embodiments of the present application can be directly embodied as execution by a hardware processor, or a combination of hardware and software modules in the processor.
[0127] The memory, as a non-volatile computer readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The memory can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card type memory, random access memory (RAM), static random access memory (SRAM), programmable read only memory (PROM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. The memory can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but is not limited thereto. The memory in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, for storing program instructions and / or data.
[0128] By designing and programming the processor, the code corresponding to the method for detecting a fake image introduced in the above embodiments can be fixed into the chip, so that the chip can execute the steps of the method of the above embodiments when running. How to design and program the processor is a technology known to those skilled in the art, which will not be described here.
[0129] Based on the same inventive concept, the embodiments of the present application also provide a storage medium, which stores computer instructions, when the computer instructions are run on a computer, the computer instructions make the computer execute the aforementioned counterfeit image detection method.
[0130] In some optional embodiments, the various aspects of the counterfeit image detection method can also be implemented in the form of a program product, which includes program codes, when the program product is run on a device, the program codes are used to make the control device execute the steps of the aforementioned counterfeit image detection method according to various exemplary embodiments of the present application described in the specification.
[0131] It should be noted that although several units or sub-units of the device are mentioned in the foregoing detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into units embodied by multiple units. In addition, although the operations of the method of the present application are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be divided into multiple steps.
[0132] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer-usable program code.
[0133] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as a combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0134] Program code to implement the application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. It will be appreciated that the program code can be implemented in any
[0135] In a networked environment, the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN). Such networks are well known to those having ordinary skill in the art and therefore will not be discussed in any further detail.
[0136] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 function specified in the flow Figure 1 s or blocks in the flow
[0137] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow Figure 1 function specified in the flow Figure 1 s or blocks in the flow
[0138] The above description is intended to be illustrative and not restrictive. Many other changes and modifications can occur to those skilled in the art. These alternatives can be derived from the description and practical experience of the application, and are thus considered to be within the scope of the application. What is claimed is:
Claims
1. A method of detecting a forged image, characterized by, The method comprises the following steps: dividing an input image into a plurality of local regions, and constructing a region dependency graph of the local regions; extracting local style features from the region dependency graph by using a local network model; extracting global style features of the input image by using a global network model; performing attention fusion on the local style features and the global style features by using an attention model to obtain a fusion vector; performing image forgery detection on the fusion vector by using a classifier; wherein the local network model, the global network model, the attention model and the classifier are optimized through training; the step of dividing the input image into a plurality of local regions and constructing a region dependency graph of the local regions comprises: applying a local key point detector to the input image to obtain local key point coordinate information, so as to divide the input image into a plurality of semantically related local regions; constructing a region-dependent graph according to the divided local regions; the region-dependent graph is represented as wherein each node in a node set corresponds to a local region, and each edge in an edge set indicates that there is a dependency or semantic correlation between the corresponding local regions; the step of performing attention fusion on the local style features and the global style features by using an attention model to obtain a fusion vector comprises: inputting all local region features into an LSTM network to obtain dependency features of the local regions; for each local region, performing weighted fusion on the dependency features of the neighbor local regions according to the weighted fusion of the region dependency graph to obtain weighted dependency features of the local region; fusing the global style features with each weighted dependency feature to obtain region fusion features; generating an image-level fusion vector through attention pooling based on the region fusion features; the weighted fusion in the region dependency graph is a weighted fusion dependency based on spatial dependency and style dependency; the spatial dependency is a spatial dependency based on weighted Euclidean distance; the style dependency is a style dependency based on feature vector similarity.
2. The forgery image detection method according to claim 1, characterized by, the local network model is a first UNet-GRU network, and the first UNet-GRU network comprises a UNet encoder and a GRU network connected in sequence; wherein an independent first UNet-GRU network is used to extract local style features for each region dependency graph.
3. The forged image detection method of claim 1, wherein, the global network model is a second UNet-GRU network, and the second UNet-GRU network comprises a UNet encoder and a GRU network connected in sequence.
4. The forgery image detection method according to claim 1, characterized by, the classifier adopts an MLP classifier, and the fusion vector is input into the MLP classifier; the MLP classifier outputs an image forgery probability score and a classification result.
5. An electronic device, comprising: The method comprises the following steps: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor executes the method according to any one of claims 1-4 by executing the instructions stored in the memory.
6. A computer-readable storage medium, characterized in that, The computer readable storage medium is used to store instructions, when the instructions are executed, the method according to any one of claims 1-4 is realized.
7. A computer program product, characterised in that, The computer program product, when invoked by a computer, causes the computer to execute the method according to any one of claims 1-4.
Citation Information
Patent Citations
Counterfeit face detection method, device, equipment and medium
CN120014717A
Deep counterfeit image detection method based on knowledge distillation and domain adversarial training
CN120808126A