Training method of image true and false identification model and image true and false identification method
By acquiring image features and describing features and updating the similarity determination network, the problem of irrelevant semantic interference in image authenticity and false recognition is solved, and the recognition accuracy is improved.
Patent Information
- Application Number
- CN202411997618.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art has unrelated image semantic interference in the recognition of true and false images, resulting in low recognition accuracy, especially when the training sample size is insufficient, the classification network is prone to misjudgment.
By acquiring the features and descriptions of real and fake images, extracting the described features and inputting similarity to the image features is combined with the image features, and updating the network parameters to enhance similarity matching and reduce semantic interference.
It effectively eliminates image semantic interference and improves the accuracy of image authenticity and false recognition, especially when the training sample size is insufficient.
Smart Images

Figure CN119810483A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of artificial intelligence technology, and in particular, to a training method for an image true-false recognition model and an image true-false recognition method. Background Art
[0002] The Text to Image Generation Model is a deep learning model used to generate corresponding images based on a given text description. The Image to Image Model is a deep learning model used to generate new images based on an input image. In recent years, with the development of image generation technologies such as the Text to Image Generation Model and the Image to Image Generation Model, the quality of images generated by artificial intelligence has made a qualitative leap, resulting in the risk of illegal activities such as using generated false images to imitate real celebrity paintings, or using generated false images to imitate real user images for image authentication. Summary of the invention
[0003] The embodiments in this specification aim to provide a training method for an image true-false recognition model and a method for image true-false recognition, which can eliminate the interference of irrelevant image semantics in existing true-false image recognition schemes on image recognition, improve the accuracy of true-false image recognition, and solve the shortcomings of the existing technology.
[0004] According to a first aspect, a method for training an image true and false recognition model is provided, wherein the image true and false recognition model comprises at least a similarity determination network, and the method comprises:
[0005] Acquire a first feature corresponding to a first image known to be a real image and a second feature corresponding to a second image known to be a false image, and acquire a first description corresponding to the first image and a second description corresponding to the second image, wherein the first description includes a first indication that the first image is a real image and the second description includes a second indication that the second image is a false image; extract a third feature corresponding to the first description and a fourth feature corresponding to the second description;
[0006] The first feature, the second feature, the third feature, and the fourth feature are input into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; and a network parameter of the similarity determination network is updated with the purpose of increasing the first similarity and the second similarity.
[0007] In a possible implementation, the first feature, the second feature, the third feature, and the fourth feature are input into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; and with the first similarity and the second similarity tending to increase, a network parameter of the similarity determination network is updated, including:
[0008] Inputting the first feature, the second feature, the third feature, and the fourth feature into a similarity determination network to obtain a first similarity between the first feature and the third feature, a second similarity between the second feature and the fourth feature, a third similarity between the first feature and the fourth feature, and a fourth similarity between the second feature and the third feature;
[0009] With the purpose of increasing the first similarity and the second similarity and decreasing the third similarity and the fourth similarity, the network parameters of the similarity determination network are updated.
[0010] In a possible implementation manner, acquiring a first description corresponding to the first image and a second description corresponding to the second image includes:
[0011] Obtaining a third description corresponding to the first image through a preset image-to-text model, and adding the first indication to the third description to obtain the first description;
[0012] A fourth description corresponding to the second image is obtained through the image-to-text model, and the second indication is added to the fourth description to obtain the second description.
[0013] In a possible implementation, the image authenticity recognition network further includes an image encoder and a text encoder;
[0014] Acquiring a first feature corresponding to the first image and a second feature corresponding to the second image, including: acquiring the first feature corresponding to the first image and the second feature corresponding to the second image through an image encoder;
[0015] Extracting a third feature corresponding to the first description and a fourth feature corresponding to the second description includes: extracting the third feature corresponding to the first description and the fourth feature corresponding to the second description through a text encoder.
[0016] In a possible implementation, updating the network parameters of the similarity determination network with the purpose of increasing the first similarity and the second similarity and decreasing the third similarity and the fourth similarity includes:
[0017] With the purpose of increasing the first similarity and the second similarity and decreasing the third similarity and the fourth similarity, the network parameters of the similarity determination network, the text encoder and the image encoder are updated.
[0018] In a possible implementation, the first indication includes one or more of keywords, key phrases and key sentences indicating that the first image is a real image, and the second indication includes one or more of keywords, key phrases and key sentences indicating that the second image is a false image.
[0019] According to a second aspect, a method for identifying true and false images is provided, comprising:
[0020] Acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image; and extract a sixth feature corresponding to the third description;
[0021] The fifth feature and the sixth feature are input into the similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature; if the third similarity is greater than a preset first threshold, the third image is determined to be a real image.
[0022] According to a third aspect, a method for identifying true and false images is provided, comprising:
[0023] Acquire a fifth feature corresponding to a third image to be tested, and acquire a fourth description corresponding to the third image, wherein the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extract a seventh feature corresponding to the fourth description;
[0024] The fifth feature and the seventh feature are input into the similarity determination network trained by the above method to obtain a fourth similarity between the fifth feature and the seventh feature; if the fourth similarity is less than a preset second threshold, the third image is determined to be a real image.
[0025] According to a fourth aspect, a method for identifying true and false images is provided, comprising:
[0026] Acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image and a fourth description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image, and the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; extract a sixth feature corresponding to the third description and a seventh feature corresponding to the fourth description;
[0027] The fifth feature, the sixth feature, and the seventh feature are input into the similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature, and a fourth similarity between the fifth feature and the seventh feature; if the third similarity is greater than the fourth similarity, the third image is determined to be a real image.
[0028] According to a fifth aspect, a training device for an image true-false identification model is provided, wherein the image true-false identification model comprises at least a similarity determination network, and the device comprises:
[0029] The extraction unit is configured to obtain a first feature corresponding to a first image known to be a real image and a second feature corresponding to a second image known to be a false image, and obtain a first description corresponding to the first image and a second description corresponding to the second image, wherein the first description includes a first indication that the first image is a real image and the second description includes a second indication that the second image is a false image; extract a third feature corresponding to the first description and a fourth feature corresponding to the second description;
[0030] The updating unit is configured to input the first feature, the second feature, the third feature, and the fourth feature into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; and update the network parameters of the similarity determination network with the purpose of increasing the first similarity and the second similarity.
[0031] According to a sixth aspect, there is provided an image authenticity identification device, comprising:
[0032] A first acquisition unit is configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image; and extract a sixth feature corresponding to the third description;
[0033] The first recognition unit is configured to input the fifth feature and the sixth feature into the similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature; if the third similarity is greater than a preset first threshold, determine that the third image is a real image.
[0034] According to a seventh aspect, there is provided an image authenticity identification device, comprising:
[0035] a second acquisition unit configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a fourth description corresponding to the third image, wherein the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extract a seventh feature corresponding to the fourth description;
[0036] The second recognition unit is configured to input the fifth feature and the seventh feature into the similarity determination network trained by the above method to obtain a fourth similarity between the fifth feature and the seventh feature; if the fourth similarity is less than a preset second threshold, determine that the third image is a real image.
[0037] According to an eighth aspect, a device for identifying true or false images is provided, comprising:
[0038] a third acquisition unit configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image and a fourth description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image, and the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extract a sixth feature corresponding to the third description and a seventh feature corresponding to the fourth description;
[0039] The third recognition unit is configured to input the fifth feature, the sixth feature, and the seventh feature into a similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature, and a fourth similarity between the fifth feature and the seventh feature; if the third similarity is greater than the fourth similarity, determine that the third image is a real image.
[0040] According to the ninth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer executes the methods described in the first, second, third and fourth aspects.
[0041] According to the tenth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the methods described in the first, second, third and fourth aspects are implemented.
[0042] By using one or more of the methods, apparatuses, computing devices, and storage media in the above aspects, the interference of irrelevant image semantics on image recognition in existing true and false image recognition schemes can be eliminated, thereby improving the accuracy of true and false image recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0044] Figure 1 A schematic diagram showing a true and false image recognition scheme;
[0045] Figure 2 A schematic diagram showing a training method for an image true and false recognition model according to an embodiment of this specification;
[0046] Figure 3 A flowchart showing a method for training a true and false image recognition model according to an embodiment of this specification;
[0047] Figure 4 A schematic diagram showing the network parameters of the image true and false recognition model updated according to the embodiment of the present specification;
[0048] Figure 5 A flow chart showing a method for identifying true or false images according to an embodiment of the present specification;
[0049] Figure 6 A schematic diagram showing a method for identifying true or false images according to an embodiment of the present specification;
[0050] Figure 7 A flowchart showing a method for identifying true or false images according to another embodiment of the present specification;
[0051] Figure 8 A schematic diagram showing a method for identifying true or false images according to another embodiment of the present specification;
[0052] Fig. 9 A flow chart showing a method for identifying true or false images according to another embodiment of the present specification;
[0053] Fig.10 A schematic diagram showing a method for identifying true or false images according to another embodiment of the present specification;
[0054] Fig.11 A structural diagram showing a training device for an image true and false recognition model according to an embodiment of this specification;
[0055] Fig.12 A structural diagram of an image authenticity identification device according to an embodiment of this specification is shown;
[0056] Fig.13 A structural diagram of an image authenticity identification device according to another embodiment of the present specification is shown;
[0057] Fig.14 A structural diagram of an image authenticity identification device according to another embodiment of the present specification is shown. DETAILED DESCRIPTION
[0058] The solution provided in this invention book will be described below in conjunction with the accompanying drawings.
[0059] In order to clearly describe the training method of the image authenticity recognition model and the image authenticity recognition method provided in the embodiments of this specification, the relevant concepts that may be involved in the embodiments of this specification are first explained.
[0060] The Text to Image Generat ion Model is a deep learning model that generates corresponding images based on a given text description. For example, when a text description such as "a butterfly flying among flowers" is input, the model can output an image containing a scene of a butterfly flying among flowers.
[0061] Image to Image Model is a deep learning model used to generate new images based on input images. For example, new images with similar but not identical features can be created based on the transformation and combination of the features of the input images.
[0062] Image to Text Model is a deep model that can convert image content into text descriptions. It recognizes and understands various visual elements in the image, such as objects, scenes, actions, colors, etc., and then expresses this information in natural language. For example, when inputting a picture of a sunset on the beach, the model may output a text description such as "On the beach, the sun is setting, the sky is dyed orange-red, and the waves are beating on the beach."
[0063] The Contrastive Learning Model is a self-supervised learning model that can learn the data representation of samples by constructing similar sample pairs and dissimilar sample pairs. The core idea of its training is to shorten the distance between the data representations of similar samples and to increase the distance between the data representations of dissimilar samples, so that the model can automatically learn the relationship between samples without labeled data.
[0064] Image Encoder is a neural network used to convert input image data into features corresponding to the image (usually in vector form, or called image encoding). The encoding can capture key information in the image, such as the shape, color, texture of objects in the image, and the spatial relationship between them.
[0065] A text encoder is a neural network or software module used to convert text information into corresponding features (usually in vector form, or called text encoding). The text encoder can convert complex semantic and grammatical information in the text into digital vectors that can be processed by computers.
[0066] As mentioned above, with the development of image generation technologies such as text-generated image models and image-generated image models, there is a risk of using generated false images to impersonate real images. For example, the risk of using generated false images to impersonate real celebrity paintings, or using generated false images to imitate real user images for image authentication and other illegal activities. Therefore, a technical solution for detecting the authenticity of images is needed.
[0067] Existing technical solutions for identifying whether an image is real or fake usually train a classification network through pre-labeled real image samples and fake image samples (such as fake images generated by image generation technology), and use the trained classification network to identify whether the image to be tested is a real image. Figure 1 A schematic diagram of a true or false image recognition scheme is shown. Figure 1 As shown, for example, a false image and a real image can be obtained, and the real image and the false image can be input into the classification network respectively to obtain a prediction value for whether the input image is real. Then, according to the prediction value and the training label of whether the input image is real, the prediction difference is determined, and the classification network is updated according to the prediction difference. Then, the authenticity of the image can be identified through the updated classification network. However, the problem with this solution is that when the amount of training samples is insufficient, the classification network often relies too much on irrelevant image semantics to distinguish the authenticity of the image. For example, when the proportion of face images in the real image samples used for training is large, and the proportion of landscape images in the generated false image samples is large, it can cause the classification network to mistakenly associate face features with real images and landscape features with false images. The probability increases, thereby misjudging most of the input face images as real, and most of the input landscape images as false. In other words, when the amount of training samples is insufficient, it can often lead to poor generalization performance of the classification network.
[0068] In order to solve the above technical problems, the embodiments of this specification provide a training method for an image true and false recognition model. Figure 2 A schematic diagram showing a training method for an image true and false recognition model according to an embodiment of this specification. Figure 2As shown, for example, a real image A and a generated false image B can be obtained, and the image feature Ga corresponding to the real image A and the image feature Gb corresponding to the false image B can be obtained through the image encoder. In addition, a textual image description Ta for the real image A (which may include a clear textual indication that A is a real image) and a textual image description Tb for the false image B (which may include a clear textual indication that B is a false image) are obtained. The textual feature Ta corresponding to the image description Ta and the image feature Tb corresponding to the image description Tb are obtained through the image encoder. Furthermore, the image feature Ga, the textual feature Ta, the image feature Gb, and the textual feature Tb can be input into a similarity confirmation network based on a contrastive learning model, for example, to obtain the similarity C1 between (Ga, Ta), the similarity C2 between (Gb, Tb), the similarity C3 between (Ga, Tb), and the similarity C4 between (Gb, Ta). Then, the network parameters of the similarity confirmation network can be updated with the purpose of C1 and C2 tending to increase and C3 and C4 tending to decrease. The trained image true and false recognition model can be used to confirm whether the image to be tested is a real image.
[0069] The advantages of this method are: by adding clear indications of the authenticity of the image to the description of the image, and by comparative learning of image features and features of the text description of the image, an appropriate degree of decoupling between the judgment of the authenticity of the image and the image semantic features is achieved, that is, the image semantics is separated from the judgment of the authenticity of the image, and the features of the clear text indication of whether the image is real or false are accurately associated with the judgment of the authenticity of the image, thereby eliminating the interference of irrelevant image semantics in the recognition of true and false images, and improving the accuracy of true and false image recognition.
[0070] Figure 3 A flow chart showing a method for training a true and false image recognition model according to an embodiment of this specification is shown. Figure 3 As shown, the image authenticity recognition model at least includes a similarity determination network, and the method at least includes the following steps:
[0071] Step S301, obtaining a first feature corresponding to a first image known to be a real image, and a second feature corresponding to a second image known to be a false image, and obtaining a first description corresponding to the first image and a second description corresponding to the second image, wherein the first description includes a first indication that the first image is a real image, and the second description includes a second indication that the second image is a false image; extracting a third feature corresponding to the first description and a fourth feature corresponding to the second description;
[0072] Step S303, input the first feature, the second feature, the third feature, and the fourth feature into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; with the purpose of increasing the first similarity and the second similarity, update the network parameters of the similarity determination network.
[0073] First, in step S301, a first feature corresponding to a first image known to be a real image and a second feature corresponding to a second image known to be a false image are obtained. Also, a first description corresponding to the first image and a second description corresponding to the second image are obtained. The first description may include a first indication that the first image is a real image, and the second description may include a second indication that the second image is a false image. A third feature corresponding to the first description and a fourth feature corresponding to the second description are extracted. In different embodiments, the specific content in the first image or the second image may be different, and may also be used for images of different specific purposes or applications, which is not limited in this specification.
[0074] In different embodiments, the specific methods for obtaining image features and text features may be different. In one embodiment, the image true and false recognition network may also include an image encoder and a text encoder. Furthermore, the first feature corresponding to the first image and the second feature corresponding to the second image may be obtained through the image encoder. And, through the text encoder, the third feature corresponding to the first description and the fourth feature corresponding to the second description are extracted. In different specific embodiments, the image encoder may be a different specific encoder. In a specific embodiment, the image encoder may be based on, for example, a convolutional neural network (CNN) or a Transformer neural network. In different specific embodiments, the text encoder may also be a different specific encoder. In a specific embodiment, the text encoder may be based on, for example, a recurrent neural network (RNN), a long short-term memory network (LSTM), or a Transformer neural network.
[0075] In different embodiments, the specific method of obtaining a real image or a false image may be different. For example, in one embodiment, the third description corresponding to the first image may be obtained through a preset image-to-text model, and the first indication may be added to the third description to obtain the first description; the fourth description corresponding to the second image may be obtained through the image-to-text model, and the second indication may be added to the fourth description to obtain the second description. In different specific embodiments, the preset image-to-text model may be a different specific model for generating a corresponding text description according to an image, and this description does not limit this.
[0076] In different embodiments, the specific text forms of the first indication and the second indication may be different. In one embodiment, the first indication includes one or more of the keywords, key phrases and key sentences indicating that the first image is a real image, and the second indication includes one or more of the keywords, key phrases and key sentences indicating that the second image is a false image. In different specific embodiments, the keywords, key phrases and key sentences indicating that the first image is a real image may be different keywords, key phrases and key sentences. In different specific embodiments, the keywords, key phrases and key sentences indicating that the first image is a false image may be different keywords, key phrases and key sentences. In the above embodiment where the first indication is added to the third description to obtain the first description, for example, the third description is "a flying cat", and the first indication may be, for example, one or more of "real image", "real picture", "real painting", "a real picture", etc. The first description may be, for example, one or more of "a real image of a flying cat", "this is a real image about a flying cat", "a real image about a flying cat", etc.
[0077] Thereafter, in step S403, the first feature, the second feature, the third feature, and the fourth feature may be input into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature. Further, with the purpose of increasing the first similarity and the second similarity, the network parameters of the similarity determination network are updated. The similarity determination network may be a deep learning network based on a contrastive learning model.
[0078] Figure 4 A schematic diagram showing the network parameters of the image true and false recognition model updated in the embodiment of this specification. Figure 4As shown, for example, the image feature Ga, the text feature Ta, the image feature Gb, and the text feature Tb can be input into the similarity confirmation network based on the contrastive learning model, and for example, the similarity C1 between the positive sample pairs (Ga, Ta) and the similarity C2 between the positive sample pairs (Gb, Tb) can be obtained. Then, the network parameters of the similarity confirmation network can be updated as C1 and C2 tend to increase.
[0079] In one embodiment, the first feature, the second feature, the third feature, and the fourth feature can also be input into a similarity determination network to obtain a first similarity between the first feature and the third feature, a second similarity between the second feature and the fourth feature, a third similarity between the first feature and the fourth feature, and a fourth similarity between the second feature and the third feature. Furthermore, the network parameters of the similarity determination network can be updated with the purpose of increasing the first similarity and the second similarity and decreasing the third similarity and the fourth similarity. Figure 4 As shown, the image feature Ga, the text feature Ta, the image feature Gb, and the text feature Tb can also be input into the similarity confirmation network, for example, the similarity C1 between the positive sample pairs (Ga, Ta), the similarity C2 between the positive sample pairs (Gb, Tb), the similarity C3 between the negative sample pairs (Ga, Tb), and the similarity C4 between the negative sample pairs (Gb, Ta) can be obtained. Furthermore, the network parameters of the similarity confirmation network can be updated with the purpose of increasing C1 and C2 and decreasing C3 and C4.
[0080] In the above embodiment of obtaining the first feature, the second feature, the third feature and the fourth feature through the image encoder and the text encoder, the network parameters of the similarity determination network, the text encoder and the image encoder can also be updated with the purpose of increasing the first similarity and the second similarity and decreasing the third similarity and the fourth similarity. Figure 4As shown, the image feature Ga, the text feature Ta, the image feature Gb, and the text feature Tb can also be input into the similarity confirmation network, for example, the similarity C1 between the positive sample pair (Ga, Ta), the similarity C2 between the positive sample pair (Gb, Tb), the similarity C3 between the negative sample pair (Ga, Tb), and the similarity C4 between the negative sample pair (Gb, Ta) are obtained. Furthermore, the network parameters of the similarity determination network, the text encoder, and the image encoder can be updated with the purpose of C1 and C2 tending to become larger and C3 and C4 tending to become smaller. In a specific example, for example, the network parameters of the similarity determination network, the text encoder, and the image encoder can be updated based on the back propagation algorithm (BP). In another specific example, the information noise contrast estimation loss (InfoNCE, Info-Noise-Contrast Estimation Loss) can be calculated based on C1, C2, C3, and C4, and then the network parameters of the similarity determination network, the text encoder, and the image encoder can be updated based on the loss.
[0081] The above describes a training method for an image true-false identification model provided by an embodiment of this specification. Another embodiment of this specification also provides a corresponding image true-false identification method. Figure 5 A flow chart of a method for identifying true or false images according to an embodiment of this specification is shown. Figure 5 As shown, the method comprises at least the following steps:
[0082] Step S501, obtaining a fifth feature corresponding to a third image to be tested, and obtaining a third description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image; and extracting a sixth feature corresponding to the third description. In different specific embodiments, the third image to be tested may be different specific images, which is not limited in the specification.
[0083] Step S503: Input the fifth feature and the sixth feature into the similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature, wherein the third similarity is used to confirm whether the third image is a real image. If the third similarity is greater than a preset first threshold, the third image is determined to be a real image.
[0084] Figure 6 A schematic diagram of a method for identifying true or false images according to an embodiment of this specification is shown. Figure 6As shown, for example, the image feature Gx of the image to be tested X and the text feature T1 of the image description D1 of the image to be tested X (the image description D1 may include a text description of the image to be tested X and a text indication that the image to be tested X is a real image) may be input into the similarity determination network trained by the above method to obtain the similarity between Gx and T1. If the similarity is greater than a threshold value M1 (i.e., a first threshold value), the image to be tested X is determined to be a real image. In different specific examples, the first threshold value may be different specific values.
[0085] According to another embodiment of the present specification, a method for identifying true or false images is provided. Figure 7 A flow chart of a method for identifying true or false images according to an embodiment of this specification is shown. Figure 7 As shown, the method comprises at least the following steps:
[0086] Step S701, obtaining a fifth feature corresponding to a third image to be tested, and obtaining a fourth description corresponding to the third image, wherein the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extracting a seventh feature corresponding to the fourth description;
[0087] Step S703, input the fifth feature and the seventh feature into the similarity determination network trained by the above method to obtain a fourth similarity between the fifth feature and the seventh feature, and the fourth similarity is used to confirm whether the third image is a real image. If the fourth similarity is less than a preset second threshold, the third image is determined to be a real image.
[0088] Figure 8 A schematic diagram of a method for identifying true or false images according to another embodiment of the present specification is shown. Figure 8 As shown, for example, the image feature Gx of the image to be tested X and the text feature T2 of the image description D2 of the image to be tested X (the image description D2 may include a text description of the image to be tested X and a text indication that the image to be tested X is a false image) may be input into the similarity determination network trained by the above method to obtain the similarity between Gx and T2. If the similarity is less than a threshold value M2 (i.e., a second threshold value), the image to be tested X is determined to be a true image. In different specific examples, the second threshold value may be different specific values.
[0089] According to another embodiment of the present specification, a method for identifying true or false images is provided. Fig. 9 A flow chart of a method for identifying true or false images according to an embodiment of this specification is shown. Fig. 9 As shown, the method comprises at least the following steps:
[0090] Step S901, obtaining a fifth feature corresponding to a third image to be tested, and obtaining a third description corresponding to the third image and a fourth description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image, and the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; extracting a sixth feature corresponding to the third description and a seventh feature corresponding to the fourth description;
[0091] Step S903: Input the fifth feature, the sixth feature, and the seventh feature into the similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature, and a fourth similarity between the fifth feature and the seventh feature. If the third similarity is greater than the fourth similarity, the third image is determined to be a real image.
[0092] Fig.10 A schematic diagram of a method for identifying true or false images according to another embodiment of the present specification is shown. Fig.10 As shown, for example, the image feature Gx of the image to be tested X, the text feature T1 of the image description D1 of the image to be tested X (the image description D1 may include the text description of the image to be tested X and the text indication that the image to be tested X is a real image), and the text feature T2 of the image description D2 of the image to be tested X (the image description D2 may include the text description of the image to be tested X and the text indication that the image to be tested X is a false image) can be input into the similarity determination network trained by the above method to obtain the similarity C5 between Gx and T1, and the similarity C6 between Gx and T2. If C5 is greater than C6, it is determined that the image to be tested X is a real image. Otherwise, it is confirmed that the image to be tested X is a false image.
[0093] The above describes a training method for an image true-false recognition model provided by an embodiment of this specification. Another embodiment of this specification also provides a training device for an image true-false recognition model. Fig.11 The structure diagram of a training device for an image true-false recognition model according to an embodiment of the present specification is shown. The image true-false recognition model at least includes a similarity determination network, such as Fig.11 As shown, the training device 1100 includes:
[0094] The extraction unit 111 is configured to obtain a first feature corresponding to a first image known to be a real image and a second feature corresponding to a second image known to be a false image, and obtain a first description corresponding to the first image and a second description corresponding to the second image, wherein the first description includes a first indication that the first image is a real image and the second description includes a second indication that the second image is a false image; extract a third feature corresponding to the first description and a fourth feature corresponding to the second description;
[0095] The updating unit 112 is configured to input the first feature, the second feature, the third feature, and the fourth feature into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; and update the network parameters of the similarity determination network with the purpose of increasing the first similarity and the second similarity.
[0096] Another embodiment of the present specification also provides an image authenticity identification device. Fig.12 FIG. 2 shows a structural diagram of an image authenticity identification device according to an embodiment of this specification. Fig.12 As shown, the device 1200 includes:
[0097] The first acquisition unit 121 is configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image; and extract a sixth feature corresponding to the third description;
[0098] The first recognition unit 122 is configured to input the fifth feature and the sixth feature into the similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature; if the third similarity is greater than a preset first threshold, the third image is determined to be a real image.
[0099] Another embodiment of the present specification also provides an image authenticity identification device. Fig.13 FIG. 2 shows a structural diagram of an image authenticity identification device according to an embodiment of this specification. Fig.13 As shown, the device 1300 includes:
[0100] The second acquisition unit 131 is configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a fourth description corresponding to the third image, wherein the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extract a seventh feature corresponding to the fourth description;
[0101] The second recognition unit 132 is configured to input the fifth feature and the seventh feature into the similarity determination network trained by the above method to obtain a fourth similarity between the fifth feature and the seventh feature; if the fourth similarity is less than a preset second threshold, determine that the third image is a real image.
[0102] Another embodiment of the present specification also provides an image authenticity identification device. Fig.14 FIG. 2 shows a structural diagram of an image authenticity identification device according to an embodiment of this specification. Fig.14 As shown, the device 1400 includes:
[0103] The third acquisition unit 141 is configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image and a fourth description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image, and the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; extract a sixth feature corresponding to the third description and a seventh feature corresponding to the fourth description;
[0104] The third recognition unit 142 is configured to input the fifth feature, the sixth feature, and the seventh feature into the similarity determination network trained by the above method to obtain a third similarity between the fifth feature and the sixth feature, and a fourth similarity between the fifth feature and the seventh feature; if the third similarity is greater than the fourth similarity, the third image is determined to be a real image.
[0105] On another aspect, the present specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute any one of the above methods.
[0106] On another aspect, the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, any one of the above methods is implemented.
[0107] It should be understood that the descriptions such as “first” and “second” in this article are only used to distinguish similar concepts for the sake of simplicity of description and do not have any other limiting effect.
[0108] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0109] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for training an image true and false identification model, the image true and false identification model at least comprising a similarity determination network, the method comprising: Acquire a first feature corresponding to a first image known to be a real image and a second feature corresponding to a second image known to be a false image, and acquire a first description corresponding to the first image and a second description corresponding to the second image, wherein the first description includes a first indication that the first image is a real image and the second description includes a second indication that the second image is a false image; extract a third feature corresponding to the first description and a fourth feature corresponding to the second description; The first feature, the second feature, the third feature, and the fourth feature are input into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; and a network parameter of the similarity determination network is updated with the purpose of increasing the first similarity and the second similarity.
2. The method according to claim 1, wherein: Inputting the first feature, the second feature, the third feature, and the fourth feature into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; With the purpose of increasing the first similarity and the second similarity, updating the network parameters of the similarity determination network includes: Inputting the first feature, the second feature, the third feature, and the fourth feature into a similarity determination network to obtain a first similarity between the first feature and the third feature, a second similarity between the second feature and the fourth feature, a third similarity between the first feature and the fourth feature, and a fourth similarity between the second feature and the third feature; With the purpose of increasing the first similarity and the second similarity and decreasing the third similarity and the fourth similarity, the network parameters of the similarity determination network are updated.
3. The method according to claim 1, wherein obtaining a first description corresponding to the first image and a second description corresponding to the second image comprises: Obtaining a third description corresponding to the first image through a preset image-to-text model, and adding the first indication to the third description to obtain the first description; A fourth description corresponding to the second image is obtained through the image-to-text model, and the second indication is added to the fourth description to obtain the second description.
4. The method according to claim 2, wherein the image authenticity recognition network further comprises an image encoder and a text encoder; Acquiring a first feature corresponding to the first image and a second feature corresponding to the second image, including: Obtaining, by an image encoder, a first feature corresponding to the first image and a second feature corresponding to the second image; Extracting a third feature corresponding to the first description and a fourth feature corresponding to the second description includes: extracting the third feature corresponding to the first description and the fourth feature corresponding to the second description through a text encoder.
5. The method according to claim 4, wherein, with the purpose of making the first similarity and the second similarity tend to increase and the third similarity and the fourth similarity tend to decrease, updating the network parameters of the similarity determination network comprises: With the purpose of increasing the first similarity and the second similarity and decreasing the third similarity and the fourth similarity, the network parameters of the similarity determination network, the text encoder and the image encoder are updated.
6. The method according to claim 1, wherein the first indication includes one or more of keywords, key phrases and key sentences indicating that the first image is a real image, and the second indication includes one or more of keywords, key phrases and key sentences indicating that the second image is a false image.
7. A method for identifying true or false images, comprising: Acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image; and extract a sixth feature corresponding to the third description; The fifth feature and the sixth feature are input into the similarity determination network trained by the method described in claim 1 to obtain a third similarity between the fifth feature and the sixth feature; if the third similarity is greater than a preset first threshold, the third image is determined to be a real image.
8. A method for identifying true or false images, comprising: Acquire a fifth feature corresponding to a third image to be tested, and acquire a fourth description corresponding to the third image, wherein the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extract a seventh feature corresponding to the fourth description; The fifth feature and the seventh feature are input into the similarity determination network trained by the method described in claim 1 to obtain a fourth similarity between the fifth feature and the seventh feature; if the fourth similarity is less than a preset second threshold, the third image is determined to be a real image.
9. A method for identifying true or false images, comprising: Acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image and a fourth description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image, and the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; extract a sixth feature corresponding to the third description and a seventh feature corresponding to the fourth description; The fifth feature, the sixth feature, and the seventh feature are input into a similarity determination network trained by the method described in claim 1 to obtain a third similarity between the fifth feature and the sixth feature, and a fourth similarity between the fifth feature and the seventh feature; if the third similarity is greater than the fourth similarity, the third image is determined to be a real image.
10. A training device for an image true-false identification model, the image true-false identification model at least comprising a similarity determination network, the device comprising: The extraction unit is configured to obtain a first feature corresponding to a first image known to be a real image and a second feature corresponding to a second image known to be a false image, and obtain a first description corresponding to the first image and a second description corresponding to the second image, wherein the first description includes a first indication that the first image is a real image and the second description includes a second indication that the second image is a false image; extract a third feature corresponding to the first description and a fourth feature corresponding to the second description; The updating unit is configured to input the first feature, the second feature, the third feature, and the fourth feature into a similarity determination network to obtain a first similarity between the first feature and the third feature, and a second similarity between the second feature and the fourth feature; and update the network parameters of the similarity determination network with the purpose of increasing the first similarity and the second similarity.
11. An image authenticity recognition device, comprising: A first acquisition unit is configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image; and extract a sixth feature corresponding to the third description; The first recognition unit is configured to input the fifth feature and the sixth feature into a similarity determination network trained by the method described in claim 1 to obtain a third similarity between the fifth feature and the sixth feature; if the third similarity is greater than a preset first threshold, determine that the third image is a real image.
12. An image authenticity recognition device, comprising: a second acquisition unit configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a fourth description corresponding to the third image, wherein the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extract a seventh feature corresponding to the fourth description; The second recognition unit is configured to input the fifth feature and the seventh feature into the similarity determination network trained by the method described in claim 1 to obtain a fourth similarity between the fifth feature and the seventh feature; if the fourth similarity is less than a preset second threshold, determine that the third image is a real image.
13. An image authenticity recognition device, comprising: a third acquisition unit configured to acquire a fifth feature corresponding to a third image to be tested, and acquire a third description corresponding to the third image and a fourth description corresponding to the third image, wherein the third description includes a text description of the third image and a third indication that the third image is a real image, and the fourth description includes a text description of the third image and a fourth indication that the third image is a false image; and extract a sixth feature corresponding to the third description and a seventh feature corresponding to the fourth description; The third recognition unit is configured to input the fifth feature, the sixth feature, and the seventh feature into a similarity determination network trained by the method described in claim 1 to obtain a third similarity between the fifth feature and the sixth feature, and a fourth similarity between the fifth feature and the seventh feature; if the third similarity is greater than the fourth similarity, the third image is determined to be a real image.
14. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 9.
15. A computing device, comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Tampered image detection method and device
CN111325265A
Training method, image recognition method and device, equipment and readable storage medium
CN116092101A
Cross-modal retrieval method, system and equipment based on complementary entropy contrast learning and medium
CN116775918A
Image classification model training method and device, equipment, medium and program product
CN117370882A