Training method of image tampering identification model, image tampering identification method and equipment
By introducing a second discriminator and corresponding training methods into the image tamper recognition model, the feature extractor is updated to reduce the first discriminant difference and increase the second discriminant difference, the problem of overfitting the image tamper recognition model in the prior art is solved, and the recognition ability of real tampered images is improved.
Patent Information
- Application Number
- CN202510122494.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-02
AI Technical Summary
When the prior art trains the image tamper recognition model by generating tampered images, it is easy to lead to overfitting, resulting in poor results in real tampered images recognition.
An image tamper recognition model including a feature extractor, a first discriminator and a second discriminator is adopted. By obtaining the image frame, a first tag and a second tag in the training sample, the feature extractor, a first discriminator and a second discriminator are input respectively, and the feature extractor is updated according to the discriminator results and tags to reduce the first discriminator difference and increase the second discriminator difference.
The recognition ability of the image tamper recognition model is improved, the overfitting of generated tampered images is reduced, and the detection ability of real tampered images is improved.
Smart Images

Figure CN119919736A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification belong to the field of machine learning technology, and more particularly to a training method for an image tampering recognition model, an image tampering recognition method, and a device. Background Art
[0002] With the development of image recognition technology, identity authentication based on ID photos has been applied in many fields, for example, through image recognition technology. However, some attackers often use attack methods to make the image collected by the image recognition system not a completely authentic ID photo, but an ID image in which the information has been tampered with. For example, by covering the name, ID number, face and other key fields on the ID with a piece of paper that records tampered information, the ID image collected by the image recognition system is a tampered ID image. In turn, the image recognition system is caused to fail or fail, thereby obtaining illegal profits and causing losses to legitimate users. Summary of the invention
[0003] The purpose of the present invention is to provide a training method, an image tampering recognition method and a device for an image tampering recognition model, which can improve the recognition ability of the trained tampered image recognition model by training the image tampering recognition model through a large number of tampered images, thereby solving the shortcomings of the prior art.
[0004] To achieve the above-mentioned purpose, the first aspect of the present specification provides a training method for an image tampering recognition model, the target tampering detection model includes a feature extractor, a first discriminator and a second discriminator, and the method includes: obtaining a training sample, the training sample includes an image frame, a first label and a second label, the first label indicates whether the image frame has been tampered with, and when the first label indicates tampering, the second label is used to indicate that the image frame is a real tampered image or a generated tampered image: inputting the image frame into the feature extractor to obtain image features corresponding to the image frame, inputting the image features into the first discriminator to obtain a first discrimination result, and determining a first discrimination difference based on the first discrimination result and the first label; inputting the image features into the second discriminator to obtain a second discrimination result, and determining a second discrimination difference based on the second discrimination result and the second label; updating the feature extractor with the purpose of making the first discrimination difference tend to become smaller and the second discrimination difference tend to become larger.
[0005] The second aspect of the present specification provides an image tampering identification method, including: obtaining an image frame to be tested; inputting the image frame to be tested into a feature extractor in an image tampering identification model trained by the method described in the first aspect to obtain image features, and inputting the image features into a first discriminator in the image tampering identification model trained by the method described in the first aspect to obtain an identification result of whether the image frame to be tested has been tampered with.
[0006] A third aspect of the specification provides a computing device, including: a processor; and a memory, wherein a program is stored, and when the processor executes the executable code, the method described in the first aspect and the second aspect is implemented.
[0007] In a training scheme for an image tampering recognition model provided in an embodiment of the present specification, a training sample including an image frame, a first label and a second label can be obtained, the first label indicates whether the image frame has been tampered with, and when the first label indicates tampering, the second label is used to indicate that the image frame is a real tampered image or a generated tampered image. Then, the image frame is input into a feature extractor to obtain image features corresponding to the image frame, and the image features are respectively input into a first discriminator and a second discriminator to obtain a first discrimination result and a second discrimination result, respectively. According to the first discrimination result and the first label, a first discrimination difference is determined, and according to the second discrimination result and the second label, a second discrimination difference is determined; the feature extractor is updated with the purpose of the first discrimination difference tending to become smaller and the second discrimination difference tending to become larger. Through this method, the recognition ability of the trained tampered image recognition model can be improved when the image tampering recognition model is trained by generating a large number of tampered images. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0009] Figure 1 is a schematic diagram of an image tampering identification scheme;
[0010] Figure 2 is a schematic diagram of a training method for an image tampering recognition model in an embodiment of this specification;
[0011] Figure 3 is a flow chart of a training method for an image tampering recognition model in an embodiment of this specification;
[0012] Figure 4 is a schematic diagram of various image frames in an embodiment of this specification;
[0013] Figure 5 is a schematic diagram of updating the first discriminator and the second discriminator in one embodiment of this specification;
[0014] Figure 6 is a schematic diagram of determining a third recognition loss and using it to update an image tampering recognition model in an embodiment of this specification;
[0015] Figure 7 This is a flow chart of an image tampering identification method in one embodiment of this specification. DETAILED DESCRIPTION
[0016] 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.
[0017] As mentioned above, with the development of image recognition technology, identity authentication through image recognition technology, such as based on ID photos, has been applied in many fields. However, some attackers often use attack methods to make the image collected by the image recognition system not a completely authentic ID photo, but an ID image in which the information has been tampered with. For example, by covering the name, ID number, face and other key fields on the ID with a piece of paper that records tampered information, the ID image collected by the image recognition system is a tampered ID image. In turn, the image recognition system is caused to fail or fail, thereby obtaining illegal profits and causing losses to legitimate users.
[0018] At present, in order to prevent attackers from tampering with images and causing image recognition systems to malfunction or fail, neural network-based image tampering recognition models are often trained to identify images tampered by attackers. Figure 1 is a schematic diagram of an image tampering identification scheme. Figure 1 As shown, by including samples of real images and tampered images, a classification model that distinguishes whether an image is tampered is trained as an image tampering recognition model. Then, through the trained image tampering recognition model, it is determined whether the image to be detected is a tampered image. However, the problem with this solution is that, due to the actual production occasion, the difficulty and cost of obtaining the tampered image actually formed by the attacker's behavior (for the convenience of description, referred to as the real tampered image) are both large, and the model trainer often generates a large number of tampered images (for the convenience of description, referred to as the generated tampered image or the generated tampered image) based on a deep learning method, and then trains the image tampering recognition model through the generated tampered image. Then, since the proportion of the generated tampered images in the training samples is often high relative to the number of real tampered images, it often leads to the problem of overfitting of the training. That is, due to the difference in data distribution between the real tampered images and the generated tampered images, the trained image tampering recognition model has a better recognition effect on the generated tampered images than on the real tampered images. As a result, the recognition effect of the image tampering recognition model is not good in the actual use stage after training.
[0019] In order to solve the above technical problems, the embodiments of this specification propose a training method for an image tampering recognition model. Figure 2 FIG. 1 is a schematic diagram of a training method for an image tampering recognition model in an embodiment of the present specification. Figure 2 As shown, the image tampering recognition model includes at least a feature extractor, a first discriminator and a second discriminator. The image frame in the training sample can be input into the feature extractor to obtain image features, and then the image features are input into the first discriminator and the second discriminator to obtain a first recognition result (for predicting that the image frame is a real image or a tampered image) and a second recognition result (for predicting that the image frame is a real tampered image or generating a tampered image). According to the first recognition result and the preset first label, the first recognition loss is determined, and the first label indicates whether the image frame is tampered. According to the second recognition result and the preset second label, the second recognition loss is determined, and the second label indicates that the image frame is a tampered image or a tampered image is generated. Furthermore, the network parameters of the feature extractor can be updated for the purpose of the first recognition loss tending to decrease and the second recognition loss tending to increase. According to one embodiment, the image frame may include a variety of image frames, such as normal frames and flash frames, so that the fusion features of the various image frames can be extracted by the feature extractor. Furthermore, the first recognition loss and the second recognition loss are determined according to the fusion features.
[0020] The advantages of this method are: on the one hand, conventional image tampering recognition models usually use classifiers (similar to the first discriminator) to determine whether an image has been tampered with. Therefore, in the process of training such image tampering recognition models, the feature extractor and classifier in the image tampering recognition model are usually updated by calculating the classification loss. However, as mentioned above, in actual production scenarios, the number of real tampered image samples in the training samples is often much smaller than the number of generated tampered image samples. Since the data distribution of real tampered images and generated tampered images is often different (or in different domains), the image tampering recognition model after training often has a better recognition effect on the generated tampered images, but a poor recognition effect on the real tampered images, that is, the image tampering recognition model after training has an overfitting problem for the generated tampered images. By using this method, a discriminator (i.e., a second discriminator) can be added to the image tampering recognition model to determine whether the image is truly tampered or generated tampered. Thus, in the training process of the image tampering recognition model, the second discrimination difference used to measure the accuracy of the model's discrimination of real tampering or generated tampering can be determined according to the output of the second discriminator, and then the network parameters of the feature extractor are updated with the purpose of increasing the second recognition loss trend. Thus, it is difficult for the model to distinguish between real tampered images and generated tampered images, reducing the degree of overfitting of the image tampering recognition model for generated tampered images. Then, the generalization of the model is improved, because the model's detection ability for real tampered images is improved. Since the trained image tampering recognition model is usually mainly used for the detection of real tampered images, it is not often used for the detection of tampered images generated for the purpose of training. On the other hand, in some embodiments, it is also possible to identify whether the image has been tampered with by extracting the fusion features of multiple image frames. Thus, feature clues of tampering can be found from multiple image frames, further improving the detection ability of image tampering.
[0021] The following further describes a method for training an image tampering recognition model provided by an embodiment of this specification. Figure 3 1 is a flow chart of a training method of an image tampering recognition model in an embodiment of the present specification. The image tampering detection model may include a feature extractor, a first discriminator, and a second discriminator. Figure 3 As shown, the method at least comprises the following steps:
[0022] Step S301: Acquire a training sample, wherein the training sample includes an image frame, a first label, and a second label, wherein the first label indicates whether the image frame has been tampered with. When the first label indicates that the image frame has been tampered with, the second label is used to indicate whether the image frame is a real tampered image or a generated tampered image;
[0023] Step S303: input the image frame into the feature extractor to obtain the image features corresponding to the image frame, input the image features into the first discriminator to obtain the first discrimination result, and determine the first discrimination difference according to the first discrimination result and the first label: input the image features into the second discriminator to obtain the second discrimination result, and determine the second discrimination difference according to the second discrimination result and the second label; update the feature extractor with the purpose of making the first discrimination difference tend to become smaller and the second discrimination difference tend to become larger.
[0024] First, in step S301, a training sample is obtained. The training sample may include an image frame, a first label and a second label. The first label may indicate whether the image frame has been tampered with. When the first label indicates that the image frame has been tampered with, the second label may be used to indicate whether the image frame is a real tampered image or a generated tampered image. In one embodiment, the training sample may include one or more of a real sample, a real tampered sample, or a generated tampered sample. The image frame included in the real sample is a real image, the image frame included in the real tampered sample is a real tampered image, and the image frame included in the generated tampered sample is a generated tampered image.
[0025] An image frame is usually an image of a specific target object. According to different embodiments, the image frame may be an image of different specific target objects. In one embodiment, for example, it may be an image of a document that identifies a user (such as an ID card, passport, etc.). According to different embodiments, the image frame may include different specific types of images of the target object. In one embodiment, the image frame may include one or more image frames corresponding to the target object, the one or more image frames including a front frame corresponding to the target object, a flash frame corresponding to the target object, a tilt frame corresponding to the target object, a differential frame determined based on the front frame and the flash frame, an edge frame determined based on the flash frame, and one or more of a statistical area merged frame determined based on the normal frame, such as Figure 4As shown. Among them, the front frame is an image facing the target object, such as a conventional ID photo. The flash frame is an image of the target object under the flash effect. The oblique frame is an image of the target object obtained by a preset oblique shooting angle. The differential frame is used to represent the difference information between the front frame and the flash frame. The edge frame is an image frame that highlights the edge features of the image (such as the outline and boundary of the object therein) obtained by processing the flash frame with an edge detection algorithm. The statistical region merging (SRM) frame is obtained by performing image processing on the normal frame with the SRM algorithm. By extracting the fusion features of the above-mentioned multiple image frames, the characteristic clues of tampering can be found from multiple dimensions, thereby improving the detection capability of image tampering. In different specific implementations, the specific process of obtaining the above-mentioned multiple image frames may be different, and this specification does not limit this.
[0026] In different embodiments, the generation process of generating the tampered image included in the training sample may be different. In one embodiment, the generated tampered image may be a document image, and the generated tampered image may be generated by the following process: a face image or a text image that does not belong to the first document photo or is preprocessed by a preset image processing method may be synthesized into the face area or text area of the first document photo to obtain the document image. In different embodiments, the first document photo may be an image of a different specific document. In different embodiments, the face image or text image preprocessed by a preset image processing method may include, for example, a rectangular face image, an arched face image, a head-shaped contour face image, a face contour face image, a mask-covered face image, a text strip image, a text block image, a single word image, and a smeared word image. Among them, the mask-covered face image can be obtained by fitting an image of a preset mask shape (the image may include, for example, a preset texture, pattern, color, etc.) to the face image. In one implementation, the face image or text image may be synthesized into the face region or text region of the ID photo by using the MimicBrush algorithm to obtain the ID photo image.
[0027] Then, in step S303, the image frame can be input into the feature extractor to obtain the image features corresponding to the image frame. In different embodiments, the specific network structure of the feature extractor may be different. In one embodiment, the feature extractor may be based on the backbone network and the neck network included in the Yolo model. The Yolo (You Only Look Once) model is a deep learning model for target detection. It includes a backbone network, a neck network and a head network. Among them, the backbone network and the neck network are used to extract and fuse the features of the object to be tested, and the head network is used to determine whether the object to be tested contains a preset target and the location of the target.
[0028] After extracting the image features, the image features can be input into the first discriminator to obtain a first discrimination result, and a first discrimination difference can be determined based on the first discrimination result and the first label; the image features can be input into the second discriminator to obtain a second discrimination result, and a second discrimination difference can be determined based on the second discrimination result and the second label. In the implementation mode where the above-mentioned training samples include multiple image frames, the multiple image frames can be input into the feature extractor to obtain fused features corresponding to the multiple image frames. Furthermore, the fused features can be input into the first discriminator to obtain a first discrimination result, and the fused features can be input into the second discriminator to obtain a second discrimination result, such as Figure 5 As shown. Furthermore, the network parameters of the feature extractor can be updated with the purpose of the first discriminant difference tending to become smaller and the second discriminant difference tending to become larger. Specifically, in different implementations, for example, a specific loss function can be determined based on the first discriminant difference and the second discriminant difference, and the network parameters of the feature extractor can be updated based on the loss function, for example, through the back propagation algorithm (BP). It should be noted that although the purpose of training itself is to make the second discriminant difference tend to become larger, it is not limited to the function value of the loss function determined according to the second discriminant difference in training that it must tend to become larger. As long as the training result causes the second discriminant difference to tend to become larger, this specification does not limit the specific loss function used for training. In one implementation, the network parameters of the first discriminator can also be updated with the purpose of the first discriminant difference tending to become smaller, and / or the network parameters of the second discriminator can be updated with the purpose of the second discriminant difference tending to become larger, such as Figure 5 shown.
[0029] In different specific implementations, the specific process of determining the first discrimination difference and the second discrimination difference may be different. In a specific implementation, determining the first discrimination difference may be expressed as:
[0030]
[0031] Among them, L y represents the first discriminant difference, yi represents the first label, G y () represents the first discriminator, G f () represents the feature extractor, x i Represents an image frame.
[0032] In a specific implementation, determining the second discrimination difference may be expressed as:
[0033]
[0034] Among them, L d represents the second discriminant difference, d i Indicates the second label, G d () represents the second discriminator, G f () represents the feature extractor, x i Represents an image frame.
[0035] According to one embodiment, the target tampering detection model may further include a third discriminator. The image features may also be input into a third discriminator to obtain a third discriminant result, and a third discriminant difference may be determined based on the third discriminant result and a preset third label, wherein the third label indicates the location of the tampered area in the target image. Furthermore, the network parameters of the feature extractor may be updated with the purpose of reducing the first discriminant difference and the third discriminant difference and increasing the second discriminant difference. In another embodiment, the network parameters of the first discriminator and the third discriminator may also be updated with the purpose of reducing the first discriminant difference and the third discriminant difference. The network parameters of the second discriminator may be updated with the purpose of increasing the second discriminant difference, such as Figure 6 As shown. In different implementations, the specific network structures of the first discriminator, the second discriminator, and the third discriminator may also be different. In the above implementation, in which the feature extractor is based on the backbone network and the link network included in the Yolo model, the first discriminator and the third discriminator network results may be based on the head network included in the Yolo model.
[0036] A training method for an image tampering recognition model is described above. According to another aspect of the embodiment, a corresponding image tampering recognition method is also provided. Figure 7 is a flow chart of an image tampering identification method in one embodiment of this specification, such as Figure 7 As shown, the method comprises at least the following steps:
[0037] Step S701, obtaining an image frame to be tested;
[0038] Step S703: input the image frame to be tested into Figure 3 The feature extractor in the image tampering recognition model trained by the method shown in the figure obtains image features, and the image features are input into the image tampering recognition model through the method shown in the figure. Figure 3 The first discriminator in the image tampering recognition model trained by the method shown obtains a recognition result of whether the image frame to be tested has been tampered with.
[0039] Yet another aspect of the present specification provides a computing device, comprising: a processor; and a memory, in which a program is stored, wherein when the processor executes the program, any one of the above methods is implemented.
[0040] On another aspect, the present specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute any one of the above methods.
[0041] On the other hand, the present specification provides a computer program product, including a computer program / instruction, which implements any of the above methods when executed by a processor.
[0042] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to 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 an improvement in a method flow cannot be implemented using 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 it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. 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 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.
[0043] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed 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 controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can 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, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0044] 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 server system. Of course, the present application does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, 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.
[0045] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0046] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0047] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. 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.
[0048] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising 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.
[0049] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions 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.
[0050] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0051] The 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. The memory is an example of a computer-readable medium.
[0052] 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, graphene 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 herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0053] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present 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 the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0054] 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.
[0055] Each embodiment in this specification is described in a progressive manner, and the same and 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. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0056] The above description is only an example of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. For those skilled in the art, one or more embodiments of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims.
Claims
1. A training method for an image tampering recognition model, wherein the target tampering detection model comprises a feature extractor, a first discriminator and a second discriminator, and the method comprises: Acquire a training sample, where the training sample includes an image frame, a first label and a second label, where the first label indicates whether the image frame has been tampered with, and when the first label indicates that the image frame has been tampered with, the second label is used to indicate that the image frame is a real tampered image or a generated tampered image; Inputting the image frame into the feature extractor to obtain image features corresponding to the image frame, inputting the image features into a first discriminator to obtain a first discrimination result, and determining a first discrimination difference according to the first discrimination result and the first label; Inputting the image feature into a second discriminator to obtain a second discrimination result, and determining a second discrimination difference according to the second discrimination result and the second label; The feature extractor is updated with the purpose of reducing the first discrimination difference trend and increasing the second discrimination difference trend.
2. The method according to claim 1, wherein: The image frames include one or more image frames corresponding to the target object, and the one or more image frames include one or more of a front frame corresponding to the target object, a flash frame corresponding to the target object, an oblique frame corresponding to the target object, a differential frame determined based on the front frame and the flash frame, an edge frame determined based on the flash frame, and a statistical region merged frame determined based on the normal frame; Inputting the image frame into the feature extractor to obtain image features corresponding to the image frame, including: inputting the multiple image frames into the feature extractor to obtain fusion features corresponding to the multiple image frames; Inputting the image feature into a first discriminator to obtain a first discrimination result, including: inputting the fusion feature into the first discriminator to obtain a first discrimination result; Inputting the image feature into a second discriminator to obtain a second discrimination result includes: inputting the fusion feature into a second discriminator to obtain a second discrimination result.
3. The method according to claim 1, further comprising: The network parameters of the first discriminator are updated with the purpose of reducing the first discrimination difference trend, and / or the network parameters of the second discriminator are updated with the purpose of increasing the second discrimination difference trend.
4. The method according to claim 1, wherein: The target tampering detection model also includes a third discriminator; The method further includes: inputting the image feature into a third discriminator to obtain a third discrimination result, and determining a third discrimination difference according to the third discrimination result and a preset third label, wherein the third label indicates a position of a tampered area in the target image; With the purpose of reducing the first discrimination difference and increasing the second discrimination difference, updating the network parameters of the feature extractor includes: The network parameters of the feature extractor are updated with the purpose of making the first discrimination difference and the third discrimination difference tend to become smaller and the second discrimination difference tend to become larger.
5. The method according to claim 1, wherein: The feature extractor is based on the backbone network and link network included in the Yolo model.
6. The method according to claim 1, wherein: The training samples may include one or more of real samples, real tampered samples or generated tampered samples, the image frames included in the real samples are real images, the image frames included in the real tampered samples are real tampered images, and the image frames included in the generated tampered samples are generated tampered images.
7. The method according to claim 6, wherein: The generated tampered image is a certificate image, and the generated tampered image is generated by the following process: A face image or a text image that is not in a preset shape of the first ID photo or is preprocessed by a preset image processing method is synthesized into a face region or a text region of the first ID photo to obtain the ID image.
8. The method according to claim 1, wherein: The face image or text image of the preset shape or pre-processed by a preset image processing method includes one or more of a rectangular face image, an arched face image, a head-shaped outline face image, a face outline face image, a mask-covered face image, a text strip image, a text block image, a single word image and a smeared word image.
9. A method for identifying image tampering, comprising: Acquire the image frame to be tested; The image frame to be tested is input into a feature extractor in an image tampering recognition model trained by the method of claim 1 to obtain image features, and the image features are input into a first discriminator in an image tampering recognition model trained by the method of claim 1 to obtain a recognition result of whether the image frame to be tested has been tampered with.
10. A computer device comprising: processor; and a memory, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 9 is implemented.