Image detection method, device and equipment
By performing slicing of the target image and multi-layer processing using a pre-trained detection model, the problem of difficult to effectively detect image tampering in complex situations in the prior art is solved, and the detection effect and accuracy are improved.
Patent Information
- Application Number
- CN202510371962.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when detecting image tampering, especially when the image has an angle change, a light change or a small tampering area, it is difficult to effectively detect whether the image has tampering, resulting in a low detection effect.
By receiving the tamper detection request for the target image, the slicing process is performed based on the size information of the target image, and a plurality of sub-images are obtained, and an image sequence is constructed based on these sub-images. Then, the pre-trained detection model is used to perform tamper detection processing and classification processing on each sub-image, and combined with the tamper score and type information of each sub-image, the target image is type detection processing to determine its risk type.
The proportion of tampered areas in the image sequence is increased through image segmentation processing, and the detection rate of tampered areas is enhanced. At the same time, multi-layer processing is performed by pre-trained detection models, the tamper detection effect and image tamper detection accuracy are improved.
Smart Images

Figure CN119887770A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an image detection method, device and equipment. Background Art
[0002] With the rapid development of digital image processing technology, image tampering has become increasingly serious, causing great trouble to the protection of user privacy data. Therefore, it is crucial to improve the image tampering detection effect to ensure the security of user privacy data.
[0003] For example, an algorithm based on overlapping blocks can be used to capture the similarities and differences between different blocks of an image using single geometric transformations and compound geometric transformations to detect image tampering. However, if the image has complex conditions such as angle changes or lighting changes, or the tampered area is small, the algorithm based on overlapping blocks will find it difficult to effectively detect whether the image has been tampered with, resulting in poor detection of image tampering. To this end, the embodiments of this specification provide a better technical solution for image tampering detection. Summary of the invention
[0004] The purpose of the embodiments of this specification is to provide a better technical solution for detecting image tampering.
[0005] In order to implement the above technical solution, the embodiments of this specification are implemented as follows: An image detection method provided by an embodiment of the present specification includes: receiving a tampering detection request for a target image; in response to the tampering detection request, segmenting the target image according to size information of the target image to obtain multiple sub-images, and constructing an image sequence based on the multiple sub-images; performing tampering detection processing on each of the sub-images according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each of the sub-images; performing type detection processing on the target image according to the tampering score and type information corresponding to each of the sub-images through a third module of the pre-trained detection model to determine a risk type corresponding to the target image; and determining a tampering detection result for the target image according to the risk type corresponding to the target image.
[0006] An image detection device provided in an embodiment of the present specification includes: a request receiving module, which is used to receive a tampering detection request for a target image; a sequence construction module, which is used to segment the target image according to the size information of the target image in response to the tampering detection request to obtain multiple sub-images, and construct an image sequence based on the multiple sub-images; a first processing module, which is used to perform tampering detection processing on each of the sub-images according to the image sequence through a first module of a pre-trained detection model, determine the tampering score corresponding to each of the sub-images, and classify each of the sub-images according to the image sequence through a second module of the pre-trained detection model to determine the type information corresponding to each of the sub-images; a second processing module, which is used to perform type detection processing on the target image according to the tampering score and type information corresponding to each of the sub-images through a third module of the pre-trained detection model, and determine the risk type corresponding to the target image; and a structure determination module, which is used to determine the tampering detection result for the target image according to the risk type corresponding to the target image.
[0007] An image detection device provided in an embodiment of the present specification includes: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to: receive a tampering detection request for a target image; in response to the tampering detection request, segment the target image according to size information of the target image to obtain a plurality of sub-images, and construct an image sequence based on the plurality of sub-images; perform tampering detection processing on each of the sub-images according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each of the sub-images, and perform classification processing on each of the sub-images according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each of the sub-images; perform type detection processing on the target image according to the tampering score and type information corresponding to each of the sub-images through a third module of the pre-trained detection model to determine a risk type corresponding to the target image; and determine a tampering detection result for the target image according to the risk type corresponding to the target image.
[0008] The embodiments of the present specification also provide a storage medium, which is used to store computer-executable instructions, and the executable instructions implement the following process when executed by a processor: receiving a tampering detection request for a target image; in response to the tampering detection request, segmenting the target image according to the size information of the target image to obtain multiple sub-images, and constructing an image sequence based on the multiple sub-images; performing tampering detection processing on each of the sub-images according to the image sequence through a first module of a pre-trained detection model, determining a tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through a second module of the pre-trained detection model, determining type information corresponding to each of the sub-images; performing type detection processing on the target image according to the tampering score and type information corresponding to each of the sub-images through a third module of the pre-trained detection model, and determining the risk type corresponding to the target image; and determining a tampering detection result for the target image according to the risk type corresponding to the target image.
[0009] The embodiments of the present specification also provide a computer program product, including a computer program, which implements the following process when executed by a processor: receiving a tampering detection request for a target image; in response to the tampering detection request, segmenting the target image according to the size information of the target image to obtain multiple sub-images, and constructing an image sequence based on the multiple sub-images; performing tampering detection processing on each of the sub-images according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each of the sub-images; performing type detection processing on the target image according to the tampering score and type information corresponding to each of the sub-images through a third module of the pre-trained detection model to determine the risk type corresponding to the target image; and determining a tampering detection result for the target image according to the risk type corresponding to the target image. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. Figure 1 A schematic diagram of an image detection method in this specification; Figure 2This is a schematic diagram of a detection process for determining risk types through three modules of a detection model in this specification; Figure 3 A schematic diagram of a tampered image in this manual; Figure 4 A schematic diagram of a data processing process for determining a tampering score by using a detection model constructed by a windowed ViT algorithm in this specification; Figure 5 A schematic diagram of a method for determining a tampering score corresponding to each sub-image in this specification; Figure 6 This is a schematic diagram of a data processing process for determining tampered areas and type information through multi-view fusion in this specification; Figure 7 A schematic diagram of a method for determining a risk type corresponding to a target image in this specification; Figure 8 This is a schematic diagram of a process of segmenting a target image to obtain sub-images in this specification; Fig. 9 A schematic diagram of a risk detection process in this specification; Fig.10 A schematic diagram of an image detection device in this specification; Fig.11 This is a schematic diagram of an image detection device in this specification. DETAILED DESCRIPTION
[0011] The embodiments of this specification provide an image detection method, device and equipment.
[0012] In order 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 in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0013] The embodiments of the present specification provide a better technical solution for image tampering detection. In the solution, a tampering detection request for a target image is received, and in response to the tampering detection request, the target image is segmented according to the size information of the target image to obtain multiple sub-images, and an image sequence is constructed based on the multiple sub-images. A tampering detection process is performed on each sub-image according to the image sequence through a first module of a pre-trained detection model to determine the tampering score corresponding to each sub-image, and a classification process is performed on each sub-image according to the image sequence through a second module of the pre-trained detection model to determine the type information corresponding to each sub-image. Then, a type detection process can be performed on the target image according to the tampering score and type information corresponding to each sub-image through a third module of the pre-trained detection model to determine the risk type corresponding to the target image. Finally, a tampering detection result for the target image can be determined according to the risk type corresponding to the target image. In this way, on the one hand, since the tampered area may be small in the target image, the tampered area is more sensitive to size changes. Through image segmentation processing, the proportion of the tampered area in the image sequence can be increased, that is, the image sequence constructed by dynamic segmentation processing can improve the detection rate of the tampered area. On the other hand, through the pre-trained detection model, the image sequence is subjected to tampering detection processing and classification processing respectively, and the processing results are fused for type detection processing), which can improve the tampering detection effect for the target image and improve the accuracy of image tampering detection. For specific processing, please refer to the specific content in the following embodiments.
[0014] like Figure 1 As shown, the embodiment of this specification provides an image detection method, and the execution subject of the method can be a server, wherein the server can be an independent server, or a server cluster composed of multiple servers, etc. In this embodiment, the execution subject is taken as an example to be described in detail, and the method can specifically include the following steps: In step S102 , a tampering detection request for a target image is received.
[0015] Among them, the target image can be any image that may have a risk of tampering detection. For example, the target image can be an image used to process the target business. For example, taking the target business as identity authentication business as an example, the target image can be a user's biometric image, certificate image, signature image, and other images containing user identity information. Taking the target business as resource transfer business as an example, the target image can be a resource transfer page image, a resource transfer credential image, and other images containing resource transfer business information. Taking the target business as data access as an example, the target image can be a user authentication result image, a user identity verification result image, and other images containing user data access permission information.
[0016] In implementation, the server may determine a triggering mechanism for a tampering detection request according to the detection priority of the service to which the image belongs.
[0017] For example, when the detection priority of a target service (such as identity authentication service, resource transfer service, etc.) is high, if the user triggers the execution of the target service, then the server can determine the acquired image corresponding to the target service as the target image, and trigger a tampering detection request for the target image, so as to perform image tampering detection processing on the target service in real time.
[0018] When the detection priority of the target business (such as data access business, etc.) is low, the server can determine the image related to the target business within the preset detection period as the target image, and trigger a tampering detection request for the target image to perform image tampering detection processing regularly.
[0019] Alternatively, the server may also receive a tampering detection request for a target image triggered by a user.
[0020] The trigger mechanism of the tamper detection request mentioned above is an optional and feasible trigger mechanism. In actual application scenarios, there may be a variety of different trigger mechanisms. Different trigger mechanisms may be selected according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.
[0021] In step S104, in response to the tampering detection request, the target image is segmented according to the size information of the target image to obtain a plurality of sub-images, and an image sequence is constructed based on the plurality of sub-images.
[0022] Among them, the image segmentation process can be to divide the image into several meaningful parts or regions. Its main purpose is to simplify the image analysis process and make subsequent processing (such as feature extraction, target recognition, etc.) more efficient and accurate.
[0023] In implementation, the server can select a suitable grid (i.e., segmentation size) from segmentation sizes such as 1*1, 1*2, 1*3, 1*4, 2*2, 2*3, 3*2, etc. according to the aspect ratio of the target image to segment the target image.
[0024] Alternatively, the server may also determine a segmentation size corresponding to the size information of the target image according to a preset correspondence between the image size and the segmentation size, and segment the target image according to the determined segmentation size to obtain a plurality of sub-images.
[0025] The server can construct an image sequence according to the position information of each sub-image in the target image.
[0026] In step S106, through the first module of the pre-trained detection model, for each sub-image, tampering detection processing is performed according to the image sequence to determine the tampering score corresponding to each sub-image, and through the second module of the pre-trained detection model, for each sub-image, classification processing is performed according to the image sequence to determine the type information corresponding to each sub-image.
[0027] Among them, the first module can be a module for performing tampering detection processing constructed according to a preset deep learning algorithm, and the second module can be a module for performing classification processing constructed according to a preset classification algorithm.
[0028] In implementation, as Figure 2 shown, the server can input the image sequence into the first module and the second module respectively to perform tampering detection processing and classification processing on each sub-image, and obtain the tampering score and type information corresponding to each sub-image.
[0029] Taking the target image as an image containing document content as an example, the first module can be a module for performing text tampering detection on image data constructed according to the graph convolutional neural network algorithm. Since in the text tampering scenario, the tampering area of the text is small. For example, in the comparison graph of the un-tampered image and the tampered image as Figure 3 shown, it can be seen that the tampered text (such as "one" in the un-tampered image 1 is tampered into "two", and "Hangzhou" in the un-tampered image 2 is tampered into "Fuzhou") occupies a small area in the image and is not easily detected. However, through image segmentation, the proportion of each sub-image can be increased, and combined with the advantage that text tampering detection is more sensitive to local compression for a long time, the detection rate of the tampering area can be effectively improved.
[0030] In step S108, through the third module of the pre-trained detection model, according to the tampering score and type information corresponding to each sub-image, type detection processing is performed on the target image to determine the risk type corresponding to the target image.
[0031] Among them, the third module of the pre-trained detection model can be a module for performing information fusion and type detection processing constructed according to a preset deep learning algorithm, and the risk type can include various different types such as high risk, medium risk, and low risk.
[0032] In implementation, as Figure 2 shown, the server can perform information fusion processing on the tampering score and type information corresponding to each sub-image through the third module, so as to perform type detection processing through the information fusion result and obtain the risk type corresponding to the target image.
[0033] In addition, taking the detection model as a module built according to the windowed Vision Transformer (ViT) algorithm as an example, the server can assemble multiple sub-images obtained by segmentation into a batch (i.e., construct an image sequence) and send the image sequence to the detection model for inference.
[0034] like Figure 4 As shown, the server can input the image sequence after patch slicing into the backbone network backbone of the windowed Vision Transformer (Windowed-ViT) algorithm to generate a feature map, and then determine the tampering score pair corresponding to each sub-image through the class decoder (such as a first score for indicating that the sub-image is an untampered image, and a second score for indicating that the sub-image is a tampered image), and then aggregate the tampering score of each grid (i.e., sub-image) through the pooling layer (such as max poling, average poling, etc.) and the tampering score pair corresponding to each sub-image to obtain the tampering score of the target image. Wherein, Figure 4 As shown, in the tampering score pair [0.1, 0.9], 0.1 is the first score of the sub-image being an untampered image, and 0.9 is the second score of the sub-image being a tampered image.
[0035] Then, the server may perform type detection processing on the target image through the third module, the tampering score of each target image and the type information corresponding to each sub-image, and determine the risk type corresponding to the target image.
[0036] In addition, the above risk type determination process can be used as a pluggable component in any tampering detection algorithm for digital forensics. For example, it can be used in document text tampering detection solutions, because the tampered area of the text is generally very small and extremely sensitive to scale changes. After applying the dynamic segmentation algorithm, the proportion of the tampered area in a single patch can be increased, thereby effectively improving the detection rate of the tampered area. Pluggable modules can be used in tampering detection algorithms in scenarios such as digital forensics, which can effectively improve the efficiency of model reasoning and the accuracy of recognition.
[0037] Among them, digital image forensics can refer to the process of analyzing and verifying digital images through technical means to determine their authenticity and source. Digital image forensics: Digital image forensics refers to the process of analyzing and verifying digital images through technical means to determine their authenticity and source. It involves reviewing the acquisition, storage and dissemination of images to seek evidence and determine whether the images have been tampered with or forged.
[0038] It involves reviewing the acquisition, storage and dissemination of images to seek evidence and determine whether the images have been tampered with or forged.
[0039] In step S110 , a tampering detection result for the target image is determined according to the risk type corresponding to the target image.
[0040] In implementation, the server may determine the tampering detection result for the target image based on the risk type corresponding to the target image and the detection priority of the business to which the target image belongs. For example, when the risk type corresponding to the target image is medium risk or low risk, and the detection priority of the business to which the target image belongs is low, the server may send the risk type corresponding to the target image and the target image to a preset processor to determine the tampering detection result for the target image through the preset processor.
[0041] Alternatively, when the risk type corresponding to the target image is medium risk or high risk, and the detection priority of the service to which the target image belongs is high, the server may determine that the tampering detection result of the target image is that the target image has been tampered with.
[0042] When it is determined that the tampering detection result of the target image is that it has been tampered with, the server may output preset warning information.
[0043] In this way, by dynamically dividing the input image, grouping reasoning and fusing the results, the problems of low algorithm recognition accuracy and poor robustness can be effectively solved, especially when the tampered area is relatively small, the detection accuracy can be significantly improved.
[0044] The embodiments of the present specification provide an image detection method, which receives a tampering detection request for a target image, and in response to the tampering detection request, segments the target image according to size information of the target image to obtain multiple sub-images, and constructs an image sequence based on the multiple sub-images, and performs tampering detection on each sub-image according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each sub-image, and performs classification on each sub-image according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each sub-image, and then, type detection can be performed on the target image according to the tampering score and type information corresponding to each sub-image through a third module of the pre-trained detection model to determine the risk type corresponding to the target image, and finally, the tampering detection result for the target image can be determined according to the risk type corresponding to the target image. In this way, on the one hand, since the tampered area may be smaller in the target image, the tampered area is more sensitive to size changes. The image segmentation process can increase the proportion of the tampered area in the image sequence, that is, constructing the image sequence through dynamic segmentation can improve the detection rate of the tampered area. On the other hand, through the pre-trained detection model, the image sequence is subjected to tampering detection processing and classification processing respectively, and the processing results are fused for type detection processing), which can improve the tampering detection effect for the target image and improve the accuracy of image tampering detection.
[0045] In practical applications, in step S106, the first module of the pre-trained detection model is used to perform tampering detection processing on each sub-image according to the image sequence, and the specific processing method for determining the tampering score corresponding to each sub-image can be various. The following is an optional processing method, such as Figure 5 As shown, the processing may specifically include the following steps S1062 to S10610.
[0046] In step S1062, the first submodule of the first module performs visual feature extraction processing on each sub-image according to the image sequence to obtain a visual feature header corresponding to each sub-image.
[0047] The first submodule of the first module may be a module constructed according to a preset deep learning algorithm for performing visual feature extraction processing. For example, the first submodule of the first module may be a module constructed according to a preset number of convolutional layers.
[0048] In implementation, Figure 6As shown, the server can input the image sequence into the first submodule of the first module, so as to perform visual feature extraction processing on each sub-image obtained through the image segmentation (Sliding Window) processing through the first submodule of the first module to obtain a visual feature head (Visual Preception Head) corresponding to each sub-image.
[0049] In step S1064, the second submodule of the first module performs frequency domain feature extraction processing on each sub-image according to the image sequence to obtain a frequency domain feature header corresponding to each sub-image.
[0050] In implementation, the server may input the image sequence into the second submodule of the first module, and the second submodule of the first module may extract frequency domain features from the discrete cosine transform (DCT) coefficients of each sub-image to obtain a frequency domain feature header for each sub-image, so as to compensate for the inconspicuousness of the visual features through the frequency domain features.
[0051] For example, Figure 6 As shown, the server can first convert each sub-image into the YCrCb color space and calculate the DCT coefficient map (DCT Array) of the Y channel. Then, the quantization table (Quant Table) is embedded in the DCT coefficient map, and finally the frequency feature head (Frequency Preception Head) corresponding to each sub-image is obtained through concatenation and downsampling.
[0052] In step S1066, the visual feature head corresponding to each sub-image is processed by the first processing layer of the third sub-module of the first module to obtain a first vector, and the frequency domain feature head corresponding to each sub-image is processed by the first processing layer of the third sub-module of the first module to obtain a second vector.
[0053] Among them, the first processing layer is a data processing layer built based on the Multi-Head Attention mechanism. The Multi-Head Attention mechanism can capture the attention distribution of different subspaces of the input sequence by processing multiple attention heads in parallel, thereby improving the model's ability to understand and capture complex dependencies.
[0054] In practical applications, in step S1066, the visual feature head corresponding to each sub-image is processed by the first processing layer of the third sub-module of the first module to obtain the first vector. The specific processing method can be varied, and the pre-trained detection model can be constructed based on the windowed Transformer algorithm. Accordingly, an optional processing method is provided below, which can specifically include the processing of the following steps A1~A2.
[0055] In step A1, each sub-image is divided based on a preset window to obtain a plurality of window images.
[0056] In step A2, the visual feature heads of the plurality of window images corresponding to each sub-image are processed by the first processing layer of the third sub-module of the first module to obtain a first vector.
[0057] In implementation, taking the detection model built based on the windowed Vision Transformer (ViT) algorithm as an example, the server can divide and process each sub-image based on a preset window to obtain multiple window images, and obtain the visual feature head of each window image corresponding to each sub-image. In this way, the server can process the visual feature heads of the multiple window images corresponding to each sub-image through the first processing layer of the third sub-module of the first module to obtain a first vector.
[0058] In this way, first, the ViT algorithm can divide the input image into a series of fixed-size image patches and flatten these image patches into vectors. Then, the image patches (i.e., multiple sub-images) can be converted into embedded vectors (i.e., image sequences) with position information through linear transformation and position encoding. Subsequently, these embedded vectors can be input into a multi-layer Transformer encoder for processing. Throughout this process, ViT can use the self-attention mechanism to effectively capture the global features in the image and generate a global representation (i.e., the first vector).
[0059] Furthermore, through the windowed Vision Transformer (ViT) algorithm, a preset window can be added to the ViT backbone network, which can balance the resolution and computational cost, avoid the loss of image tampering traces due to downsampling, and improve the accuracy of tampering detection.
[0060] In step S1068, feature extraction processing is performed on the first vector and the second vector through the second processing layer of the third submodule of the first module to obtain a feature vector corresponding to each sub-image.
[0061] The second processing layer may be a data processing layer constructed based on a feedforward neural network algorithm, for example, Figure 6 As shown, the second processing layer can be a data processing layer constructed by a Modality-Shared Feedforward neural network (Modality-Shared FNN) with shared parameters.
[0062] In implementation, the server can input the first vector and the second vector obtained by the first processing layer of the third submodule constructed by the multi-head attention mechanism into the second processing layer of the third submodule of the first module to perform feature extraction processing on the first vector and the second vector to obtain a feature vector corresponding to each sub-image.
[0063] In step S10610, the fourth submodule of the first module performs tampering detection processing on each subimage according to the feature vector corresponding to each subimage, and determines the tampering score corresponding to each subimage.
[0064] In implementation, the server can input the feature vector corresponding to each sub-image into the fourth sub-module of the first module constructed by the pooling layer and the multi-layer perceptron, so as to perform tampering detection processing on each sub-image through the pooling layer and the multi-layer perceptron according to the feature vector corresponding to each sub-image, and determine the tampering score corresponding to each sub-image.
[0065] In practical applications, in step S106, the second module of the pre-trained detection model is used to classify each sub-image according to the image sequence. The specific processing method for determining the type information corresponding to each sub-image can be varied, and the sizes of the multiple window images corresponding to each sub-image can be different. Accordingly, an optional processing method is provided below, which can specifically include the processing of the following steps S10612~S10614.
[0066] In step S10612, feature fusion processing is performed based on the feature vectors of multiple window images corresponding to each sub-image through the first processing layer of the second module of the pre-trained detection model to obtain a target feature vector corresponding to each sub-image.
[0067] Among them, the first processing layer of the second module can be constructed according to the Feature Pyramid Networks (FPN) algorithm. FPN is a top-down architecture that can strengthen semantic information by building a feature pyramid. In deep neural networks, high-level features usually contain stronger semantic information, while low-level features contain richer positioning information. FPN can transfer strong semantic features from high levels to low levels through upsampling and lateral connections, thereby enhancing the entire pyramid, so that the network can better handle targets of different scales while maintaining semantic information.
[0068] In step S10614, the sub-images are classified according to the target feature vectors corresponding to each sub-image through the second processing layer of the second module of the pre-trained detection model to determine the type information corresponding to each sub-image.
[0069] The second processing layer of the second module may be constructed according to a multilayer perceptron (MLP).
[0070] In practical applications, in the above step S108, the third module of the pre-trained detection model performs type detection processing on the target image according to the tampering score and type information corresponding to each sub-image, and the specific processing method for determining the risk class corresponding to the target image can be various. The following is an optional processing method, such as Figure 7 As shown, the processing may specifically include the following steps S1082 to S1084.
[0071] In step S1082, the first processing layer of the third module of the pre-trained detection model is used to perform score aggregation processing according to the tampering score corresponding to each sub-image to determine the tampering score of the target image.
[0072] In actual applications, in step S1082, the first processing layer of the third module of the pre-trained detection model performs score aggregation processing according to the tampering score corresponding to each sub-image, and the specific processing method for determining the tampering score of the target image can be varied. The tampering score corresponding to each sub-image includes a first score for characterizing the sub-image as an untampered image, and a second score for characterizing the sub-image as a tampered image. Accordingly, an optional processing method is provided below, which may specifically include the processing of the following step B1.
[0073] In step B1, the tampering score of the target image is determined according to the maximum value and / or average value of the second scores corresponding to each sub-image through the first processing layer of the third module of the pre-trained detection model.
[0074] Among them, the first processing layer of the third module can be a pooling layer, and the tampering score of the target image can be determined through a max pooling layer and / or an average pooling layer.
[0075] In step S1084, the second processing layer of the third module of the pre-trained detection model performs type detection processing on the target image according to the type information corresponding to each sub-image and the tampering score of the target image to determine the risk type corresponding to the target image.
[0076] Among them, the second processing layer of the third module can be constructed according to a multi-view fusion algorithm.
[0077] In practical applications, the specific processing methods for segmenting the target image according to the size information of the target image in the above step S104 to obtain multiple sub-images can be various. An optional processing method is provided below, such as Figure 8As shown, the processing may specifically include the following step S1042.
[0078] In step S1042, the segmentation size corresponding to the target image is determined according to the size information of the target image, the image type to which the target image belongs, and the image resolution of the target image, and the target image is segmented according to the segmentation size to obtain multiple sub-images.
[0079] In implementation, the server can determine the segmentation size corresponding to the target image through a segmentation model based on the size information of the target image, the image type to which the target image belongs, and the image resolution of the target image, and divide the target image into multiple sub-images according to the segmentation size.
[0080] Among them, the segmentation model can be a model constructed according to a preset deep learning algorithm.
[0081] In practical applications, risk detection processing can also be performed on the target business corresponding to the target image according to the tampering detection result. The specific processing methods of risk detection processing can be varied. The following is an optional processing method, such as Fig. 9 As shown, the processing may specifically include the following steps S802 to S806.
[0082] In step S802, when the target image is determined to be a tampered image according to the tampering detection result of the target image, a tampered area in the target image is determined by using a pre-trained detection model.
[0083] In implementation, Figure 6 As shown, in the case where the target image is determined to be a tampered image according to the tampering detection result of the target image, the tampered area in the target image can also be determined by a pre-trained detection model.
[0084] In step S804, text recognition processing is performed on the tampered area in the target image to obtain the target text corresponding to the tampered area.
[0085] In implementation, the server may use an optical character recognition (OCR) algorithm to perform text recognition processing on the tampered area in the target image to obtain the target text corresponding to the tampered area.
[0086] In step S806, the risk detection result of the target business corresponding to the target image is determined according to the target text corresponding to the tampered area.
[0087] In implementation, the server may perform risk detection processing on the target text corresponding to the tampered area according to the risk detection rules corresponding to the target business, so as to obtain the risk detection result of the target business corresponding to the target image.
[0088] For example, the server may perform keyword matching processing on the target text corresponding to the tampered area according to the risk keywords corresponding to the target business, and determine the risk detection result of the target business corresponding to the target image according to the keyword matching result.
[0089] Alternatively, the server may also utilize a preset large language model to perform risk detection processing on the target text corresponding to the tampered area according to the risk detection rules corresponding to the target business, so as to obtain a risk detection result of the target business corresponding to the target image.
[0090] The above-mentioned method for determining the risk detection results is an optional and feasible determination method. In actual application scenarios, there may be a variety of different determination methods. Different determination methods can be selected according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.
[0091] The embodiments of the present specification provide an image detection method, which receives a tampering detection request for a target image, and in response to the tampering detection request, segments the target image according to size information of the target image to obtain multiple sub-images, and constructs an image sequence based on the multiple sub-images, and performs tampering detection on each sub-image according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each sub-image, and performs classification on each sub-image according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each sub-image, and then, type detection can be performed on the target image according to the tampering score and type information corresponding to each sub-image through a third module of the pre-trained detection model to determine the risk type corresponding to the target image, and finally, the tampering detection result for the target image can be determined according to the risk type corresponding to the target image. In this way, on the one hand, since the tampered area may be smaller in the target image, the tampered area is more sensitive to size changes. The image segmentation process can increase the proportion of the tampered area in the image sequence, that is, constructing the image sequence through dynamic segmentation can improve the detection rate of the tampered area. On the other hand, through the pre-trained detection model, the image sequence is subjected to tampering detection processing and classification processing respectively, and the processing results are fused for type detection processing), which can improve the tampering detection effect for the target image and improve the accuracy of image tampering detection.
[0092] The above is an image detection method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides an image detection device, such as Fig.10 shown.
[0093] The image detection device comprises: a request receiving module 901, a sequence building module 902, a first processing module 903, a second processing module 904 and a result determination module 905, wherein: A request receiving module 901 is used to receive a tampering detection request for a target image; A sequence construction module 902 is used to respond to the tampering detection request, segment the target image according to the size information of the target image, obtain multiple sub-images, and construct an image sequence based on the multiple sub-images; A first processing module 903 is configured to perform tampering detection processing on each of the sub-images according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each of the sub-images, and to perform classification processing on each of the sub-images according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each of the sub-images; The second processing module 904 is used to perform type detection processing on the target image according to the tampering score and type information corresponding to each sub-image through the third module of the pre-trained detection model, and determine the risk type corresponding to the target image; The structure determination module 905 is used to determine the tampering detection result for the target image according to the risk type corresponding to the target image.
[0094] In the embodiment of this specification, the first processing module 903 is used to: By using the first submodule of the first module, according to the image sequence, performing visual feature extraction processing on each of the sub-images to obtain a visual feature header corresponding to each of the sub-images; By using the second submodule of the first module, frequency domain feature extraction processing is performed on each of the sub-images according to the image sequence to obtain a frequency domain feature header corresponding to each of the sub-images; Processing the visual feature head corresponding to each of the sub-images through the first processing layer of the third sub-module of the first module to obtain a first vector, and processing the frequency domain feature head corresponding to each of the sub-images through the first processing layer of the third sub-module of the first module to obtain a second vector, wherein the first processing layer is a data processing layer constructed based on a multi-head attention mechanism; Performing feature extraction processing on the first vector and the second vector through the second processing layer of the third submodule of the first module to obtain a feature vector corresponding to each of the sub-images, wherein the second processing layer is a data processing layer constructed based on a feedforward neural network algorithm; Through the fourth submodule of the first module, tampering detection processing is performed on each of the sub-images according to the feature vector corresponding to each of the sub-images to determine the tampering score corresponding to each of the sub-images.
[0095] In the embodiment of this specification, the pre-trained detection model is constructed based on a windowed Transformer algorithm, and the first processing module 903 is used to: Based on a preset window, each of the sub-images is divided and processed to obtain a plurality of window images; The first vector is obtained by processing the visual feature heads of the multiple window images corresponding to each of the sub-images through the first processing layer of the third sub-module of the first module.
[0096] In the embodiment of this specification, the sizes of the multiple window images corresponding to each sub-image are different, and the first processing module 903 is used to: By using the first processing layer of the second module of the pre-trained detection model, feature fusion processing is performed based on the feature vectors of the plurality of window images corresponding to each of the sub-images to obtain a target feature vector corresponding to each of the sub-images, wherein the first processing layer of the second module is constructed according to a feature pyramid network algorithm; The sub-images are classified and processed according to the target feature vectors corresponding to each sub-image through the second processing layer of the second module of the pre-trained detection model to determine the type information corresponding to each sub-image.
[0097] In the embodiment of this specification, the second processing module is used to: Performing score aggregation processing according to the tampering score corresponding to each of the sub-images through the first processing layer of the third module of the pre-trained detection model to determine the tampering score of the target image; Through the second processing layer of the third module of the pre-trained detection model, type detection processing is performed on the target image according to the type information corresponding to each sub-image and the tampering score of the target image to determine the risk type corresponding to the target image.
[0098] In the embodiment of the present specification, the tampering score corresponding to each of the sub-images includes a first score used to characterize the sub-image as an untampered image and a second score used to characterize the sub-image as a tampered image, and the second processing module is used to: The tampering score of the target image is determined according to the maximum value and / or average value of the second scores corresponding to each of the sub-images through the first processing layer of the third module of the pre-trained detection model.
[0099] In the embodiments of this specification, the sequence building module is used to: The segmentation size corresponding to the target image is determined according to the size information of the target image, the image type to which the target image belongs, and the image resolution of the target image, and the target image is segmented according to the segmentation size to obtain the multiple sub-images.
[0100] In the embodiment of this specification, the device further includes: A region determination module, configured to determine a tampered region in the target image by using the pre-trained detection model when the target image is determined to be a tampered image according to the tampering detection result of the target image; A text recognition module, used to perform text recognition processing on the tampered area in the target image to obtain the target text corresponding to the tampered area; The risk detection module is used to determine the risk detection result of the target business corresponding to the target image according to the target text corresponding to the tampered area.
[0101] An embodiment of the present specification provides an image detection device, which receives a tampering detection request for a target image, responds to the tampering detection request, segments the target image according to size information of the target image to obtain multiple sub-images, and constructs an image sequence based on the multiple sub-images, performs tampering detection on each sub-image according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each sub-image, and performs classification on each sub-image according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each sub-image, and then, performs type detection on the target image according to the tampering score and type information corresponding to each sub-image through a third module of the pre-trained detection model to determine a risk type corresponding to the target image, and finally, determines a tampering detection result for the target image according to the risk type corresponding to the target image. In this way, on the one hand, since the tampered area may be smaller in the target image, the tampered area is more sensitive to size changes. The image segmentation process can increase the proportion of the tampered area in the image sequence, that is, constructing the image sequence through dynamic segmentation can improve the detection rate of the tampered area. On the other hand, through the pre-trained detection model, the image sequence is subjected to tampering detection processing and classification processing respectively, and the processing results are fused for type detection processing), which can improve the tampering detection effect for the target image and improve the accuracy of image tampering detection.
[0102] The above is an image detection device provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides an image detection device, such as Fig.11 shown.
[0103] The image detection device may provide a terminal device or a server, etc. for the above-mentioned embodiment.
[0104] The image detection device may have relatively large differences due to different configurations or performances, and may include one or more processors 1001 and memory 1002, and the memory 1002 may store one or more storage applications or data. Among them, the memory 1002 may be a short-term storage or a permanent storage. The application stored in the memory 1002 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the image detection device. Furthermore, the processor 1001 may be configured to communicate with the memory 1002, and execute a series of computer executable instructions in the memory 1002 on the image detection device. The image detection device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input and output interfaces 1005, and one or more keyboards 1006.
[0105] Specifically, in this embodiment, the image detection device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the image detection device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following: receiving a tampering detection request for a target image; In response to the tampering detection request, segment the target image according to size information of the target image to obtain a plurality of sub-images, and construct an image sequence based on the plurality of sub-images; Performing tampering detection processing on each of the sub-images according to the image sequence through the first module of the pre-trained detection model to determine the tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through the second module of the pre-trained detection model to determine the type information corresponding to each of the sub-images; By means of the third module of the pre-trained detection model, type detection processing is performed on the target image according to the tampering score and type information corresponding to each of the sub-images to determine the risk type corresponding to the target image; A tampering detection result for the target image is determined according to the risk type corresponding to the target image.
[0106] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the image detection device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0107] An embodiment of the present specification provides an image detection device, which receives a tampering detection request for a target image, and in response to the tampering detection request, segments the target image according to size information of the target image to obtain multiple sub-images, and constructs an image sequence based on the multiple sub-images, and performs tampering detection on each sub-image according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each sub-image, and performs classification on each sub-image according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each sub-image, and then, can perform type detection on the target image according to the tampering score and type information corresponding to each sub-image through a third module of the pre-trained detection model to determine the risk type corresponding to the target image, and finally, can determine the tampering detection result for the target image according to the risk type corresponding to the target image. In this way, on the one hand, since the tampered area may be smaller in the target image, the tampered area is more sensitive to size changes. The image segmentation process can increase the proportion of the tampered area in the image sequence, that is, constructing the image sequence through dynamic segmentation can improve the detection rate of the tampered area. On the other hand, through the pre-trained detection model, the image sequence is subjected to tampering detection processing and classification processing respectively, and the processing results are fused for type detection processing), which can improve the tampering detection effect for the target image and improve the accuracy of image tampering detection.
[0108] Furthermore, based on the above Figures 1 to 9 One or more embodiments of this specification further provide a storage medium for storing computer executable instruction information. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instruction information stored in the storage medium is executed by the processor, the following process can be implemented: receiving a tampering detection request for a target image; In response to the tampering detection request, segment the target image according to size information of the target image to obtain a plurality of sub-images, and construct an image sequence based on the plurality of sub-images; Performing tampering detection processing on each of the sub-images according to the image sequence through the first module of the pre-trained detection model to determine the tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through the second module of the pre-trained detection model to determine the type information corresponding to each of the sub-images; By means of the third module of the pre-trained detection model, type detection processing is performed on the target image according to the tampering score and type information corresponding to each of the sub-images to determine the risk type corresponding to the target image; A tampering detection result for the target image is determined according to the risk type corresponding to the target image.
[0109] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0110] An embodiment of the present specification provides a storage medium, which receives a tampering detection request for a target image, responds to the tampering detection request, segments the target image according to size information of the target image to obtain multiple sub-images, and constructs an image sequence based on the multiple sub-images, performs tampering detection on each sub-image according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each sub-image, and performs classification on each sub-image according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each sub-image, and then, performs type detection on the target image according to the tampering score and type information corresponding to each sub-image through a third module of the pre-trained detection model to determine a risk type corresponding to the target image, and finally, determines a tampering detection result for the target image according to the risk type corresponding to the target image. In this way, on the one hand, since the tampered area may be smaller in the target image, the tampered area is more sensitive to size changes. The image segmentation process can increase the proportion of the tampered area in the image sequence, that is, constructing the image sequence through dynamic segmentation can improve the detection rate of the tampered area. On the other hand, through the pre-trained detection model, the image sequence is subjected to tampering detection processing and classification processing respectively, and the processing results are fused for type detection processing), which can improve the tampering detection effect for the target image and improve the accuracy of image tampering detection.
[0111] Furthermore, based on the above Figures 1 to 9One or more embodiments of the present specification further provide a computer program product, including a computer program. When the computer program in the computer program product is executed by a processor, the following process can be implemented: receiving a tampering detection request for a target image; In response to the tampering detection request, segment the target image according to size information of the target image to obtain a plurality of sub-images, and construct an image sequence based on the plurality of sub-images; Performing tampering detection processing on each of the sub-images according to the image sequence through the first module of the pre-trained detection model to determine the tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through the second module of the pre-trained detection model to determine the type information corresponding to each of the sub-images; By means of the third module of the pre-trained detection model, type detection processing is performed on the target image according to the tampering score and type information corresponding to each of the sub-images to determine the risk type corresponding to the target image; A tampering detection result for the target image is determined according to the risk type corresponding to the target image.
[0112] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned computer program product embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0113] The embodiments of the present specification provide a computer program product, which receives a tampering detection request for a target image, and in response to the tampering detection request, segments the target image according to size information of the target image to obtain multiple sub-images, and constructs an image sequence based on the multiple sub-images, and performs tampering detection on each sub-image according to the image sequence through a first module of a pre-trained detection model to determine a tampering score corresponding to each sub-image, and performs classification on each sub-image according to the image sequence through a second module of the pre-trained detection model to determine type information corresponding to each sub-image, and then, can perform type detection on the target image according to the tampering score and type information corresponding to each sub-image through a third module of the pre-trained detection model to determine the risk type corresponding to the target image, and finally, can determine the tampering detection result for the target image according to the risk type corresponding to the target image. In this way, on the one hand, since the tampered area may be smaller in the target image, the tampered area is more sensitive to size changes. The image segmentation process can increase the proportion of the tampered area in the image sequence, that is, constructing the image sequence through dynamic segmentation can improve the detection rate of the tampered area. On the other hand, through the pre-trained detection model, the image sequence is subjected to tampering detection processing and classification processing respectively, and the processing results are fused for type detection processing), which can improve the tampering detection effect for the target image and improve the accuracy of image tampering detection.
[0114] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0115] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, 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, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0116] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0117] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0118] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0119] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, 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 codes.
[0120] The embodiments of this specification are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable fraud case serial and parallel device to produce a machine, so that the instructions executed by the processor of the computer or other programmable fraud case serial and parallel device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0121] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable fraud case serial and parallel device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0122] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0124] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0127] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may be in 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.
[0128] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0129] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0130] The above description is only an embodiment of this specification and is not intended to limit this document. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this specification.
Claims
1. An image detection method, comprising: receiving a tampering detection request for a target image; In response to the tampering detection request, segment the target image according to size information of the target image to obtain a plurality of sub-images, and construct an image sequence based on the plurality of sub-images; Performing tampering detection processing on each of the sub-images according to the image sequence through the first module of the pre-trained detection model to determine the tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through the second module of the pre-trained detection model to determine the type information corresponding to each of the sub-images; By means of the third module of the pre-trained detection model, type detection processing is performed on the target image according to the tampering score and type information corresponding to each of the sub-images to determine the risk type corresponding to the target image; A tampering detection result for the target image is determined according to the risk type corresponding to the target image.
2. The method according to claim 1, wherein the first module of the pre-trained detection model performs tampering detection processing on each of the sub-images according to the image sequence to determine the tampering score corresponding to each of the sub-images, comprising: By using the first submodule of the first module, according to the image sequence, performing visual feature extraction processing on each of the sub-images to obtain a visual feature header corresponding to each of the sub-images; By using the second submodule of the first module, frequency domain feature extraction processing is performed on each of the sub-images according to the image sequence to obtain a frequency domain feature header corresponding to each of the sub-images; Processing the visual feature head corresponding to each of the sub-images through the first processing layer of the third sub-module of the first module to obtain a first vector, and processing the frequency domain feature head corresponding to each of the sub-images through the first processing layer of the third sub-module of the first module to obtain a second vector, wherein the first processing layer is a data processing layer constructed based on a multi-head attention mechanism; Performing feature extraction processing on the first vector and the second vector through the second processing layer of the third submodule of the first module to obtain a feature vector corresponding to each of the sub-images, wherein the second processing layer is a data processing layer constructed based on a feedforward neural network algorithm; Through the fourth submodule of the first module, tampering detection processing is performed on each of the sub-images according to the feature vector corresponding to each of the sub-images to determine the tampering score corresponding to each of the sub-images.
3. According to the method of claim 2, the pre-trained detection model is constructed based on a windowed Transformer algorithm, and the first processing layer of the third submodule of the first module processes the visual feature head corresponding to each of the sub-images to obtain a first vector, comprising: Based on a preset window, each of the sub-images is divided and processed to obtain a plurality of window images; The first vector is obtained by processing the visual feature heads of the multiple window images corresponding to each of the sub-images through the first processing layer of the third sub-module of the first module.
4. The method according to claim 3, wherein the sizes of the plurality of window images corresponding to each of the sub-images are different, and the second module of the pre-trained detection model classifies each of the sub-images according to the image sequence to determine the type information corresponding to each of the sub-images, comprising: By using the first processing layer of the second module of the pre-trained detection model, feature fusion processing is performed based on the feature vectors of the plurality of window images corresponding to each of the sub-images to obtain a target feature vector corresponding to each of the sub-images, wherein the first processing layer of the second module is constructed according to a feature pyramid network algorithm; Through the second processing layer of the second module of the pre-trained detection model, the sub-images are classified according to the target feature vectors corresponding to each of the sub-images to determine the type information corresponding to each of the sub-images.
5. The method according to claim 2, wherein the third module of the pre-trained detection model performs type detection processing on the target image according to the tampering score and type information corresponding to each of the sub-images to determine the risk type corresponding to the target image, comprising: Performing score aggregation processing according to the tampering score corresponding to each of the sub-images through the first processing layer of the third module of the pre-trained detection model to determine the tampering score of the target image; Through the second processing layer of the third module of the pre-trained detection model, type detection processing is performed on the target image according to the type information corresponding to each sub-image and the tampering score of the target image to determine the risk type corresponding to the target image.
6. The method according to claim 5, wherein the tampering score corresponding to each of the sub-images comprises a first score for characterizing that the sub-image is an untampered image, and a second score for characterizing that the sub-image is a tampered image, and the first processing layer of the third module of the pre-trained detection model performs score aggregation processing according to the tampering score corresponding to each of the sub-images to determine the tampering score of the target image, comprising: The tampering score of the target image is determined according to the maximum value and / or average value of the second scores corresponding to each of the sub-images through the first processing layer of the third module of the pre-trained detection model.
7. The method according to claim 6, wherein the step of segmenting the target image according to the size information of the target image to obtain a plurality of sub-images comprises: The segmentation size corresponding to the target image is determined according to the size information of the target image, the image type to which the target image belongs, and the image resolution of the target image, and the target image is segmented according to the segmentation size to obtain the multiple sub-images.
8. The method according to claim 1, further comprising: In a case where the target image is determined to be a tampered image according to the tampering detection result of the target image, determining a tampered area in the target image by using the pre-trained detection model; Performing text recognition processing on the tampered area in the target image to obtain the target text corresponding to the tampered area; According to the target text corresponding to the tampered area, a risk detection result of the target business corresponding to the target image is determined.
9. An image detection device, comprising: A request receiving module, used for receiving a tampering detection request for a target image; A sequence construction module, configured to, in response to the tampering detection request, segment the target image according to the size information of the target image to obtain a plurality of sub-images, and construct an image sequence based on the plurality of sub-images; a first processing module, configured to perform tampering detection processing on each of the sub-images according to the image sequence through a first module of a pre-trained detection model, determine a tampering score corresponding to each of the sub-images, and perform classification processing on each of the sub-images according to the image sequence through a second module of the pre-trained detection model, determine type information corresponding to each of the sub-images; A second processing module, configured to perform type detection processing on the target image according to the tampering score and type information corresponding to each of the sub-images through the third module of the pre-trained detection model, and determine the risk type corresponding to the target image; The structure determination module is used to determine the tampering detection result for the target image according to the risk type corresponding to the target image.
10. An image detection device, comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: receiving a tampering detection request for a target image; In response to the tampering detection request, segment the target image according to size information of the target image to obtain a plurality of sub-images, and construct an image sequence based on the plurality of sub-images; Performing tampering detection processing on each of the sub-images according to the image sequence through the first module of the pre-trained detection model to determine the tampering score corresponding to each of the sub-images, and performing classification processing on each of the sub-images according to the image sequence through the second module of the pre-trained detection model to determine the type information corresponding to each of the sub-images; By means of the third module of the pre-trained detection model, type detection processing is performed on the target image according to the tampering score and type information corresponding to each of the sub-images to determine the risk type corresponding to the target image; A tampering detection result for the target image is determined according to the risk type corresponding to the target image.
Citation Information
Patent Citations
Video object removal tampering detection method based on deep learning
CN107527337A
Self-supervised document image tampering detection method and device and medium
CN116524294A
Anti-counterfeiting detection method and device, storage medium and electronic equipment
CN117496234A
Image detection method and device, electronic equipment, storage medium and program product
CN118212193A
Data processing method, device and equipment
CN118298223A