Data processing methods, apparatus and equipment

By using a pre-trained detection model for image feature extraction, encoding, and decoding, combined with multi-layer feature extraction, the accuracy problem of tampered image detection is solved, and the security of identity verification is improved.

CN116664514BActive Publication Date: 2026-01-30ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310628033.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2026-01-30
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively detect and identify tampered images, leading to a decline in the security of identity verification.

Method used

A pre-trained detection model is used for image feature extraction, encoding, multi-layer feature extraction, and decoding. Combined with a classification module, the model learns the feature differences between tampered and untampered regions in the image through different feature extraction layers, thereby improving detection accuracy.

Benefits of technology

It improves the accuracy of detecting whether an image has been tampered with, and enhances the security of identity verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664514B_ABST
    Figure CN116664514B_ABST
Patent Text Reader

Abstract

This specification provides a data processing method, apparatus, and device. The method includes: performing image feature extraction processing on a target image based on a pre-trained detection model to obtain a first feature vector; encoding the first feature vector based on the pre-trained detection model to obtain a second feature vector; determining a third feature vector based on the similarity between feature vectors obtained by performing feature extraction processing on the second feature vector at different feature extraction layers in the pre-trained detection model; decoding the second feature vector based on the pre-trained detection model to obtain a fourth feature vector; determining a target feature vector corresponding to the target image based on the third and fourth feature vectors; classifying the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image; and determining whether the target image is a tampered image based on the predicted label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of data processing technology, and in particular to a data processing method, apparatus and equipment. Background Technology

[0002] With the development and maturation of image synthesis technology, malicious third parties are increasingly using this technology to tamper with images and steal user information. Because image tampering through synthesis applies new technologies such as artificial intelligence, machine learning, and big data mining to malicious theft scenarios, the resulting tampered images are technologically sophisticated, more deceptive, and misleading. Therefore, a solution is needed to improve the accuracy of detecting whether an image has been tampered with. Summary of the Invention

[0003] The purpose of the embodiments in this specification is to provide a data processing method, apparatus, and device to provide a solution that can improve the detection accuracy of whether an image to be detected is a tampered image.

[0004] To achieve the above technical solution, the embodiments in this specification are implemented as follows:

[0005] In a first aspect, embodiments of this specification provide a data processing method, comprising: acquiring a target image to be detected, and performing image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image; encoding the first feature vector based on the pre-trained detection model to obtain a second feature vector; determining a third feature vector based on the similarity between feature vectors obtained by performing feature extraction processing on the second feature vector at different feature extraction layers in the pre-trained detection model; decoding the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and determining a target feature vector corresponding to the target image based on the third feature vector and the fourth feature vector; classifying the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determining whether the target image is a tampered image based on the predicted label.

[0006] Secondly, embodiments of this specification provide a data processing apparatus, the apparatus comprising: a first image acquisition module, configured to acquire a target image to be detected, and perform image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image; a first encoding module, configured to encode the first feature vector based on the pre-trained detection model to obtain a second feature vector; a first determination module, configured to determine a third feature vector based on the similarity between feature vectors obtained by performing feature extraction processing on the second feature vector at different feature extraction layers in the pre-trained detection model; a first decoding module, configured to decode the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and determine a target feature vector corresponding to the target image based on the third feature vector and the fourth feature vector; and a first classification module, configured to classify the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determine whether the target image is a tampered image based on the predicted label.

[0007] Thirdly, embodiments of this specification provide a data processing apparatus, the data processing apparatus comprising: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions, when executed, cause the processor to: acquire a target image to be detected, and perform image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image; encode the first feature vector based on the pre-trained detection model to obtain a second feature vector; determine a third feature vector based on the similarity between feature vectors obtained by performing feature extraction processing on the second feature vector by different feature extraction layers in the pre-trained detection model; decode the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and determine a target feature vector corresponding to the target image based on the third feature vector and the fourth feature vector; classify the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determine whether the target image is a tampered image based on the predicted label.

[0008] Fourthly, embodiments of this specification provide a storage medium for storing computer-executable instructions. When executed, the executable instructions perform the following process: acquiring a target image to be detected, and performing image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image; encoding the first feature vector based on the pre-trained detection model to obtain a second feature vector; determining a third feature vector based on the similarity between feature vectors obtained by performing feature extraction processing on the second feature vector by different feature extraction layers in the pre-trained detection model; decoding the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and determining a target feature vector corresponding to the target image based on the third and fourth feature vectors; classifying the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determining whether the target image is a tampered image based on the predicted label. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a schematic diagram of a data processing system described in this specification;

[0011] Figure 2A This is a flowchart illustrating an embodiment of a data processing method described in this specification;

[0012] Figure 2B This is a schematic diagram of the processing procedure of one data processing method described in this specification;

[0013] Figure 3 This is a schematic diagram of a detection model structure as described in this specification;

[0014] Figure 4 This is a schematic diagram of the processing procedure of one data processing method described in this specification;

[0015] Figure 5 This is a schematic diagram of another detection model structure in this specification;

[0016] Figure 6 This is a schematic diagram of another detection model structure in this specification;

[0017] Figure 7This is a schematic diagram of the structure of an embodiment of a data processing device according to this specification;

[0018] Figure 8 This is a schematic diagram of the structure of a data processing device described in this specification. Detailed Implementation

[0019] This specification provides a data processing method, apparatus, and device through its embodiments.

[0020] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0021] This specification provides a data processing method, apparatus, and device through its embodiments.

[0022] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0023] The technical solutions in this specification can be applied to data processing systems, such as... Figure 1 As shown, the data processing system can have terminal devices and servers. The server can be a standalone server or a server cluster composed of multiple servers. The terminal device can be a personal computer or a mobile terminal device such as a mobile phone or tablet computer. Alternatively, the terminal device can be an Internet of Things device equipped with a camera component.

[0024] The data processing system may include n terminal devices and m servers, where n and m are positive integers greater than or equal to 1. The terminal devices can be used to collect image samples. For example, the terminal devices can acquire corresponding image samples for different synthetic image detection scenarios. For example, for synthetic image detection scenarios for identity authentication, the terminal devices can acquire user images through configured camera components, or the terminal devices can also receive user images and use the acquired images as image samples, etc.

[0025] The terminal device can send the collected image samples to any server in the data processing system. The server can use the image samples collected by the terminal device as the target image to be detected, and perform synthetic image detection on the target image. Alternatively, the server can store the collected image samples, and when the model training cycle is reached, use the stored image samples as historical images and train the detection model based on the historical images.

[0026] When a malicious third party tampers with a user's image, they may modify a specific area of ​​the image. During authentication, this modification can be used to bypass authentication by combining the unmodified areas with the modified portion. For example, a malicious third party could modify the area of ​​an ID image that contains the user's face (e.g., replacing the user's face with their own) while retaining the rest of the image. In this case, during authentication, since the other authentication information in the modified image remains unchanged, and the modified image contains the malicious third party's face, the authentication result against the malicious third party might appear as successful.

[0027] Therefore, the feature differences between tampered and untampered regions in a tampered image may be small. The accuracy of detecting whether an image has been tampered by segmentation networks is poor. However, by using different feature extraction layers in the detection model, the differences between different regions in the image can be learned, enabling the detection model to better learn the feature differences between tampered and untampered regions in the image. By fusing the feature vectors obtained from the encoding and decoding processes of the detection model, the accuracy of detecting whether an image has been tampered with can be improved, thereby enhancing the security of identity verification.

[0028] Based on the above data processing system architecture, the data processing methods in the following embodiments can be implemented.

[0029] Example 1

[0030] like Figure 2A and Figure 2B As shown in the embodiments of this specification, a data processing method is provided. The execution subject of this method can be a server, which can be a standalone server or a server cluster composed of multiple servers. The method specifically includes the following steps:

[0031] In S202, the target image to be detected is acquired, and the target image is processed by image feature extraction based on the pre-trained detection model to obtain the first feature vector corresponding to the target image.

[0032] The target image can be any image used in security scenarios such as identity verification. For example, the target image can be an image containing the user's biometric features, such as an image containing the user's iris, an image containing the user's fingerprint, or an image containing the user's facial features. The detection model can be a model built based on a preset deep learning algorithm to detect whether an image has been tampered with.

[0033] In practice, with the development and maturation of image synthesis technology, malicious third parties are increasingly using synthesis techniques to tamper with images in order to steal user information. Because image tampering through synthesis technology applies new technologies such as artificial intelligence, machine learning, and big data mining to malicious theft scenarios, the tampered images are technologically sophisticated, more deceptive, and misleading. Therefore, a solution is needed to improve the accuracy of detecting whether an image has been tampered with. To this end, embodiments of this specification provide a technical solution that can solve the above problems, as detailed below.

[0034] Taking document verification as an example, when a terminal device receives an identity verification command triggered by a user, it can acquire an image of the document presented by the user. This can be achieved through image acquisition and processing (such as image capture or scanning). The terminal device can then send the acquired image to a server, which can then identify the image as the target image.

[0035] The server can input the target image into a pre-trained detection model to perform image feature extraction processing on the target image, obtaining a first feature vector, such as... Figure 3 As shown, the detection model may include a feature extraction module, an encoding module, a comparison detection module, a decoding module, and a classification module.

[0036] The detection model can perform image feature extraction processing through a feature extraction module, which can be a module built based on the Convolutional Neural Networks (CNN) algorithm.

[0037] In S204, the first feature vector is encoded based on the pre-trained detection model to obtain the second feature vector.

[0038] The dimension of the second feature vector can be smaller than the dimension of the first feature vector.

[0039] In implementation, such as Figure 3As shown, the detection model can encode the first feature vector output by the feature extraction module through the encoding module to obtain the second feature vector. That is, the detection module can convert the first feature vector into a low-dimensional second feature vector. The encoding module can be a module for compressing the feature vector based on algorithms such as the preset multilayer perceptron (MLP) algorithm and convolutional neural network algorithm.

[0040] In S206, the third feature vector is determined by the similarity between the feature vectors obtained by different feature extraction layers in the pre-trained detection model that perform feature extraction processing on the second feature vector.

[0041] In implementation, the detection model can include multiple feature extraction layers. The second feature vector can be processed by each of these multiple feature extraction layers. The third feature vector is determined based on the similarity between the feature vectors output by these multiple feature extraction layers. The parameters of these multiple feature extraction layers can be not shared, that is, these multiple feature extraction layers are not the same. The difference between tampered and untampered regions in the image can be learned based on the feature vectors extracted by different feature extraction layers.

[0042] When determining the third feature vector, a preset similarity algorithm (such as cosine similarity algorithm) can be used to determine the similarity between the feature vectors output by every two feature extraction layers. If the comparison detection module includes two feature extraction layers, the similarity between the feature vectors output by these two feature extraction layers can be determined as the third feature vector. If the comparison detection module includes more than two feature extraction layers, the mean (or maximum, median, etc.) of multiple similarities can be determined as the third feature vector.

[0043] The method for determining the third feature vector described above is an optional and implementable method. In practical application scenarios, there can be a variety of different methods. Different methods can be selected according to different practical application scenarios. This specification does not specifically limit the embodiments in this way.

[0044] In S208, based on the pre-trained detection model, the second feature vector is decoded to obtain the fourth feature vector, and based on the third and fourth feature vectors, the target feature vector corresponding to the target image is determined.

[0045] In implementation, the server can input the second feature vector into the decoding module, which then decodes the second feature vector to obtain the fourth feature vector. The decoding module can transform the low-dimensional second feature vector back to the original data space to obtain the fourth feature vector, meaning the fourth feature vector has the same dimension as the first feature vector. The encoding module can also be a module built based on pre-defined algorithms such as Multilayer Perceptron (MLP) or Convolutional Neural Network (CNN) algorithms to compress the feature vector.

[0046] The server can perform feature fusion processing on the third and fourth feature vectors to obtain the target feature vector. For example, the server can determine the sum (or mean) of the third and fourth feature vectors as the target feature vector. In addition, there are many other methods for determining the target feature vector, which may vary depending on the actual application scenario. This specification does not limit the specific methods in this embodiment.

[0047] In S210, based on the pre-trained detection model, the target feature vector is classified to obtain the predicted label of the target image, and based on the predicted label, it is determined whether the target image is a tampered image.

[0048] In implementation, the classification module of the detection model can be a fully connected layer (FC layer). The FC layer can classify the image using feature data to obtain the predicted label of the image.

[0049] The server can input the fused feature vector (i.e., the target feature vector) into the FC layer, so that the FC layer can classify the target feature vector and obtain the predicted label of the target image.

[0050] The predicted label can be used to characterize whether the target image is a tampered image. Therefore, the server can determine whether the target image is a tampered image based on the predicted label.

[0051] Furthermore, if the server determines that the target image is a tampered image, then the server can determine that the authentication has failed and send a preset alarm message to the terminal device.

[0052] This specification provides a data processing method that involves acquiring a target image to be detected, performing image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image, encoding the first feature vector based on the pre-trained detection model to obtain a second feature vector, determining a third feature vector based on the similarity between the feature vectors obtained by performing feature extraction processing on the second feature vector at different feature extraction layers in the pre-trained detection model, decoding the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, determining a target feature vector corresponding to the target image based on the third and fourth feature vectors, classifying the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determining whether the target image is a tampered image based on the predicted label. In this way, by using different feature extraction layers of the detection model, the differences between different regions in the image can be learned, enabling the detection model to better learn the feature differences between tampered and untampered regions in the image. By fusing the feature vectors obtained through the encoding and decoding processes of the detection model, it is possible to detect whether an image has been tampered with, thereby improving the accuracy of detecting whether the image to be detected has been tampered with, and thus improving the security of identity verification.

[0053] Example 2

[0054] like Figure 4 As shown in the embodiments of this specification, a data processing method is provided. The execution subject of this method can be a server, which can be a standalone server or a server cluster composed of multiple servers. The method specifically includes the following steps:

[0055] In S402, historical images used to train the detection model are obtained, along with the type labels corresponding to the historical image data.

[0056] Among them, the type label can be used to characterize whether a historical image is a tampered image.

[0057] In practice, historical images can be images collected by the terminal device during the model training cycle that correspond to the detection model. For example, assuming the detection model is a model that detects whether the document image in an identity authentication scenario is synthetic data, the terminal device can send the collected user document images to the server during the model training cycle (such as the last month, the last three months, etc.). The server can store the received user document images in the database corresponding to the detection model, and when the model training cycle is reached, select a preset number of images from the database as historical images to train the detection model.

[0058] In addition, to improve model training performance, a predetermined number of tampered images can be used to train the detection model. This means that the historical images used for training the detection model can contain a predetermined number of negative samples. For example, the server can acquire images identified as tampered during the model training period as historical images.

[0059] In S404, image feature extraction processing is performed on historical images based on the detection model to obtain the fifth feature vector corresponding to the historical images.

[0060] The specific processing procedure of S404 can be found in the relevant content of S204 in the above embodiment, and will not be repeated here.

[0061] In S406, based on the detection model, the fifth feature vector is encoded to obtain the sixth feature vector.

[0062] The detection model may include multiple data processing layers, each of which may include multiple encoding layers and multiple decoding layers corresponding to the encoding layers. The number of nodes in an encoding layer may be less than the number of nodes in the preceding encoding layer, and the number of nodes in a decoding layer may be greater than the number of nodes in the preceding encoding layer. The input data of the decoding layer may be determined based on the feature vector output by the preceding data processing layer and the feature vector obtained by comparing and detecting the feature vector output by the corresponding encoding layer of the preceding decoding layer using a feature detection module.

[0063] In implementation, for example, Figure 5 As shown, data processing layers 1 to n can be encoding layers, and data processing layers n' to 1' can be decoding layers, where n and n' are equal, and n is a positive integer greater than 1. The number of nodes in each data processing layer from 1 to n can decrease sequentially, that is, the number of nodes in data processing layer 1 is greater than the number of nodes in data processing layer 2. Conversely, the number of nodes in each data processing layer from n' to 1' can increase sequentially, that is, the number of nodes in data processing layer 2' is less than the number of nodes in data processing layer 1'.

[0064] like Figure 5As shown, the input data of the encoding layer is the output data of the previous encoding layer, while the input data of the decoding layer is determined by the feature vector based on the output of the previous data processing layer and the feature vector obtained by the feature detection module through comparison and detection of the feature vector output by the encoding layer corresponding to the previous decoding layer. For example, since the data processing layer preceding the first decoding layer is an encoding layer, the input data of the first decoding layer (i.e., data processing layer n') is the output data of the last encoding layer (i.e., data processing layer n). Similarly, the data processing layer preceding the second decoding layer is an encoding layer; therefore, the input data of the second decoding layer (i.e., data processing layer n-1') can be determined by the feature vector obtained by the comparison and detection model through comparison and detection of the output data of data processing layer n-1 (i.e., the encoding layer corresponding to the previous decoding layer).

[0065] Based on the above structure, taking a detection model with two coding layers as an example, the corresponding sixth feature vector can include the first sub-feature vector and the second sub-feature vector. The following provides an optional implementation method for determining the sixth feature vector, which can be found in steps one and two below:

[0066] Step 1: Based on the first encoding layer of the detection model, the fifth feature vector is encoded to obtain the first sub-feature vector.

[0067] Step two: Based on the second encoding layer of the detection model, the first sub-feature vector is encoded to obtain the second sub-feature vector.

[0068] In S408, the seventh feature vector is determined based on the similarity between the feature vectors obtained by performing feature extraction processing on the sixth feature vector by different feature extraction layers in the detection model.

[0069] The detection model may include a first feature extraction layer and a second feature extraction layer. The first feature extraction layer and the second feature extraction layer have the same network structure but different network parameters. That is, the network parameters of the first feature extraction layer and the second feature extraction layer are not shared during the model training process.

[0070] In implementation and practical applications, the processing method of S408 can vary. The following is one optional implementation method, which can be found in steps one to two below:

[0071] Step 1: Perform feature extraction processing on the sixth feature vector based on the first feature extraction layer to obtain the first vector, and then perform feature extraction processing on the sixth feature vector based on the second feature extraction layer to obtain the second vector.

[0072] In implementation, since the sixth feature vector is data obtained through encoding, i.e., the sixth feature vector is compressed data, in order to improve the detection effect of the detection model and enable the model to more accurately learn the difference between tampered and non-tampered regions in the image, the server can enlarge the sixth feature vector based on a preset magnification dimension to obtain an enlarged sixth feature vector. Then, feature extraction processing is performed on the enlarged sixth feature vector based on the first feature extraction layer to obtain the first vector, and feature extraction processing is performed on the enlarged sixth feature vector based on the second feature extraction layer to obtain the second vector.

[0073] Step 2: Determine the seventh feature vector based on the similarity between the first and second vectors.

[0074] In implementation, the server can determine the similarity between the first vector and the second vector based on a preset similarity algorithm, and determine the seventh feature vector based on the similarity between the first vector and the second vector.

[0075] Furthermore, the above describes the detection model performing feature extraction processing through two feature extraction layers. That is, the comparison detection module of the detection model can include two feature extraction layers. In actual application scenarios, the comparison detection module of the detection model can also include multiple feature extraction layers. Different numbers of feature extraction layers can be selected according to different actual application scenarios. This specification does not specifically limit this in the embodiments.

[0076] In S410, based on the detection model, the sixth feature vector is decoded to obtain the eighth feature vector, and based on the seventh and eighth feature vectors, the ninth feature vector corresponding to the historical image is determined.

[0077] In implementation, when the sixth feature vector includes the first and second sub-feature vectors, the seventh feature vector includes the third sub-feature vector obtained by the comparison detection module based on the detection model through comparison detection processing of the first sub-feature vector, and the fourth sub-feature vector obtained by the comparison detection module based on the detection model through comparison detection processing of the second sub-feature vector, and the eighth feature vector includes the fifth and sixth sub-feature vectors, the following is an optional implementation method for determining the ninth feature vector, as detailed in steps one through four below:

[0078] Step 1: Based on the first decoding layer of the detection model, decode the second sub-feature data to obtain the fifth sub-feature vector.

[0079] Step 2: Determine the first input vector based on the fourth and fifth sub-feature vectors.

[0080] Step 3: Based on the second decoding layer of the detection model, the first input vector is decoded to obtain the sixth sub-feature vector.

[0081] Step 4: Based on the third and sixth sub-feature vectors, determine the ninth feature vector corresponding to the historical image.

[0082] In practice, taking a detection model that includes four data processing layers (i.e., two encoding layers and two decoding layers) and two feature extraction layers (i.e., the comparison detection module includes two feature extraction layers) as an example, the server can perform feature extraction processing on historical images through the feature extraction module to obtain the fifth feature vector.

[0083] The server can encode the fifth feature vector using the first encoding layer to obtain the first sub-feature vector. This first sub-feature vector can then be input into a comparison detection module for comparison detection, resulting in the third sub-feature vector corresponding to the first sub-feature vector. Next, the server can input the first sub-feature vector into a second encoding layer for encoding, obtaining the second sub-feature vector. Simultaneously, the server can input the second sub-feature vector into the comparison detection module for comparison detection, resulting in the fourth sub-feature vector corresponding to the second sub-feature vector.

[0084] The server can decode the second sub-feature data based on the first decoding layer of the detection model to obtain the fifth sub-feature vector. Then, the server can perform feature fusion processing on the fourth and fifth sub-feature vectors to obtain the first input vector. The server can input the first input vector into the second decoding layer to decode the first input vector and obtain the sixth sub-feature vector. Finally, the server can determine the ninth feature vector corresponding to the historical image based on the third and sixth sub-feature vectors.

[0085] Furthermore, the above example uses a detection model comprising four data processing layers (two encoding layers and two decoding layers) and two feature extraction layers (i.e., the comparison detection module includes two feature extraction layers). In practical applications, the detection model can include multiple data processing layers and multiple feature extraction layers, for example, such as... Figure 6 As shown, the server can perform encoding processing through three encoding layers and decoding processing through three corresponding decoding layers, etc. Different detection models can be constructed according to different actual application scenarios. This specification does not specifically limit this in the embodiments.

[0086] In S412, based on the detection model, the ninth feature vector is classified to obtain the predicted label of the historical image.

[0087] In practice, the server can input the ninth feature vector into the FC layer of the detection model, so that the FC layer can classify the ninth feature vector to obtain the predicted label of the historical image.

[0088] In S414, the detection model is iteratively trained based on the type labels and predicted labels of historical images until the detection model converges, resulting in the trained detection model.

[0089] In implementation, the server can determine the loss value for the detection model based on the type labels and predicted labels of historical images, and determine whether the detection model has converged based on the loss value. If the detection model has not converged, the server can continue to train the detection model based on historical images and their type labels until the detection model converges, thus obtaining the trained detection model.

[0090] In this way, the detection module can learn the difference between tampered and untampered regions in an image through multi-scale feature fusion. In a high-dimensional space, the tampered and untampered regions can be distinguished more clearly, reducing interference and enabling accurate detection even for images with small tampering.

[0091] In S202, the target image to be detected is acquired, and the target image is processed by image feature extraction based on the pre-trained detection model to obtain the first feature vector corresponding to the target image.

[0092] In S204, the first feature vector is encoded based on the pre-trained detection model to obtain the second feature vector.

[0093] In S206, the third feature vector is determined by the similarity between the feature vectors obtained by different feature extraction layers in the pre-trained detection model that perform feature extraction processing on the second feature vector.

[0094] In S208, based on the pre-trained detection model, the second feature vector is decoded to obtain the fourth feature vector, and based on the third and fourth feature vectors, the target feature vector corresponding to the target image is determined.

[0095] In implementation, the network structure of the detection model is taken as an example. Figure 6 Taking the structure shown as an example, the server can input the target image into the detection model to obtain the target feature vector corresponding to the target image through multiple encoding processes, multiple comparison detection processes, and multiple decoding processes.

[0096] In S210, based on the pre-trained detection model, the target feature vector is classified to obtain the predicted label of the target image, and based on the predicted label, it is determined whether the target image is a tampered image.

[0097] In S416, if the target image is determined to be a tampered image based on the predicted label, the location information of the tampered region in the target image is determined based on the pre-trained detection model and the target image.

[0098] In practice, the server can determine the location information of the tampered area in the target image based on the classification information of the pixels in the target image, which is included in the predicted label of the target image output by the pre-trained detection model.

[0099] The server can convert the target image into a binary image based on a preset conversion algorithm and the classification information of the pixels in the target image, which is included in the predicted label of the target image. For example, the pixels in the target image can be converted to 0 or 255. The server can determine the location information of the tampered area in the target image based on the binary image obtained by conversion.

[0100] The method described above for determining the location information of the tampered area in the target image is an optional and feasible method. In actual application scenarios, there can be a variety of different methods, which may vary depending on the actual application scenario. This specification does not specifically limit the methods used in this embodiment.

[0101] In S418, risk detection processing is performed on the target image based on the location information to obtain the risk detection result for the target image.

[0102] In implementation, the server can determine the corresponding detection strategy based on the detection scene corresponding to the target image, and determine the risk detection result for the target image based on the determined detection strategy and location information.

[0103] For example, assuming a defined detection strategy determines that an image is at risk if a region containing text in the image is tampered with; otherwise, the image is not at risk. For this detection strategy, the server can determine whether the tampered region in the target image contains text based on location information. If the tampered region contains text, then the risk detection result for the target image can be determined as indicating that the target image is at risk.

[0104] Furthermore, the method for determining the risk detection result described above is an optional and feasible method. In practical application scenarios, there can be a variety of different methods. For example, the detection strategy can also be to detect whether the region containing the user's biometric features in the image has been tampered with. These methods can vary depending on the actual application scenario, and the embodiments in this specification do not specifically limit them.

[0105] This specification provides a data processing method that involves acquiring a target image to be detected, performing image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image, encoding the first feature vector based on the pre-trained detection model to obtain a second feature vector, determining a third feature vector based on the similarity between the feature vectors obtained by performing feature extraction processing on the second feature vector at different feature extraction layers in the pre-trained detection model, decoding the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, determining a target feature vector corresponding to the target image based on the third and fourth feature vectors, classifying the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determining whether the target image is a tampered image based on the predicted label. In this way, by using different feature extraction layers of the detection model, the differences between different regions in the image can be learned, enabling the detection model to better learn the feature differences between tampered and untampered regions in the image. By fusing the feature vectors obtained through the encoding and decoding processes of the detection model, it is possible to detect whether an image has been tampered with, thereby improving the accuracy of detecting whether the image to be detected has been tampered with, and thus improving the security of identity verification.

[0106] Example 3

[0107] The above describes the data processing method provided in the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide a data processing device, such as... Figure 7 As shown.

[0108] The data processing device includes: an image acquisition module 701, a first encoding module 702, a first determination module 703, a first decoding module 704, and a first classification module 705, wherein:

[0109] The image acquisition module 701 is used to acquire the target image to be detected, and to perform image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image;

[0110] The first encoding module 702 is used to encode the first feature vector based on the pre-trained detection model to obtain the second feature vector;

[0111] The first determining module 703 is used to determine the third feature vector based on the similarity between the feature vectors obtained by performing feature extraction processing on the second feature vector by different feature extraction layers in the pre-trained detection model.

[0112] The first decoding module 704 is used to decode the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and to determine the target feature vector corresponding to the target image based on the third feature vector and the fourth feature vector.

[0113] The first classification module 705 is used to classify the target feature vector based on the pre-trained detection model to obtain the predicted label of the target image, and to determine whether the target image is a tampered image based on the predicted label.

[0114] In the embodiments described in this specification, the device further includes:

[0115] The sample acquisition module is used to acquire historical images used to train the detection model, and type labels corresponding to the historical image data. The type labels are used to characterize whether the historical image is a tampered image.

[0116] The feature extraction module is used to perform image feature extraction processing on the historical image based on the detection model to obtain a fifth feature vector corresponding to the historical image;

[0117] The second encoding module is used to encode the fifth feature vector based on the detection model to obtain the sixth feature vector;

[0118] The second determining module is used to determine the seventh feature vector based on the similarity between the feature vectors obtained by performing feature extraction processing on the sixth feature vector in different feature extraction layers in the detection model;

[0119] The second decoding module is used to decode the sixth feature vector based on the detection model to obtain the eighth feature vector, and to determine the ninth feature vector corresponding to the historical image based on the seventh feature vector and the eighth feature vector.

[0120] The second classification module is used to classify the ninth feature vector based on the detection model to obtain the predicted label of the historical image.

[0121] The model training module is used to iteratively train the detection model based on the type labels and predicted labels of the historical images until the detection model converges, thus obtaining the trained detection model.

[0122] In the embodiments described in this specification, the detection model includes a first feature extraction layer and a second feature extraction layer. The first feature extraction layer and the second feature extraction layer have the same network structure but different network parameters.

[0123] The second determining module is used for:

[0124] Based on the first feature extraction layer, feature extraction processing is performed on the sixth feature vector to obtain a first vector, and based on the second feature extraction layer, feature extraction processing is performed on the sixth feature vector to obtain a second vector;

[0125] The seventh feature vector is determined based on the similarity between the first vector and the second vector.

[0126] In the embodiments of this specification, the second determining module is used for:

[0127] The sixth feature vector is magnified based on a preset magnification dimension to obtain the magnified sixth feature vector.

[0128] Based on the first feature extraction layer, feature extraction processing is performed on the amplified sixth feature vector to obtain the first vector, and based on the second feature extraction layer, feature extraction processing is performed on the amplified sixth feature vector to obtain the second vector.

[0129] In this embodiment of the specification, the detection model includes multiple data processing layers, each data processing layer including multiple encoding layers and multiple decoding layers corresponding to the multiple encoding layers. The number of nodes in each encoding layer is less than the number of nodes in the preceding encoding layer, and the number of nodes in each decoding layer is greater than the number of nodes in the preceding encoding layer. The input data of the decoding layer is determined based on the feature vector output by the preceding data processing layer and the feature vector obtained by the feature detection module through comparative detection processing of the feature vector output by the encoding layer corresponding to the decoding layer.

[0130] In the embodiments described in this specification, the sixth feature vector includes a first sub-feature vector and a second sub-feature vector, and the second encoding module is used for:

[0131] Based on the first encoding layer of the detection model, the fifth feature vector is encoded to obtain the first sub-feature vector;

[0132] Based on the second encoding layer of the detection model, the first sub-feature vector is encoded to obtain the second sub-feature vector;

[0133] The seventh feature vector includes a third sub-feature vector obtained by the comparison detection module based on the detection model, which performs comparison detection processing on the first sub-feature vector; and a fourth sub-feature vector obtained by the comparison detection module based on the detection model, which performs comparison detection processing on the second sub-feature vector. The eighth feature vector includes a fifth sub-feature vector and a sixth sub-feature vector. The second decoding module is used for:

[0134] Based on the first decoding layer of the detection model, the second sub-feature data is decoded to obtain the fifth sub-feature vector;

[0135] Based on the fourth sub-feature vector and the fifth sub-feature vector, the first input vector is determined;

[0136] Based on the second decoding layer of the detection model, the first input vector is decoded to obtain the sixth sub-feature vector;

[0137] Based on the third sub-feature vector and the sixth sub-feature vector, a ninth feature vector corresponding to the historical image is determined.

[0138] In the embodiments described in this specification, the device further includes:

[0139] The location determination module is used to determine the location information of the tampered region in the target image based on the pre-trained detection model and the target image when the target image is determined to be a tampered image based on the predicted label.

[0140] The risk detection module is used to perform risk detection processing on the target image based on the location information to obtain the risk detection result for the target image.

[0141] In the embodiments of this specification, the position determination module is used for:

[0142] Based on the predicted label of the target image output by the pre-trained detection model, which includes the classification information of the pixels of the target image, the location information of the tampered region in the target image is determined.

[0143] This specification provides a data processing apparatus that acquires a target image to be detected, performs image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image, encodes the first feature vector based on the pre-trained detection model to obtain a second feature vector, determines a third feature vector based on the similarity between the feature vectors obtained by feature extraction processing of the second feature vector by different feature extraction layers in the pre-trained detection model, decodes the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, determines a target feature vector corresponding to the target image based on the third and fourth feature vectors, classifies the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determines whether the target image is a tampered image based on the predicted label. In this way, by using different feature extraction layers of the detection model, the differences between different regions in the image can be learned, enabling the detection model to better learn the feature differences between tampered and untampered regions in the image. By fusing the feature vectors obtained through the encoding and decoding processes of the detection model, it is possible to detect whether an image has been tampered with, thereby improving the accuracy of detecting whether the image to be detected has been tampered with, and thus improving the security of identity verification.

[0144] Example 4

[0145] Following the same line of thought, embodiments of this specification also provide a data processing device, such as... Figure 8 As shown.

[0146] Data processing devices can vary considerably due to differences in configuration or performance. They may include one or more processors 801 and memory 802, with memory 802 storing one or more application programs or data. Memory 802 can be temporary or persistent storage. The application programs stored in memory 802 may include one or more modules (not shown), each module including a series of computer-executable instructions for the data processing device. Furthermore, processor 801 may be configured to communicate with memory 802 and execute the series of computer-executable instructions stored in memory 802 on the data processing device. The data processing device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input / output interfaces 805, and one or more keyboards 806.

[0147] Specifically, in this embodiment, the data processing device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the data processing device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0148] The target image to be detected is acquired, and the target image is processed by image feature extraction based on a pre-trained detection model to obtain a first feature vector corresponding to the target image;

[0149] Based on the pre-trained detection model, the first feature vector is encoded to obtain the second feature vector;

[0150] The third feature vector is determined based on the similarity between the feature vectors obtained by performing feature extraction processing on the second feature vector by different feature extraction layers in the pre-trained detection model.

[0151] Based on the pre-trained detection model, the second feature vector is decoded to obtain the fourth feature vector, and based on the third feature vector and the fourth feature vector, the target feature vector corresponding to the target image is determined.

[0152] Based on the pre-trained detection model, the target feature vector is classified to obtain the predicted label of the target image, and based on the predicted label, it is determined whether the target image is a tampered image.

[0153] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the data processing device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0154] This specification provides a data processing device that acquires a target image to be detected, performs image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image, encodes the first feature vector based on the pre-trained detection model to obtain a second feature vector, determines a third feature vector based on the similarity between the feature vectors obtained by feature extraction processing of the second feature vector by different feature extraction layers in the pre-trained detection model, decodes the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, determines a target feature vector corresponding to the target image based on the third and fourth feature vectors, classifies the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determines whether the target image is a tampered image based on the predicted label. In this way, by using different feature extraction layers of the detection model, the differences between different regions in the image can be learned, enabling the detection model to better learn the feature differences between tampered and untampered regions in the image. By fusing the feature vectors obtained through the encoding and decoding processes of the detection model, it is possible to detect whether an image has been tampered with, thereby improving the accuracy of detecting whether the image to be detected has been tampered with, and thus improving the security of identity verification.

[0155] Example 5

[0156] This specification also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described data processing method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may include, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0157] This specification provides a computer-readable storage medium that acquires a target image to be detected, performs image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image, encodes the first feature vector based on the pre-trained detection model to obtain a second feature vector, determines a third feature vector based on the similarity between the feature vectors obtained by feature extraction processing of the second feature vector by different feature extraction layers in the pre-trained detection model, decodes the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, determines a target feature vector corresponding to the target image based on the third and fourth feature vectors, classifies the target feature vector based on the pre-trained detection model to obtain a predicted label for the target image, and determines whether the target image is a tampered image based on the predicted label. In this way, by using different feature extraction layers of the detection model, the differences between different regions in the image can be learned, enabling the detection model to better learn the feature differences between tampered and untampered regions in the image. By fusing the feature vectors obtained through the encoding and decoding processes of the detection model, it is possible to detect whether an image has been tampered with, thereby improving the accuracy of detecting whether the image to be detected has been tampered with, and thus improving the security of identity verification.

[0158] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0159] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using a hardware physical module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0160] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0161] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0162] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in one or more software and / or hardware.

[0163] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may 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-ROM, optical storage, etc.) containing computer-usable program code.

[0164] The embodiments described herein are illustrated with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations 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, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0165] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0166] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0167] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0168] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0169] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0170] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0171] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may 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-ROM, optical storage, etc.) containing computer-usable program code.

[0172] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0173] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0174] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A data processing method, comprising: obtaining a target image to be detected, and performing image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image; performing encoding processing on the first feature vector based on the pre-trained detection model to obtain a second feature vector; determining a third feature vector based on similarities between feature vectors obtained by performing feature extraction processing on the second feature vector based on different feature extraction layers in the pre-trained detection model; performing decoding processing on the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and determining a target feature vector corresponding to the target image based on the third feature vector and the fourth feature vector; performing classification processing on the target feature vector based on the pre-trained detection model to obtain a predicted label of the target image, and determining whether the target image is a tampered image based on the predicted label.

2. The method of claim 1, before the performing encoding processing on the target image based on the pre-trained detection model to obtain the first feature vector corresponding to the target image, further comprising: obtaining historical images used to train the detection model, and type labels corresponding to the historical images, the type labels being used to represent whether the historical images are tampered images; performing image feature extraction processing on the historical images based on the detection model to obtain a fifth feature vector corresponding to the historical images; performing encoding processing on the fifth feature vector based on the detection model to obtain a sixth feature vector; determining a seventh feature vector based on similarities between feature vectors obtained by performing feature extraction processing on the sixth feature vector based on different feature extraction layers in the detection model; performing decoding processing on the sixth feature vector based on the detection model to obtain an eighth feature vector, and determining a ninth feature vector corresponding to the historical images based on the seventh feature vector and the eighth feature vector; performing classification processing on the ninth feature vector based on the detection model to obtain a predicted label of the historical images; iteratively training the detection model based on the type labels and the predicted labels of the historical images until the detection model converges to obtain a trained detection model.

3. The method of claim 2, the detection model comprising a first feature extraction layer and a second feature extraction layer, the first feature extraction layer and the second feature extraction layer having the same network structure and different network parameters, the determining the seventh feature vector based on similarities between feature vectors obtained by performing feature extraction processing on the sixth feature vector based on different feature extraction layers in the detection model, comprising: performing feature extraction processing on the sixth feature vector based on the first feature extraction layer to obtain a first vector, and performing feature extraction processing on the sixth feature vector based on the second feature extraction layer to obtain a second vector; determine the seventh feature vector based on similarity between the first vector and the second vector.

4. The method of claim 3, wherein the feature extraction processing of the sixth feature vector based on the first feature extraction layer to obtain the first vector and the feature extraction processing of the sixth feature vector based on the second feature extraction layer to obtain the second vector comprises: performing amplification processing on the sixth feature vector based on a preset amplification dimension to obtain an amplified sixth feature vector; and performing feature extraction processing on the amplified sixth feature vector based on the first feature extraction layer to obtain the first vector and performing feature extraction processing on the amplified sixth feature vector based on the second feature extraction layer to obtain the second vector.

5. The method of claim 4, wherein the detection model comprises a plurality of data processing layers, the data processing layers comprise a plurality of encoding layers and a plurality of decoding layers corresponding to the plurality of encoding layers, the number of nodes contained in the encoding layer is less than the number of nodes contained in the previous encoding layer of the encoding layer, the number of nodes contained in the decoding layer is greater than the number of nodes contained in the previous encoding layer of the encoding layer, the input data of the decoding layer is determined based on the feature vector output by the previous data processing layer and the feature vector obtained by the feature detection module based on the contrast detection processing of the feature vector output by the previous decoding layer corresponding to the encoding layer.

6. The method of claim 5, wherein the sixth feature vector comprises a first sub-feature vector and a second sub-feature vector, and the encoding processing of the fifth feature vector based on the detection model to obtain the sixth feature vector comprises: performing encoding processing on the fifth feature vector based on the first encoding layer of the detection model to obtain the first sub-feature vector; and performing encoding processing on the first sub-feature vector based on the second encoding layer of the detection model to obtain the second sub-feature vector; wherein the seventh feature vector comprises a third sub-feature vector obtained by the contrast detection module of the detection model based on the contrast detection processing of the first sub-feature vector and a fourth sub-feature vector obtained by the contrast detection module of the detection model based on the contrast detection processing of the second sub-feature vector, the eighth feature vector comprises a fifth sub-feature vector and a sixth sub-feature vector, and the decoding processing of the sixth feature vector based on the detection model to obtain the eighth feature vector and the determination of the ninth feature vector corresponding to the historical image based on the seventh feature vector and the eighth feature vector comprises: performing decoding processing on the second sub-feature vector based on the first decoding layer of the detection model to obtain the fifth sub-feature vector; determining a first input vector based on the fourth sub-feature vector and the fifth sub-feature vector; performing decoding processing on the first input vector based on the second decoding layer of the detection model to obtain the sixth sub-feature vector; and determining the ninth feature vector corresponding to the historical image based on the third sub-feature vector and the sixth sub-feature vector. ​ ​ ​ ​ ​ ​ ​ ​ ​ 7. The method of claim 1, further comprising: in a case where the target image is determined to be a tampered image based on the predicted label, determining, based on the pre-trained detection model and the target image, position information of a tampered region in the target image; performing risk detection processing on the target image based on the position information to obtain a risk detection result for the target image.

8. The method of claim 7, wherein the determining, based on the pre-trained detection model and the target image, the position information of the tampered region in the target image comprises: determining, based on classification information of pixel points of the target image included in the predicted label of the target image output by the pre-trained detection model, the position information of the tampered region in the target image.

9. A data processing apparatus, comprising: an image acquisition module configured to acquire a target image to be detected, and perform image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image; a first encoding module configured to perform encoding processing on the first feature vector based on the pre-trained detection model to obtain a second feature vector; a first determination module configured to determine a third feature vector based on similarity between feature vectors obtained by performing feature extraction processing on the second feature vector by different feature extraction layers in the pre-trained detection model; a first decoding module configured to perform decoding processing on the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and determine a target feature vector corresponding to the target image based on the third feature vector and the fourth feature vector; a first classification module configured to perform classification processing on the target feature vector based on the pre-trained detection model to obtain a predicted label of the target image, and determine whether the target image is a tampered image based on the predicted label.

10. A data processing device, comprising: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: acquire a target image to be detected, and perform image feature extraction processing on the target image based on a pre-trained detection model to obtain a first feature vector corresponding to the target image; perform encoding processing on the first feature vector based on the pre-trained detection model to obtain a second feature vector; determine a third feature vector based on similarity between feature vectors obtained by performing feature extraction processing on the second feature vector by different feature extraction layers in the pre-trained detection model; perform decoding processing on the second feature vector based on the pre-trained detection model to obtain a fourth feature vector, and determine a target feature vector corresponding to the target image based on the third feature vector and the fourth feature vector; Based on the pre-trained detection model, the target feature vector is classified to obtain a predicted label of the target image, and based on the predicted label, it is determined whether the target image is a tampered image.

Citation Information

Patent Citations

  • Tamper video detection method, device and equipment and readable storage medium

    CN110009621A

  • Method and device for detecting whether image is tampered and electronic equipment

    CN111161259A