CN115661514A - Tamper detection method, device, computer program product, storage medium and equipment - Google Patents
Tamper detection method, device, computer program product, storage medium and equipment Download PDFInfo
- Publication number
- CN115661514A CN115661514A CN202211265295.6A CN202211265295A CN115661514A CN 115661514 A CN115661514 A CN 115661514A CN 202211265295 A CN202211265295 A CN 202211265295A CN 115661514 A CN115661514 A CN 115661514A
- Authority
- CN
- China
- Prior art keywords
- authentication image
- tampering
- merchant authentication
- image
- merchant
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Analysis (AREA)
Abstract
The present specification discloses a tamper detection method, apparatus, computer program product, storage medium and device, wherein the method comprises: the method comprises the steps of obtaining a merchant authentication image, extracting tampering features in the merchant authentication image based on a pre-trained tampering detection model, generating a tampering detection result corresponding to the merchant authentication image based on the tampering features, outputting authentication failure information if the tampering detection result indicates that the merchant authentication image is tampered, and accurately identifying and intercepting the tampered merchant authentication image.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a tamper detection method, a tamper detection apparatus, a computer program product, a storage medium, and a device.
Background
With the popularization and development of the internet, more and more off-line merchants select an on-line platform to register and become platform merchants so as to expand the business of the merchants through the on-line platform. In the merchant registration process, the online platform checks the authenticity of the merchant according to the merchant authentication image uploaded by the merchant to ensure the platform service quality and the platform safety.
At present, some lawbreakers without real merchants register the merchants of the false platform to engage in illegal activities by stealing the authentication images of the merchants or forging the authentication images of the merchants through the authenticity verification of the online platform.
Disclosure of Invention
The tampering detection method, the tampering detection device, the computer program product, the storage medium and the equipment provided by the embodiments of the description can accurately identify a tampered merchant authentication image, avoid lawbreakers from registering false merchants, and ensure platform safety and platform service quality. The technical scheme is as follows:
in a first aspect, an embodiment of the present specification provides a tamper detection method, where the method includes:
acquiring a merchant authentication image;
extracting a tampering feature in the merchant authentication image based on a pre-trained tampering detection model, and generating a tampering detection result corresponding to the merchant authentication image based on the tampering feature;
and if the tampering detection result indicates that the merchant authentication image is tampered, outputting authentication failure information.
In a second aspect, embodiments of the present specification provide a tamper detection device, the device comprising:
the code acquisition module is used for acquiring a merchant authentication image;
the tampering detection module is used for extracting tampering characteristics in the merchant authentication image based on a pre-trained tampering detection model and generating a tampering detection result corresponding to the merchant authentication image based on the tampering characteristics;
and the tampering prompting module is used for outputting authentication failure information if the tampering detection result indicates that the merchant authentication image is tampered.
In a third aspect, the present specification provides a computer program product, which stores at least one instruction adapted to be loaded by a processor and to perform the above method steps.
In a fourth aspect, embodiments of the present specification provide a storage medium storing a computer program adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fifth aspect, embodiments of the present specification provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The technical scheme provided by some embodiments of the present description brings beneficial effects at least including:
by adopting the tampering detection method provided by one or more embodiments of the present specification, a merchant authentication image is obtained, a tampering feature in the merchant authentication image is extracted based on a pre-trained tampering detection model, a tampering detection result corresponding to the merchant authentication image is generated based on the tampering feature, if the tampering detection result indicates that the merchant authentication image is tampered, authentication failure information is output, the tampered merchant authentication image can be accurately identified by performing tampering identification on the merchant authentication image, merchant authentication is not passed through the merchant authentication for the tampered merchant authentication image, a lawbreaker is prevented from registering a false merchant, and platform security and platform service quality are ensured.
Drawings
In order to more clearly illustrate one or more embodiments or prior art solutions of the present disclosure, reference will now be made briefly to the attached drawings, which are used in the description of the embodiments or prior art, and it should be apparent that the drawings in the description below are only some embodiments of the present disclosure, and that other drawings may be obtained by those skilled in the art without inventive effort from these drawings.
FIG. 1 provides a model architecture diagram of an event extraction model for one or more embodiments of the present description;
fig. 2 is a schematic flow diagram of a tamper detection method according to one or more embodiments of the present disclosure;
fig. 3 is a schematic flow diagram of a tamper detection method according to one or more embodiments of the present disclosure;
fig. 4 is an exemplary diagram of a second element matrix provided in one or more embodiments of the present disclosure;
FIG. 5 is an exemplary diagram of a directed acyclic graph provided in one or more embodiments of the present disclosure;
fig. 6 is an exemplary schematic diagram of an SRM filter provided in one or more embodiments of the present disclosure;
fig. 7 is a schematic structural diagram of a tamper detection device according to one or more embodiments of the present disclosure;
fig. 8 is a schematic structural diagram of a trigger recognition module according to one or more embodiments of the present disclosure;
fig. 9 is a schematic structural diagram of a tamper detection device according to one or more embodiments of the present disclosure;
fig. 10 is a block diagram illustrating a structure of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
The technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present specification, and it is to be understood that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
In the description herein, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present specification, it is to be noted that, unless explicitly stated or limited otherwise, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. The specific meanings of the above terms in the present specification can be understood in specific cases by those of ordinary skill in the art. Further, in the description of the present specification, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In the related art, when verifying the authenticity of a merchant, a merchant authentication image uploaded by the merchant is searched for a repeated or similar merchant image in a merchant image database by an image search technology, but the method needs the merchant image database to have a large number of sufficient merchant image sources, otherwise, the images cannot be compared.
Based on this, one or more embodiments of the present disclosure provide a tampering detection method, where a merchant authentication image is obtained, a tampering feature in the merchant authentication image is extracted based on a pre-trained tampering detection model, and a tampering detection result corresponding to the merchant authentication image is generated based on the tampering feature, the pre-trained tampering detection model can perform accurate tampering detection on the merchant authentication image, if the tampering detection result indicates that the merchant authentication image is tampered, authentication failure information is output, the tampered merchant authentication image is subjected to tampering identification, the tampered merchant authentication image can be accurately identified and intercepted, the tampered merchant authentication image does not pass merchant authentication, registration of false merchants by lawbreakers is avoided, and platform security and platform service quality are ensured.
The following is a detailed description with reference to specific examples. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims. The flow diagrams depicted in the figures are merely exemplary and need not be performed in the order of the steps shown. For example, some steps are parallel, and there is no strict sequence relationship in logic, so the actual execution sequence is variable.
Please refer to fig. 1, which is a schematic flowchart of a tamper detection method according to one or more embodiments of the present disclosure. In a specific embodiment, the tamper detection method is applied to a tamper detection device or an electronic device equipped with a tamper detection device. As will be described in detail with respect to the flow shown in fig. 1, the tamper detection method may specifically include the following steps:
s102, acquiring a merchant authentication image;
specifically, when the merchant performs platform merchant registration, the merchant uploads a merchant authentication image used for merchant authentication to the tampering detection device, and the tampering detection device acquires the merchant authentication image uploaded by the merchant.
The merchant authentication image can be a merchant door face image or a merchant voucher image with legal benefits.
The tamper detection device may be a section of program code of a section of program code running on a merchant platform.
S104, extracting tampering characteristics in the merchant authentication image based on the pre-trained tampering detection model, and generating a tampering detection result corresponding to the merchant authentication image based on the tampering characteristics;
specifically, after the merchant authentication image is obtained, the obtained merchant authentication image is input into a pre-trained tampering detection model, tampering features in the merchant authentication image are extracted by the pre-trained tampering detection model, and a tampering detection result corresponding to the merchant authentication image is generated according to the tampering features in the merchant authentication image.
In one or more embodiments of the present description, the tamper characteristic includes an RGB image characteristic corresponding to the merchant authentication image and a noise characteristic corresponding to the merchant authentication image.
In one or more embodiments of the present specification, the RGB image features in the merchant authentication image are extracted based on a first image classification network in the tampering detection model, the noise features corresponding to the merchant authentication image are extracted based on a second image classification network in the tampering detection model, and network parameters of the first image classification network and the second image classification network are not shared independently.
In one or more embodiments of the present specification, before extracting the noise feature corresponding to the merchant authentication image based on the second image classification network in the tamper detection model, the method further includes: and performing SRM noise extraction processing on the merchant authentication image based on an SRM filter to obtain a noise characteristic diagram, and extracting noise characteristics in the noise characteristic diagram based on a second image classification network.
In one or more embodiments of the present specification, generating a tampering detection result corresponding to the merchant authentication image based on the tampering feature includes: and performing feature fusion processing on the RGB image features and the noise features to obtain fusion features, and performing tampering prediction on the merchant authentication image based on the fusion features to obtain a tampering detection result of the merchant authentication image.
It can be understood that the tamper detection model is generated after training based on the sample merchant authentication image, and the trained tamper detection model can extract the tamper features in the merchant authentication image and generate the tamper detection result corresponding to the merchant authentication image according to the tamper features. The tampering detection result may be a tampering region formed by tampered pixels in the merchant authentication image.
S106, if the tampering detection result indicates that the merchant authentication image is tampered, authentication failure information is output.
Specifically, after a tampering detection result corresponding to the merchant authentication image is obtained based on the tampering detection model, if the tampering detection result indicates that the merchant authentication image is tampered, the merchant authentication of the merchant authentication image is not passed by the tampering detection device, and prompt information that the merchant authentication image is a pirated merchant authentication image and the merchant authentication fails is output.
In one or more embodiments of the present disclosure, a merchant authentication image is obtained, a tampering feature in the merchant authentication image is extracted based on a pre-trained tampering detection model, a tampering detection result corresponding to the merchant authentication image is generated based on the tampering feature, the pre-trained tampering detection model can perform accurate tampering detection on the merchant authentication image, if the tampering detection result indicates that the merchant authentication image is tampered, authentication failure information is output, the tampered merchant authentication image is subjected to tampering identification, the tampered merchant authentication image can be accurately identified and intercepted, the tampered merchant authentication image does not pass merchant authentication, a lawbreaker is prevented from registering a false merchant, and platform security and platform service quality are ensured.
Referring to fig. 2, a schematic flow chart of a tamper detection method provided for one or more embodiments of the present disclosure may include the following steps:
s202, obtaining tampering information corresponding to the sample merchant authentication image set and each sample merchant authentication image in the sample merchant authentication image set;
the sample merchant authentication image set comprises a plurality of sample merchant authentication images, and the plurality of sample merchant authentication images comprise tampered sample graphic codes and sample merchant authentication images which are not tampered.
The tampered information of the tampered sample graphic code is known, and the tampered information comprises the tampered area tampered in the sample graphic code.
The sample merchant authentication image set may be obtained by: and modifying the merchant authentication image in modes of altering, pasting and the like to obtain a sample merchant authentication image, recording the tampering information of the sample merchant authentication image, and then increasing the number of the sample merchant authentication images in a sample enhancement mode.
S204, performing iterative training on the initial tampering detection model based on the tampering information respectively corresponding to each sample merchant authentication image and each sample merchant authentication image in the sample merchant authentication image set;
specifically, a sample merchant authentication image is input into an initial tampering detection model, the initial tampering detection model outputs a sample tampering detection result of the sample merchant authentication image, the sample tampering detection result is compared with tampering information of the sample merchant authentication image in a difference mode, and model parameters of the initial tampering detection model are adjusted according to the difference information between the sample tampering detection result and the tampering information. And iteratively training the initial tampering detection model based on each sample merchant authentication image in the sample merchant authentication image set until the initial tampering detection model meets a preset model evaluation index, and finishing training to obtain a trained tampering detection model.
S206, finishing training when the initial tampering detection model meets the preset conditions to obtain a trained tampering detection model;
wherein the preset condition is a preset model evaluation index.
Optionally, the model evaluation index may include accuracy and recall. And when the initial tampering detection model carries out tampering detection on the merchant authentication image, wherein the accuracy rate meets a preset accuracy rate threshold value, and the recall rate meets a preset recall rate threshold value, stopping training to obtain a trained tampering detection model.
S208, acquiring a merchant authentication image;
specifically, please refer to detailed description in S102 of another embodiment of the present disclosure for step S208, which is not repeated herein.
S210, performing feature extraction processing on the merchant authentication image to obtain RGB image features and noise features corresponding to the merchant authentication image;
specifically, the RGB image features in the merchant authentication image are extracted based on a first image classification network in the tamper detection model, and the noise features in the merchant authentication image are extracted based on a second image classification network in the tamper detection model.
The RGB image features are used for representing image visual information, and the noise features are used for representing digital image steganalysis tampering information.
In one or more embodiments of the present disclosure, the first image classification network may be a convolution-based ResNet, VGG, inclusion, densneet, or the like network, the second image classification network may be a convolution-based ResNet, VGG, inclusion, densneet, or the like network, and the first image classification network and the second image classification network are two independent classification networks and do not share network parameters.
In one or more embodiments of the present specification, when performing feature extraction processing on a merchant authentication image, RGB image features and noise features of the merchant authentication image are not only provided, but also image texture features corresponding to the merchant authentication image, frequency domain features corresponding to the merchant authentication image, steganography features corresponding to the merchant authentication image, and the like may be included.
For example, frequency domain features in the merchant authentication image are extracted based on a DCT transform.
S212, performing feature fusion on the RGB image features and the noise features to obtain fusion features; .
Specifically, RGB image features and noise features extracted from a merchant authentication image are integrated based on a channel dimension combination mode, and then further feature fusion is carried out through a three-layer convolution network to obtain fusion features.
The RGB image features and the noise features are tampering features corresponding to the merchant authentication image extracted from different dimensions, and the RGB image features and the noise features are subjected to feature fusion to obtain fusion features, so that the fusion features can represent tampering feature information of the merchant authentication image more comprehensively.
S214, based on the fusion characteristics, tampering prediction is respectively carried out on each pixel in the merchant authentication image in a sliding window mode, and tampering prediction values corresponding to each pixel in the merchant authentication image are obtained;
specifically, the fusion feature includes feature information of all pixels in the merchant authentication image, and whether each pixel is tampered is predicted based on the feature information corresponding to each pixel in the fusion feature, so that a tampering prediction value corresponding to each pixel is obtained.
S216, normalizing the tampering prediction values corresponding to the pixels to obtain tampering probability values corresponding to the pixels;
specifically, after the tampering prediction values corresponding to the pixels are obtained through prediction, normalization processing is performed on the tampering prediction values corresponding to the pixels based on the normalization index function, so that a tampering probability value of 0-1 corresponding to each pixel is obtained.
It is understood that the tampering probability value is used to indicate the probability of whether a pixel is tampered with.
S218, determining a tampering area of the merchant authentication image based on a preset probability threshold value and a tampering probability value corresponding to each pixel;
the preset probability threshold is a preset probability threshold used for judging whether the pixel is tampered. When the tampering probability value corresponding to the pixel is smaller than a preset probability threshold value, the pixel is determined to be an untampered pixel, and when the tampering probability value corresponding to the pixel is larger than the preset probability threshold value, the pixel is determined to be a tampered pixel.
Specifically, pixels with tampering probability values larger than a preset probability threshold in the merchant authentication image are used as tampered pixels, and a tampering area is determined in the merchant authentication image according to position information of each tampered pixel.
In one embodiment, after the tampering region is determined in the merchant authentication image, the merchant authentication image marked with the tampering region is output and stored, and user account information using the merchant authentication image is recorded to prove evidence of criminal user illegal criminal behaviors.
It is understood that by storing the merchant authentication image labeled with the tampered region, the merchant authentication image can be more persuasive when used as evidence.
Please refer to fig. 3, which is a flowchart illustrating a tamper detection method according to an embodiment of the present disclosure. As shown in fig. 3, the RGB image features of the merchant authentication image are extracted through the first image classification network, after the falsification feature of the merchant authentication image is enhanced through the SRM filter, the noise features in the merchant authentication image are extracted through the second image classification network, the first image classification network and the second image classification network are independent of each other, the extraction accuracy of the first image classification network and the second image classification network for the corresponding features is effectively ensured through the double-flow network design, then the RGB image features and the noise features are subjected to feature fusion, and falsification prediction is performed according to the fused fusion features, so as to obtain a falsification detection result.
S220, if the tampering detection result indicates that the merchant authentication image is tampered, authentication failure information is output.
Specifically, according to the result of step S218, if it is determined that the merchant authentication image has a tampered region, it is determined that the merchant authentication image is tampered, the merchant authentication of the merchant authentication image is not passed by the tamper detection device, and prompt information indicating that the merchant authentication image is a pirated merchant authentication image and that the merchant authentication fails is output.
Please refer to fig. 4, which is a schematic diagram illustrating an example of tamper warning information according to an embodiment of the present disclosure. As shown in fig. 4, the tamper detection device is exemplified by a smartphone. After inputting the merchant authentication image into the tampering detection device, if the merchant authentication image is a tampered merchant authentication image and the tampering detection device detects that the merchant authentication image is a tampered merchant authentication image, outputting authentication failure information as shown in the figure: the merchant authentication image is invalid and the merchant authentication fails.
In one or more embodiments of the present description, a merchant authentication image is obtained, RGB image features and noise features in the merchant authentication image are extracted based on a pre-trained tamper detection model, the RGB image features and the noise features are extracted and generated based on two image classification networks with unshared parameters, so that accuracy of extracting tamper features by each image classification network is ensured, then the RGB image features and the noise features are subjected to feature fusion to obtain fusion features, the fusion features include the RGB image features and the noise features, tamper feature information in the merchant authentication image can be represented more comprehensively, a tamper detection result corresponding to the merchant authentication image is generated based on the fusion, if the tamper detection result indicates that the merchant authentication image is tampered, authentication failure information is output, merchant authentication is not passed through for the tampered merchant authentication, registration of lawless persons with false merchants is avoided, and platform security and platform service quality are ensured.
Referring to fig. 5, a schematic flow chart of a tamper detection method provided in one or more embodiments of the present disclosure may include the following steps:
s302, acquiring a merchant authentication image;
specifically, please refer to detailed description in S102 of another embodiment of the present disclosure for step S302, which is not repeated herein.
S304, extracting RGB image features in the merchant authentication image based on the first image classification network;
the RGB image features are used to characterize tampering traces of the merchant authentication image that have been tampered with from the perspective of image visual information. And presetting an RGB channel for extracting the RGB characteristics of the merchant authentication image in a first image classification network in the tampering detection model. The RGB channels comprise R channels formed by red pixel point values, G channels formed by green pixel point values and B channels formed by blue pixel point values, convolution kernels of all the channels are preset manually, and convolution kernels of different channels are different.
Specifically, RGB image features in the merchant authentication image are extracted based on a first image classification network in a pre-trained tamper detection network.
S306, extracting noise features in the merchant authentication image based on the second image classification network;
specifically, noise features in the merchant authentication image are extracted based on a second image classification network in the pre-trained tamper detection network.
It can be understood that, if the merchant authentication image is tampered, the pixels of the tampered region are necessarily different from the original pixels, and by extracting the noise features in the merchant authentication image, the noise features of the tampered region are obviously stronger than those of the untampered region.
In one or more embodiments of the present specification, before extracting the noise feature in the merchant authentication image based on the second image classification network, the SRM noise extraction processing is performed on the tampering feature in the merchant authentication image based on the SRM filter to obtain an enhanced noise feature map, and then the noise feature in the noise feature map is extracted based on the second image classification network. And performing three-channel noise extraction on the merchant authentication image through an SRM filter to obtain a noise characteristic diagram after the SRM noise extraction, and extracting noise characteristics from the noise characteristic diagram through a second image classification network, so that the extracted noise characteristics are more obvious, and tampering marks in the merchant authentication image can be more clearly and specifically embodied.
More specifically, the SRM filters include three types, which respectively act on the RGB three channels of the merchant authentication image, and the three channels of noise extraction is performed on the merchant authentication image through the SRM filters to obtain a noise characteristic diagram containing R, G, B three channels of noise data.
Fig. 6 is a schematic diagram of an example of an SRM filter according to an embodiment of the present disclosure. The SRM filter can refer to three filters as shown in fig. six, and extract noise data for R, G, B three channels respectively.
S308, performing feature fusion on the RGB image features and the noise features to obtain fusion features;
specifically, please refer to detailed description in step S308 of another embodiment S212 of the present disclosure, which is not repeated herein.
S310, based on the fusion characteristics, tampering prediction is respectively carried out on each pixel in the merchant authentication image in a sliding window mode, and tampering prediction values corresponding to each pixel in the merchant authentication image are obtained;
specifically, please refer to detailed description in another embodiment S214 of the present disclosure for step S310, which is not repeated herein.
S312, normalizing the tampering prediction values corresponding to the pixels to obtain tampering probability values corresponding to the pixels;
specifically, please refer to detailed description in step S312 in another embodiment S216 of the present disclosure, which is not repeated herein.
S314, determining a tampering region of the merchant authentication image based on a preset probability threshold value and a tampering probability value corresponding to each pixel;
specifically, please refer to the detailed description in S218 of another embodiment of the present disclosure for step S314, which is not repeated herein.
S316, if the tampering detection result indicates that the merchant authentication image is tampered, authentication failure information is output.
Specifically, please refer to detailed description in step S316 in another embodiment S220 of the present disclosure, which is not repeated herein.
In the embodiment of the specification, a merchant authentication image is obtained, RGB image features and noise features in the merchant authentication image are extracted based on a pre-trained tamper detection model, the RGB image features and the noise features are respectively extracted and generated based on two image classification networks with parameters not shared, the accuracy of extracting the tamper features by each image classification network is ensured, then the RGB image features and the noise features are subjected to feature fusion to obtain fusion features, the fusion features comprise the RGB image features and the noise features, tamper feature information in the merchant authentication image can be represented more comprehensively, finally, a tamper detection result corresponding to the merchant authentication image is generated based on the fusion, if the tamper detection result indicates that the merchant authentication image is tampered, authentication failure information is output, merchant authentication is not passed for the tampered merchant authentication, fraudulent merchant registration is avoided, and platform security and platform service quality are ensured.
Fig. 7 is a schematic structural diagram of a tamper detection device according to one or more embodiments of the present disclosure. As shown in fig. 7, the tamper detection device 1 may be implemented as all or a part of a terminal by software, hardware, or a combination of both. According to some embodiments, the tamper detection device 1 includes an encoding obtaining module 11, a tamper detection module 12, and a tamper prompting module 13, and specifically includes:
the code acquisition module 11 is used for acquiring a merchant authentication image;
the tampering detection module 12 is configured to extract a tampering feature in the merchant authentication image based on a pre-trained tampering detection model, and generate a tampering detection result corresponding to the merchant authentication image based on the tampering feature;
and the tampering prompt module 13 is configured to output authentication failure information if the tampering detection result indicates that the merchant authentication image is tampered.
Optionally, please refer to fig. 8, which is a schematic structural diagram of a tamper detection module provided in an embodiment of the present specification. As shown in fig. 8, the tamper detection module includes:
a feature extraction unit 121, configured to perform feature extraction processing on the merchant authentication image to obtain RGB image features and noise features corresponding to the merchant authentication image;
a feature fusion unit 122, configured to perform feature fusion on the RGB image features and the noise features to obtain fusion features;
and the tampering detection unit 123 is configured to perform tampering prediction on the merchant authentication image based on the fusion feature, so as to obtain a tampering detection result of the merchant authentication image.
Optionally, the feature extraction unit 121 is specifically configured to:
extracting RGB image features in the merchant authentication image based on a first image classification network;
extracting noise features in the merchant authentication image based on a second image classification network;
wherein the first image classification network and the second image classification network do not share network parameters.
Optionally, when the extracting of the noise feature in the merchant authentication image based on the second image classification network is performed, the feature extracting unit 121 is specifically configured to:
based on an SRM filter, carrying out SRM noise extraction processing on the merchant authentication image to obtain a noise characteristic diagram;
and extracting noise features in the noise feature map based on a second image classification network.
Optionally, the tampering detection unit 123 is specifically configured to:
based on the fusion characteristics, performing tampering prediction on each pixel in the merchant authentication image in a sliding window mode to obtain a tampering prediction value corresponding to each pixel in the merchant authentication image;
normalizing the tampering prediction values respectively corresponding to the pixels to obtain tampering probability values respectively corresponding to the pixels;
and determining a tampering region of the merchant authentication image based on a preset probability threshold value and the tampering probability values respectively corresponding to the pixels.
Optionally, when the tampering detection unit 123 determines the tampering area of the merchant authentication image based on a preset probability threshold and the tampering probability values respectively corresponding to the pixels, specifically, the tampering detection unit is configured to:
determining pixels with tampering probability values larger than a preset probability threshold value in all the pixels as tampered pixels;
determining the tampered region in the merchant authentication image based on each of the tampered pixels.
Optionally, please refer to fig. 9, which is a schematic structural diagram of a tamper detection device provided in an embodiment of the present specification. As shown in fig. 9, the tamper detection device further includes a model training module 14, where the model training module is specifically configured to:
obtaining tampering information corresponding to each sample merchant authentication image in the sample merchant authentication image set and the sample merchant authentication image set respectively;
performing iterative training on an initial tampering detection model based on each sample merchant authentication image in the sample merchant authentication image set and tampering information corresponding to each sample merchant authentication image;
and finishing the training when the initial tampering detection model meets the preset conditions to obtain the trained tampering detection model.
By adopting the tampering detection device provided by one or more embodiments of the present specification, a merchant authentication image is obtained, RGB image features and noise features in the merchant authentication image are extracted based on a pre-trained tampering detection model, the RGB image features and the noise features are extracted and generated based on two image classification networks with unshared parameters, so that the accuracy of extracting the tampering features by each image classification network is ensured, then the RGB image features and the noise features are subjected to feature fusion to obtain a fusion feature, the fusion feature includes RGB image features and noise features, tampering feature information in the merchant authentication image can be represented more comprehensively, finally, a tampering detection result corresponding to the merchant authentication image is generated based on the fusion, if the tampering detection result indicates that the merchant authentication image is tampered, authentication failure information is output, merchant authentication is not passed for the tampered merchant authentication, registration of lawless persons with false merchants is avoided, and platform security and platform service quality are ensured.
One or more embodiments of the present specification further provide a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the tamper detection method according to the embodiments shown in fig. 1 to 6, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 1 to 6, which is not described herein again.
In a computer program product provided in this specification, at least one instruction is stored, and the at least one instruction is loaded by the processor and executes the tamper detection method according to the embodiment shown in fig. 1 to 6, where a specific execution process may refer to a specific description of the embodiment shown in fig. 1 to 6, and is not described herein again.
Referring to fig. 10, a block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown. The electronic device in this specification may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected by a bus 150.
The Memory 120 may include a Random Access Memory (RAM) or a read-only Memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions.
The input device 130 is used for receiving input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one or more embodiments of the present disclosure, the input device 130 may be a temperature sensor for acquiring an operating temperature of the terminal. The output device 140 may be a speaker for outputting audio signals.
In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In one or more embodiments of the present specification, the main body of execution of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this specification by one or more embodiments.
In the electronic device of fig. 10, the processor 110 may be configured to call a tamper detection program stored in the memory 120 and execute to implement a tamper detection method as described in various method embodiments herein.
In one or more embodiments of the present description, a merchant authentication image is obtained, RGB image features and noise features in the merchant authentication image are extracted based on a pre-trained tamper detection model, the RGB image features and the noise features are extracted and generated based on two image classification networks with unshared parameters, so that accuracy of extracting tamper features by each image classification network is ensured, then the RGB image features and the noise features are subjected to feature fusion to obtain fusion features, the fusion features include the RGB image features and the noise features, tamper feature information in the merchant authentication image can be represented more comprehensively, a tamper detection result corresponding to the merchant authentication image is generated based on the fusion, if the tamper detection result indicates that the merchant authentication image is tampered, authentication failure information is output, merchant authentication is not passed through for the tampered merchant authentication, registration of lawless persons with false merchants is avoided, and platform security and platform service quality are ensured.
It is clear to a person skilled in the art that the solution according to the present description can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, where the hardware may be, for example, a Field-Programmable Gate Array (FPGA), an Integrated Circuit (IC), or the like.
It should be noted that for simplicity of description, the above-mentioned method embodiments are described as a series of acts, but those skilled in the art should understand that the present specification is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present specification. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred and that the acts and modules involved are not necessarily required for this description.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present specification, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some service interfaces, devices or units, and may be an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present description may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, and the memory may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above description is only an exemplary embodiment of the present specification, and the scope of the present specification is not limited thereto. That is, equivalent variations and modifications made in accordance with the teachings of the present specification are within the scope of the present specification. Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
Claims (11)
1. A tamper detection method, the method comprising:
acquiring a merchant authentication image;
extracting a tampering feature in the merchant authentication image based on a pre-trained tampering detection model, and generating a tampering detection result corresponding to the merchant authentication image based on the tampering feature;
and if the tampering detection result indicates that the merchant authentication image is tampered, outputting authentication failure information.
2. The method according to claim 1, wherein the inputting the merchant authentication image into a pre-trained tamper detection model to obtain a tamper detection result corresponding to the merchant authentication image comprises
Performing feature extraction processing on the merchant authentication image to obtain RGB image features and noise features corresponding to the merchant authentication image;
performing feature fusion on the RGB image features and the noise features to obtain fusion features;
and performing tampering prediction on the merchant authentication image based on the fusion characteristics to obtain a tampering detection result of the merchant authentication image.
3. The method according to claim 2, wherein the performing the feature extraction processing on the merchant authentication image to obtain RGB image features and noise features corresponding to the merchant authentication image includes:
extracting RGB image features in the merchant authentication image based on a first image classification network;
extracting noise features in the merchant authentication image based on a second image classification network;
wherein the first image classification network and the second image classification network do not share network parameters.
4. The method of claim 3, the extracting noise features in the merchant-authentication image based on a second image-classification network, comprising:
based on an SRM filter, carrying out SRM noise extraction processing on the merchant authentication image to obtain a noise characteristic diagram;
and extracting noise features in the noise feature map based on a second image classification network.
5. The method according to claim 2, wherein the tamper predicting the merchant authentication image based on the fusion feature to obtain a tamper detection result of the merchant authentication image includes:
based on the fusion characteristics, performing tampering prediction on each pixel in the merchant authentication image in a sliding window mode to obtain a tampering prediction value corresponding to each pixel in the merchant authentication image;
normalizing the tampering prediction values corresponding to the pixels to obtain tampering probability values corresponding to the pixels;
and determining a tampering region of the merchant authentication image based on a preset probability threshold value and the tampering probability values respectively corresponding to the pixels.
6. The method according to claim 5, wherein the determining the tampering region of the merchant authentication image based on a preset probability threshold and the tampering probability values respectively corresponding to the pixels comprises:
determining pixels with tampering probability values larger than a preset probability threshold value in all the pixels as tampered pixels;
determining the tampered region in the merchant authentication image based on each of the tampered pixels.
7. The method of claim 1, prior to obtaining the merchant authentication image, further comprising:
obtaining tampering information corresponding to each sample merchant authentication image in the sample merchant authentication image set and the sample merchant authentication image set respectively;
performing iterative training on an initial tampering detection model based on each sample merchant authentication image in the sample merchant authentication image set and tampering information corresponding to each sample merchant authentication image;
and finishing the training when the initial tampering detection model meets the preset conditions to obtain the trained tampering detection model.
8. A tamper detection device comprising:
the code acquisition module is used for acquiring a merchant authentication image;
the tampering detection module is used for extracting tampering characteristics in the merchant authentication image based on a pre-trained tampering detection model and generating a tampering detection result corresponding to the merchant authentication image based on the tampering characteristics;
and the tampering prompting module is used for outputting authentication failure information if the tampering detection result indicates that the merchant authentication image is tampered.
9. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, performing the steps of the method according to any one of claims 1 to 7.
10. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the method according to any of claims 1-7.
11. A computer program product having at least one instruction stored thereon, wherein the at least one instruction, when executed by a processor, implements the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211265295.6A CN115661514A (en) | 2022-10-14 | 2022-10-14 | Tamper detection method, device, computer program product, storage medium and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211265295.6A CN115661514A (en) | 2022-10-14 | 2022-10-14 | Tamper detection method, device, computer program product, storage medium and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115661514A true CN115661514A (en) | 2023-01-31 |
Family
ID=84988203
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211265295.6A Pending CN115661514A (en) | 2022-10-14 | 2022-10-14 | Tamper detection method, device, computer program product, storage medium and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115661514A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117557562A (en) * | 2024-01-11 | 2024-02-13 | 齐鲁工业大学(山东省科学院) | Image tampering detection method and system based on double-flow network |
-
2022
- 2022-10-14 CN CN202211265295.6A patent/CN115661514A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117557562A (en) * | 2024-01-11 | 2024-02-13 | 齐鲁工业大学(山东省科学院) | Image tampering detection method and system based on double-flow network |
CN117557562B (en) * | 2024-01-11 | 2024-03-22 | 齐鲁工业大学(山东省科学院) | Image tampering detection method and system based on double-flow network |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110766033B (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN109214821B (en) | Identity remote authentication method and terminal equipment | |
CN112381775A (en) | Image tampering detection method, terminal device and storage medium | |
CN111415336B (en) | Image tampering identification method, device, server and storage medium | |
WO2019243594A1 (en) | Within document face verification | |
CN111950673B (en) | Commodity anti-counterfeiting verification method, device and equipment based on two-dimensional code and storage medium | |
CN113642639B (en) | Living body detection method, living body detection device, living body detection equipment and storage medium | |
CN115661514A (en) | Tamper detection method, device, computer program product, storage medium and equipment | |
CN108132864B (en) | Terminal verification method, terminal device and computer readable medium | |
CN112788269A (en) | Video processing method, device, server and storage medium | |
CN116823428A (en) | Anti-fraud detection method, device, equipment and storage medium | |
CN114297735A (en) | Data processing method and related device | |
CN111429269A (en) | Big data-based pre-approval method and device, electronic equipment and storage medium | |
WO2023045535A1 (en) | Method and apparatus for identifying picture | |
CN117197857A (en) | Face counterfeiting attack detection and face recognition method, device and equipment | |
CN114358943A (en) | Online bill processing method and device, electronic equipment and storage medium | |
CN112634382B (en) | Method and device for identifying and replacing images of unnatural objects | |
CN113269123B (en) | Certificate identification method and system | |
CN115937570A (en) | Tamper detection method, device, computer program product, storage medium and equipment | |
US20220327849A1 (en) | Computer-Implemented Method For Optical Character Recognition | |
CN112257498A (en) | Construction and detection method and device of vehicle inspection code detection model | |
US11250254B2 (en) | Methods and systems for detecting photograph replacement in a photo identity document | |
CN112699707A (en) | Video detection method, device and storage medium | |
CN113709563B (en) | Video cover selecting method and device, storage medium and electronic equipment | |
CN111798250A (en) | Method and system for determining the authenticity of official documents |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |