Detection model training method, detection method, medium, terminal and product

Through the generation model, the feature fusion process of the credential image elements is generated, and a variety of samples are generated and the detection model is trained, which solves the problem of inaccurate credential image detection effect in the prior art and achieves higher detection accuracy.

CN116912137BActive Publication Date: 2025-04-29CHONGQING ANT CONSUMER FINANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310641175.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-01
Publication Date
2025-04-29
Estimated Expiration
2043-06-01

AI Technical Summary

Technical Problem

In the prior art, when detecting fraud problems such as PS modification in credential images, the detection effect is not accurate enough and a more accurate detection method is needed.

Method used

By generating the model, the elements of the credential image (such as proof text, electronic seal, background paper images) are characterized by fusion processing, and a variety of samples are generated, and the detection model is trained through these samples to improve the accuracy of the detection.

Benefits of technology

This method enriches sample generation capabilities, increases the diversity and predictability of samples, and significantly improves the detection accuracy of the detection model on the target credential images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116912137B_ABST
    Figure CN116912137B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide a method for training a detection model, a method for detecting a voucher image, a device for training a detection model, a device for detecting a voucher image, a computer-readable storage medium, a terminal, and a computer program product. The above-mentioned method for training a detection model includes: inputting at least one element about a voucher image into a generation model, and determining a first type of sample according to a generated voucher image output by the generation model; then, training the detection model with the first type of sample, the second type of sample, and the third type of sample, wherein the second type of sample is a real voucher image, and the third type of sample is a fake voucher image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of image processing technology, and in particular to a detection model training method, a credential image detection method, a detection model training device, a credential image detection device, a computer-readable storage medium, a terminal, and a computer program product. Background Art

[0002] In the agreement repayment business, customers will upload relevant voucher images to the review platform, which will review the uploaded voucher images to detect whether there are PS modification and other fraud problems in the voucher images. If PS modification and other fraud problems are detected in the voucher images, the voucher images with fraud problems will be submitted to the reviewers to assist the reviewers in improving the review efficiency and reducing errors.

[0003] At this stage, the detection method of the audit platform still needs a solution with more accurate detection effect to implement.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this specification, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the embodiments of this specification is to provide a detection model training method, a credential image detection method, a detection model training device, a credential image detection device, a computer-readable storage medium, a terminal, and a computer program product, which can enrich the sample generation capability and thereby improve the detection effect of the detection model on the target credential image to a certain extent.

[0006] Other features and advantages of the embodiments of the present specification will become apparent from the following detailed description or may be learned in part from the practice of the present specification.

[0007] According to a first aspect of an embodiment of the present specification, a method for training a detection model is provided, the method comprising: inputting at least one element about a credential image into a generation model, and determining a first category of samples based on a generated credential image output by the generation model; training the detection model through the first category of samples, the second category of samples, and the third category of samples, the second category of samples being real credential images, and the third category of samples being fake credential images.

[0008] In one embodiment of the present specification, the above-mentioned elements include certificate text, electronic seal and background paper image; the above-mentioned inputting at least one element about the certificate image into the above-mentioned generation model includes: obtaining the above-mentioned certificate text about the certificate image, obtaining the above-mentioned electronic seal about the certificate image and obtaining the above-mentioned background paper image about the certificate image; inputting at least one of the above-mentioned certificate text, the above-mentioned electronic seal and the above-mentioned background paper image into the generation model, so as to perform feature fusion processing on the above-mentioned certificate text, the above-mentioned electronic seal and the above-mentioned background paper image through the above-mentioned generation model to obtain the above-mentioned generated certificate image.

[0009] In one embodiment of the present specification, the above-mentioned obtaining of the above-mentioned certification text regarding the credential image includes: generating the above-mentioned certification text according to a preset font size and / or font type; the above-mentioned obtaining of the above-mentioned electronic seal regarding the credential image includes: generating the above-mentioned electronic seal by arranging five-pointed stars and arc-shaped text arrangements; the above-mentioned obtaining of the above-mentioned background paper image regarding the credential image includes: generating the above-mentioned background paper image according to the color of blank paper in different scenarios.

[0010] In one embodiment of the present specification, the above-mentioned generation model is used to perform feature fusion processing on the above-mentioned certificate text, the above-mentioned electronic seal and the above-mentioned background paper image to obtain the above-mentioned generated certificate image, including: mapping the above-mentioned certificate text, the above-mentioned electronic seal and the above-mentioned background paper image to one image through the above-mentioned generation model; adding a fuzzy function and background noise to the above-mentioned image to obtain the above-mentioned generated certificate image.

[0011] In one embodiment of the present specification, after the detection model is trained by the first, second and third category samples, the second category samples are real credential images, and the third category samples are fake credential images, the method further includes: calculating the intersection-over-union ratio of the pixel area of ​​the generated credential image and the reference mark area; and scoring the generated credential image according to the intersection-over-union ratio.

[0012] In one embodiment of the present specification, the method further includes: when the score is less than a preset value, adjusting the parameters of the generation model through reverse transfer; wherein the generation model after adjusting the parameters is used to output the generated credential image again, and the first category of samples is determined again through the generated credential image, and the first category of samples determined again are used to train the detection model to strengthen the learning of the generation model and the detection model.

[0013] According to a second aspect of an embodiment of the present specification, a method for detecting a credential image is provided, wherein the method comprises: obtaining a target credential image to be detected; inputting the target credential image into a detection model, and determining a detection result of the target credential image according to an output of the detection model; wherein the detection model is determined according to the training method of the detection model provided in the first aspect.

[0014] According to a third aspect of an embodiment of the present specification, a training device for a detection model is provided, wherein the training device for the detection model comprises: a generation module, used to input at least one element about a credential image into the generation model, and determine a first category of samples based on the generated credential image output by the generation model; a training module, used to train the detection model through the first category of samples, the second category of samples and the third category of samples, wherein the second category of samples are real credential images, and the third category of samples are fake credential images.

[0015] According to a fourth aspect of the embodiments of this specification, a device for detecting a credential image is provided, wherein the device for detecting a credential image comprises: an acquisition module for acquiring a target credential image to be detected; a detection module for inputting the target credential image into a detection model, and determining a detection result of the target credential image according to an output of the detection model; wherein the detection model is determined according to the training method of the detection model of the first aspect.

[0016] According to a fifth aspect of the embodiments of this specification, a terminal is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for training the detection model described in the first aspect is implemented, or the method for detecting the credential image described in the second aspect is implemented.

[0017] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the detection model mentioned in the first aspect is implemented, or the detection method of the credential image mentioned in the second aspect is executed.

[0018] According to a seventh aspect of the embodiments of this specification, a computer program product is provided. When the above-mentioned computer program product runs on a computer or a processor, the above-mentioned computer or processor implements the above-mentioned first aspect of the above-mentioned detection model training method, or executes the above-mentioned second aspect of the above-mentioned credential image detection method.

[0019] The embodiments of this specification provide a detection model training method, a credential image detection method, a detection model training device, a credential image detection device, a computer-readable storage medium, a terminal, and a computer program product, which have the following technical effects:

[0020] The solution provided by the exemplary embodiments of this specification is suitable for enriching the sample generation capability and improving the detection accuracy of the target credential image by the detection model. Specifically, first, at least one element about the credential image is input into the generation model, and the first category of samples is determined according to the generated credential image output by the generation model; then, the detection model is trained with the first category of samples, the second category of samples, and the third category of samples, wherein the second category of samples are real credential images and the third category of samples are fake credential images. By enriching the sample generation capability through the generation model, increasing the diversity and predictability of the samples, and using the diverse and predictive samples to train the detection model, the accuracy of the detection model in detecting the target credential image can be improved to a certain extent.

[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the specification, and together with the specification are used to explain the principles of the specification. Obviously, the accompanying drawings described below are only some embodiments of the specification, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0023] Figure 1 is a schematic flow chart of a method for training a detection model provided in an exemplary embodiment of this specification;

[0024] Figure 2 is a schematic flow chart of the training of a detection model provided by another exemplary embodiment of this specification;

[0025] Figure 3 is a schematic flow chart of a method for detecting a credential image provided by an exemplary embodiment of this specification;

[0026] Figure 4 is a schematic structural diagram of a detection model training device provided in an exemplary embodiment of this specification;

[0027] Figure 5 is a schematic structural diagram of a detection model training device provided in another exemplary embodiment of this specification;

[0028] Figure 6is a schematic flow chart of a method for detecting a credential image provided by another exemplary embodiment of the present specification;

[0029] Figure 7 It is a schematic block diagram of a terminal provided by an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solutions and advantages of this specification more clear, the embodiments of this specification will be further described in detail below with reference to the accompanying drawings.

[0031] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Instead, they are only examples of devices and methods consistent with some aspects of this specification as detailed in the attached claims.

[0032] In the description of this specification, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood according to specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

[0033] In the agreement repayment business, if a customer needs to apply for a deferred repayment or repayment reduction or other preferential policies due to abnormalities in his or her own finances, he or she will submit relevant voucher materials, namely voucher images, to the audit platform. The audit platform's detection model detects the voucher images to identify whether there are PS modifications or other fraudulent problems in the voucher images. If PS modifications or other fraudulent problems are detected in the voucher images, the voucher images with fraudulent problems will be submitted to the auditors to assist the auditors in improving the audit efficiency and reducing errors.

[0034] Traditional detection models can only be trained using real, existing fake voucher images, and after training, they can only judge voucher images based on prior rules, which has low accuracy and poor detection results.

[0035] In response to the above problems, the embodiments of this specification provide a detection model training method, a credential image detection method, a detection model training device, a credential image detection device, a computer-readable storage medium, a terminal, and a computer program product. Below, the various steps of the detection model training method in this example implementation will be described in more detail in conjunction with the accompanying drawings and embodiments.

[0036] in, Figure 1 This is a schematic flow chart of a detection model training method provided in an exemplary embodiment of this specification. The detection model training method can be executed by a computing device with computing functions, such as a desktop computer or a laptop computer, and the detection model training method includes the following steps:

[0037] In S110 , at least one element related to the voucher image is input into a generation model, and a first type of sample is determined according to a generated voucher image output by the generation model.

[0038] For example, in the existing conventional sample generation method, the image is scaled blurred by Gaussian kernel blurring or the like, and then the image is scaled and cropped. Then, multiple noise distribution levels of the image are simulated by Gaussian noise and shot noise, and finally the image is rotated at multiple scales.

[0039] However, the credential image in this example embodiment is a proof material composed of specific elements in a certain structure. The tampered area of ​​the proof material uploaded by the customer is relatively subtle. The use of Gaussian and blur will conceal such subtle tampering, and the generated training sample loses the typicality of the sample; and when the customer uploads the proof material to the review platform, it is necessary to enlarge or reduce the credential image due to the influence of pixels or image format, which will involve secondary modification of the credential image and will also affect the tampered area of ​​the proof material, losing the typicality of the training sample; and in reality, fake credential images may be several combinations, and the generated samples represented by the artificial combination method have a relatively simple counterfeiting method.

[0040] Therefore, in order to improve the typicality of training samples, simulate training samples in real scenes and increase the diversity of training samples in this example embodiment, the generation model adopted is a parallel addition structure, at least one element of the credential image input to the generation model is fused, and the several fixed combinations in the above method are converted into random combinations to increase the space for training samples; then, a fuzzy function and background noise are added to the fused image, and the learning ability of the generation model is improved by continuously adjusting the parameters of the fuzzy function and background noise, so as to enrich the generation ability of samples, so that the generated training samples fit the training samples generated in real scenes and have typicality and diversity.

[0041] Exemplarily, the elements of the voucher image include certification text, electronic seal and background paper image. The certification text includes the font type and / or size of the text; the electronic seal includes the arrangement of five-pointed stars, the size of the five-pointed stars and the arrangement of arc-shaped text and / or English in the electronic seal.

[0042] Exemplarily, for example, if the elements of the credential image are certification text and electronic seal, the certification text and electronic seal are input into the generation model, and the convolutional neural network (CNN) in the generation model adds the images of the certification text and the electronic seal, and finally outputs the generated credential image, and determines that the generated credential image is a first-category sample.

[0043] The generated credential image output by the generation model can overcome the limitations and singularity of human fraud, predict unknown fraud methods, and enrich the ability of sample generation; and the generated credential image output by the generation model, compared with the existing rigid ordinary samples, flexibly integrates a variety of elements about the credential image, increasing the space and diversity of samples. It should be noted that in order to meet the sample requirements generated in real scenes, the font type and text size of the certificate text in this example embodiment can be adjusted by the user under certain circumstances. The background paper image can be a white paper without any certificate text and electronic seal taken in any scene.

[0044] In S120, the detection model is trained by using the first category samples, the second category samples, and the third category samples.

[0045] Exemplarily, the first type of sample is a generated voucher image output by the generation model, which is a fake voucher image; the second type of sample is a real voucher image, and the third type of sample is a fake voucher image. In other words, in combination with the above example embodiments, the first type of sample is generated by the generation model based on a random combination of certification text, electronic sheets and / or background paper images, which is a predicted fake voucher image; the second type of sample is a real voucher that complies with the audit rules without any tampering; the third type of sample is a fake voucher that has been tampered with by applications such as PS and discovered by the audit platform during the audit process.

[0046] Exemplarily, in combination with the above-mentioned example embodiments, the first category of samples, the second category of samples and the third category of samples are input into the detection model to train the detection model, wherein the first category of samples and the third category of samples correspond to constructed fake credential images and real fake credential images, respectively, and the second category of samples are real credential images. Using the three categories of samples to train the detection model can enable the detection network to effectively identify the difference between real fake credential images and constructed fake credential images; by identifying the difference between real fake credential images and constructed fake credential images, the parameters of the generation model are adjusted in reverse, which can effectively balance the difference between real samples and generated samples to a certain extent.

[0047] exist Figure 1 In the above-mentioned embodiment of the specification, the training method of the detection model provided is, first, inputting at least one element about the credential image into the generation model, and determining the first type of sample according to the generated credential image output by the generation model; then, training the detection model with the first type of sample, the second type of sample and the third type of sample, wherein the second type of sample is a real credential image, and the third type of sample is a fake credential image. The generated credential image output by the generation model can enrich the sample generation capability, increase the diversity and predictability of the training samples, and train the detection model with diverse and predictive training samples, which can improve the accuracy of the detection model in detecting the target credential image to a certain extent.

[0048] Figure 2 FIG. 1 is a schematic flow chart of the training of a detection model provided by another exemplary embodiment of the present specification. The training method of the detection model comprises the following steps:

[0049] In S210 , at least one element related to the voucher image is input into a generation model, and a first type of sample is determined according to a generated voucher image output by the generation model.

[0050] Exemplarily, the elements of the credential image include certification text, an electronic seal, and a background paper image.

[0051] In an exemplary embodiment, in step S210, at least one element of the credential image is input into the generation model, specifically including: obtaining certification text about the credential image, obtaining an electronic seal about the credential image, and obtaining a background paper image about the credential image; the certification text, the electronic seal, and the background paper image are input into the generation model, so as to perform feature fusion processing on the certification text, the electronic seal, and the background paper image through the generation model to obtain a generated credential image.

[0052] Exemplarily, the certification text of the voucher image includes the font type and / or the size of the text; the electronic seal of the voucher image includes the arrangement of five-pointed stars, the size of the five-pointed stars, and the arrangement of arc-shaped text and / or English in the electronic seal.

[0053] Exemplarily, in combination with the above exemplary embodiments, obtaining the certification text about the voucher image includes: generating the certification text according to a preset font size and / or font type; obtaining the electronic seal about the voucher image includes: generating the electronic seal by arranging five-pointed stars and arc-shaped text arrangements. Obtaining the background paper image about the voucher image includes: generating the background paper image according to the color of the blank paper in different scenes.

[0054] In combination with the above-mentioned example embodiments, it can be understood that the font type and the size of the text of the generated certificate text are obtained, the arrangement of the five-pointed stars of the generated electronic seal, the size of the five-pointed stars, and the arrangement of the arc-shaped text and / or English in the electronic seal, and the generated background paper image are obtained, and then the font type and / or the size of the text of the certificate text, the arrangement of the five-pointed stars of the electronic seal, the size of the five-pointed stars, and the arrangement of the arc-shaped text and / or English in the electronic seal, and the background paper images in different scenes are input into the generation model, and the generation model performs feature fusion processing on the font type and / or the size of the text of the certificate text, the arrangement of the five-pointed stars of the electronic seal, the size of the five-pointed stars, and the arrangement of the arc-shaped text and / or English in the electronic seal, and the background paper images in different scenes, that is, performs addition processing, randomly combines them into a generated certificate image, and finally outputs the generated certificate image.

[0055] In an exemplary embodiment, the above-mentioned feature fusion processing of the certificate text, electronic seal and background paper image is performed through the generation model to obtain the generated certificate image, which specifically includes: mapping the certificate text, electronic seal and background paper image into one image through the generation model; adding fuzzy function and background noise to the image to obtain the generated certificate image.

[0056] Exemplarily, the generation model used in this example embodiment is a parallel summing structure, which adds the certificate text, electronic seal and background paper image input to the generation model, and can map the certificate text, electronic seal and background paper image to an image, constructing a certificate image with a specific composition structure, and then adding a fuzzy function and background noise to the certificate image to obtain a generated certificate image. By adding a fuzzy function and background noise to the certificate image and constantly adjusting the parameters of the fuzzy function and background noise, the learning ability of the generation model can be improved, so that the generated certificate image is more in line with the artificially constructed certificate image in the real scene;

[0057] And by adjusting the font type and / or the size of the certification text of the voucher image, the arrangement of the five-pointed stars of the electronic seal of the voucher image, the size of the five-pointed stars, and the arrangement of the arc-shaped text and / or English in the electronic seal, and using background paper images in different scenes, such as background paper images in daytime, night, cloudy or sunny days, the generated voucher image output by the generation model has diversity, which can overcome the monotony of the third type of samples constructed by artificial fraud methods and predict potential fraud methods;

[0058] And by fusing at least one element of the credential image through the generative network, it can be applicable to existing fraudulent samples on the one hand, that is, simulating existing fraudulent credentials; on the other hand, it can be applicable to samples with unknown fraud methods, that is, randomly combining to predict new fraudulent credentials.

[0059] In S220, the detection model is trained by using the first type of samples, the second type of samples, and the third type of samples.

[0060] Exemplarily, the second type of samples are real credential images, and the third type of samples are fake credential images. In combination with the above exemplary embodiments, the first type of samples are fake credential images constructed by the generation model, that is, the sample set consisting of the first type of samples, the second type of samples, and the third type of samples contains both real credential images and constructed fake credential images. By training the detection model with this sample set, the deviation caused by only using the generated first type of samples or only using the second type of samples and the third type of samples in real scenes to train the detection model can be avoided to a certain extent.

[0061] In S230 , an intersection-over-union ratio of a pixel area of ​​the generated voucher image and an area of ​​the reference mark is calculated.

[0062] Exemplarily, the intersection-and-union ratio is the ratio of the intersection and union of two bounding boxes calculated by the intersection-and-union ratio function, and is used to evaluate the target detection algorithm. In this example embodiment, one bounding box is the pixel area of ​​the generated voucher image, where the generated voucher image is a picture composed of 0 and 1 output by the generation model; the other bounding box is the reference marker area. In supervised learning, the data is labeled and appears in the form of (x, t), where x is the input data, t is the correct label, t is the ground truth, and the wrong label is not. In addition, in some scenarios, all labeled data can also be called ground truth. In this example embodiment, the reference marker area here can be understood as labeled data, that is, data that has been tampered with by PS.

[0063] Exemplarily, the intersection of the bounding box of the pixel area of ​​the generated credential image and the data frame marked with PS tampering is divided by the union of the bounding box of the pixel area of ​​the generated credential image and the data frame marked with PS tampering, and the intersection ratio of the pixel area of ​​the generated credential image and the reference mark area is obtained, which is used to represent the area in the generated credential image that has been tampered with by PS, thereby achieving the purpose of testing the detection capability of the detection model by determining the area that has been tampered with by PS.

[0064] It should be noted that the detection model is trained through step S210 and step S220, the generated credential image is detected by the trained detection model, the intersection-over-union ratio of the pixel area of ​​the generated credential image and the reference mark area is calculated, and the detection capability of the trained detection model is evaluated by the intersection-over-union ratio, so as to facilitate the subsequent adjustment of the parameters of the generated model, so that the generated model is combined again to generate the credential image, and the generated credential image is used again to train the detection model until the convergence error of the detection model remains basically unchanged.

[0065] In S240 , the generated voucher image is scored according to the intersection-over-union ratio.

[0066] Exemplarily, in combination with the above embodiments, it can be known that the intersection-in-union ratio is used to evaluate the detection capability of the detection model. For example, if the intersection of the border of the pixel area of ​​the generated voucher image and the data frame marked with PS tampering is divided by the union of the border of the pixel area of ​​the generated voucher image and the data frame marked with PS tampering, the obtained intersection-in-union ratio is 0, which proves that the border of the pixel area of ​​the generated voucher image does not overlap with the data frame marked with PS tampering; if the intersection of the border of the pixel area of ​​the generated voucher image and the data frame marked with PS tampering is divided by the union of the border of the pixel area of ​​the generated voucher image and the data frame marked with PS tampering, the obtained intersection-in-union ratio is 1, which proves that the border of the pixel area of ​​the generated voucher image overlaps with the data frame marked with PS tampering.

[0067] For example, based on the intersection-over-union ratio, determine the probability that the generated credential image has been tampered with, or determine which element of the certification text, electronic seal and / or background paper image that constitutes the generated credential image has been tampered with and the probability of tampering.

[0068] In S250, when the score is less than the preset value, the parameters of the generation model are adjusted through reverse transfer; wherein the generation model after the adjustment of the parameters is used to output the generated credential image again, and the first category of samples is determined again by generating the credential image, and the first category of samples determined again are used to train the detection model to strengthen the learning of the generation model and the detection model.

[0069] Exemplarily, the back propagation is to use the back propagation algorithm to propagate from the output layer to the hidden layer. Since there is an error between the input result and the output result of the artificial neural network, the error between the estimated value and the actual value is calculated, and the error is propagated back from the output layer to the hidden layer until it propagates to the input layer. In the process of back propagation, the values ​​of various parameters are adjusted according to the error; the above process is continuously iterated until convergence.

[0070] Exemplarily, in combination with the above exemplary embodiments, it can be known that the generation model is a parallel summing structure, and the certificate text, electronic seal and background paper image input to the generation model are summed, and the certificate text, electronic seal and background paper image can be mapped to an image to construct a certificate image with a specific composition structure. The generation model also includes parameters such as fuzzy function and background noise. When the generated voucher image is scored, if the score is high, the generated voucher image output by the generation model is determined to be a first-class sample with high quality and fits the voucher image generated in the actual scene. Afterwards, if the score is less than the preset value, the fuzzy function, background noise and other parameters of the generation model are adjusted through reverse transmission. After the adjustment is completed, the generation model outputs the generated voucher image again, and the first-class sample is determined again through the generated voucher image. The first-class sample determined again is used to train the detection model, and the above process is continuously iterated until convergence, so as to optimize the detection network according to the output of the generation network, and adjust the generation network according to the detection result of the detection network, so as to realize the enhanced learning of the generation model and the detection model. On the one hand, by adjusting the generation model through enhanced learning, the level of output generated credential images can be improved, thereby improving the level of the first type of samples, so as to achieve the purpose of predicting the fraud method; on the other hand, by strengthening the detection model after learning, the accuracy of detection of the target credential image to be detected can be improved.

[0071] It should be noted that, in this exemplary embodiment, the preset value is adjusted according to the actual application, and this exemplary embodiment does not impose any specific limitation. And the detection network involved in the embodiment of the present invention may be a CAT-NET PS detection network.

[0072] exist Figure 2In the above-mentioned embodiment of the specification, the training method of the detection model provided is as follows: first, at least one element of the voucher image is input into the generation model, and the first type of sample is determined according to the generated voucher image output by the generation model; then, the detection model is trained by the first type of sample, the second type of sample and the third type of sample; then, the intersection-over-union ratio of the pixel area of ​​the generated voucher image and the reference mark area is calculated; and the generated voucher image is scored according to the intersection-over-union ratio; finally, when the score is less than the preset value, the parameters of the generation model are adjusted by back propagation. That is, by scoring, the back propagation is used to adjust the parameters of the generation model, so as to improve the authenticity of the generated voucher image in the real scene that is tampered with by PS, which is applicable to existing fake samples on the one hand and samples with unknown fake methods on the other hand; the generated voucher image is output again by the generation model after adjusting the parameters, and the first type of sample is determined again by the generated voucher image, and the first type of sample determined again is used to train the detection model, so that the generation model and the detection model can be strengthened in learning; by strengthening the generation model after learning, the level of the generated voucher image output by the generation model can be improved, and the sample generation capability can be enriched; by strengthening the detection model after learning, the accuracy of the target voucher image detection can be improved.

[0073] Figure 3 : is a schematic flow chart of a credential image detection method provided by an exemplary embodiment of this specification. The credential image detection method can be executed by a computing device with computing functions, and the computing device can be a desktop computer or a laptop computer, etc. The credential image detection method includes steps S310 and S320, specifically:

[0074] In S310, a target credential image to be detected is obtained.

[0075] For example, if a customer needs to apply to the repayer for preferential policies such as deferred repayment or repayment reduction due to abnormalities in his or her own finances, he or she will submit relevant supporting documents according to the relevant rules of the repayer's review platform. The relevant supporting documents are the target supporting document images to be detected, which are constructed from proof text, electronic sheets, and background paper images.

[0076] Exemplarily, after the customer submits the target credential image to be detected to the review platform, the computing device obtains the target credential image to be detected.

[0077] In S320 , the target voucher image is input into the detection model, and a detection result of the target voucher image is determined according to an output of the detection model.

[0078] Exemplarily, the detection model is determined according to the detection model training method described in the above exemplary embodiment. The specific training process is referred to the above exemplary embodiment, and will not be described in detail in the embodiment of the present application.

[0079] For example, the computing device will submit the target credential image to the audit platform and input it into the detection model. The detection model will detect the target credential image to determine whether the target credential image has been tampered with by applications such as PS. The detection model will then output the detection result. The computing device will determine the detection result of the target credential image based on the detection result output by the detection model, which will be used to remind the staff responsible for the audit, thereby assisting the staff responsible for the audit to improve the audit efficiency.

[0080] In an example embodiment, a computing device inputs a target credential image to be detected into a detection model, and the detection model maps the target credential image into an image composed of 0s and 1s, and determines which areas of the image composed of 0s and 1s have been tampered with and which areas have not been tampered with by comparing the image composed of 0s and 1s with the groundtruth.

[0081] In an example embodiment, a computing device inputs a target credential image to be detected into a detection model, which maps the target credential image into an image composed of 0s and 1s, and determines which areas of the image composed of 0s and 1s have been tampered with and which areas have not been tampered with by comparing the image composed of 0s and 1s with the groundtruth, and determines whether the tampered area is a certificate text portion, an electronic seal and / or a background paper image.

[0082] exist Figure 3 In the above-mentioned embodiment of the specification, the detection method of the credential image provided is, first, to obtain the target credential image to be detected submitted by the customer to the audit platform, then input the target credential image to be detected into the detection model, and finally determine the detection result of the target credential image according to the output of the detection model. Through the result output by the detection model, it is determined whether there is an area of ​​the target credential image to be detected that has been artificially tampered with, so as to achieve the purpose of assisting the auditor to improve the audit efficiency.

[0083] The following are device embodiments of this specification, which can be used to implement the method embodiments of this specification. For details not disclosed in the device embodiments of this specification, please refer to the method embodiments of this specification.

[0084] in, Figure 4 It is a schematic structural diagram of a detection model training device provided in an exemplary embodiment of this specification.

[0085] The detection model training device 400 in the embodiment of this specification includes: a generation module 410 and a training module 420, wherein:

[0086] A generation module 410, configured to input at least one element of the voucher image into a generation model, and determine a first type of sample according to a generated voucher image output by the generation model;

[0087] The training module 420 is used to train the detection model through the first type of samples, the second type of samples and the third type of samples, the second type of samples are real voucher images, and the third type of samples are fake voucher images.

[0088] in, Figure 5 It is a schematic structural diagram of a detection model training device provided in another exemplary embodiment of this specification.

[0089] In one possible implementation, the above-mentioned elements include certificate text, electronic seal and background paper image, and the above-mentioned generation module 510 is specifically used to: obtain certificate text about the certificate image, obtain electronic seal about the certificate image and obtain background paper image about the certificate image; input at least one of the certificate text, electronic seal and background paper image into the generation model, so as to perform feature fusion processing on the certificate text, electronic seal and background paper image through the generation model to obtain a generated certificate image.

[0090] In one possible implementation, the generation module 510 is specifically used to: generate certification text according to a preset font size and / or font type; generate an electronic seal by arranging five-pointed stars and arc-shaped text; and generate a background paper image according to the color of blank paper in different scenarios.

[0091] In a possible implementation, the generation module 510 is specifically used to: map the certification text, electronic seal and background paper image into an image by generating a model; and add a blur function and background noise to the image to obtain a generated voucher image.

[0092] In a possible implementation, the above-mentioned detection model training device 500 also includes a scoring module 530, and the scoring module 530 is specifically used to: calculate the intersection-and-union ratio of the pixel area of ​​the generated credential image and the reference mark area; and score the generated credential image according to the intersection-and-union ratio.

[0093] In one possible implementation, the scoring module 530 is specifically used to: when the score is less than a preset value, adjust the parameters of the generation model through reverse transfer; wherein the generation model after the parameter adjustment is used to output the generated credential image again, and the first category of samples is determined again by generating the credential image, and the first category of samples determined again are used to train the detection model to strengthen the learning of the generation model and the detection model.

[0094] It should be noted that the training device for the detection model provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the training method for the detection model. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the training device for the detection model provided in the above embodiment and the training method embodiment for the detection model belong to the same concept. Therefore, for details not disclosed in the device embodiment of this specification, please refer to the embodiment of the training method for the detection model mentioned above in this specification, which will not be repeated here.

[0095] in, Figure 6 It is a schematic structural diagram of a credential image detection device provided in another exemplary embodiment of the present specification.

[0096] The credential image detection device 600 in the embodiment of the present specification includes: an acquisition module 610 and a detection module 620, wherein:

[0097] The acquisition module 610 is used to acquire the target credential image to be detected; the detection module 620 is used to input the target credential image into the detection model and determine the detection result of the target credential image according to the output of the detection model.

[0098] It should be noted that the credential image detection device provided in the above embodiment only uses the division of the above functional modules as an example when executing the credential image detection method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the credential image detection device and the credential image detection method provided in the above embodiment belong to the same concept, and the detection model involved in the above embodiment is determined by the training method of the detection model provided in the above embodiment. Therefore, for details not disclosed in the device embodiment of this specification, please refer to the embodiment of the detection model training method mentioned above in this specification, which will not be repeated here.

[0099] The serial numbers of the embodiments of this specification are for description only and do not represent the advantages or disadvantages of the embodiments.

[0100] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method of any of the above embodiments are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0101] The embodiments of the present specification also provide a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any of the above-mentioned embodiments when executing the program.

[0102] Figure 7 The structure diagram of the terminal according to an exemplary embodiment of this specification is schematically shown. Figure 7 As shown, the terminal 700 includes: a processor 701 and a memory 702 .

[0103] In the embodiments of this specification, the processor 701 is the control center of the computer system, which can be a processor of a physical machine or a processor of a virtual machine. The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 701 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state.

[0104] In the embodiment of the present specification, during the process of executing the training method of the detection model, the above-mentioned processor 701 is specifically used to: input at least one element about the credential image into the generation model, and determine the first category of samples according to the generated credential image output by the generation model; train the detection model through the first category of samples, the second category of samples and the third category of samples, the second category of samples are real credential images, and the third category of samples are fake credential images.

[0105] Furthermore, in one embodiment of the present specification, the above-mentioned elements include certificate text, electronic seal and background paper image; the above-mentioned processor 701 is specifically used to: obtain certificate text about the certificate image, obtain electronic seal about the certificate image and obtain background paper image about the certificate image; input at least one of the certificate text, electronic seal and background paper image into the generation model, so as to perform feature fusion processing on the certificate text, electronic seal and background paper image through the generation model to obtain a generated certificate image.

[0106] Optionally, the processor 701 is specifically used to: generate certification text according to a preset font size and / or font type; generate an electronic seal by arranging five-pointed stars and arc-shaped text; and generate a background paper image according to the color of blank paper in different scenarios.

[0107] Optionally, the processor 701 is specifically used to: map the certification text, electronic seal and background paper image into one image by generating a model; and add a blur function and background noise to the image to obtain a generated voucher image.

[0108] Optionally, the processor 701 is specifically configured to: calculate an intersection-over-union ratio between a pixel area of ​​the generated voucher image and an area of ​​a reference mark; and score the generated voucher image according to the intersection-over-union ratio.

[0109] Optionally, the processor 701 is further specifically used to: when the score is less than a preset value, adjust the parameters of the generation model through reverse transfer; wherein the generation model after the adjustment of the parameters is used to output the generated credential image again, and the first category of samples is determined again by generating the credential image, and the first category of samples determined again are used to train the detection model to strengthen the learning of the generation model and the detection model.

[0110] In the embodiment of the present specification, during the execution of the credential image detection method, the processor 701 is specifically used to: obtain a target credential image to be detected; input the target credential image into a detection model, and determine a detection result of the target credential image according to an output of the detection model.

[0111] The memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage terminals and flash memory storage terminals. In some embodiments of the present specification, the non-transitory computer-readable storage medium in the memory 702 is used to store at least one instruction, which is used to be executed by the processor 701 to implement the method in the embodiment of the present specification.

[0112] In some embodiments, the terminal 700 further includes: a peripheral terminal interface 703 and at least one peripheral terminal. The processor 701, the memory 702 and the peripheral terminal interface 703 may be connected via a bus or a signal line. Each peripheral terminal may be connected to the peripheral terminal interface 703 via a bus, a signal line or a circuit board. Specifically, the peripheral terminal includes: at least one of a display screen 704, a camera 705 and an audio circuit 706.

[0113] The peripheral terminal interface 703 may be used to connect at least one peripheral terminal related to input / output (I / O) to the processor 701 and the memory 702. In some embodiments of the present specification, the processor 701, the memory 702, and the peripheral terminal interface 703 are integrated on the same chip or circuit board; in some other embodiments of the present specification, any one or two of the processor 701, the memory 702, and the peripheral terminal interface 703 may be implemented on a separate chip or circuit board. This embodiment of the present specification does not specifically limit this.

[0114] The display screen 704 is used to display the user interface (UI). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 704 is a touch display screen, the display screen 704 also has the ability to collect touch signals on the surface or above the surface of the display screen 704. The touch signal can be input to the processor 701 as a control signal for processing. At this time, the display screen 704 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments of the present specification, the display screen 704 can be one, and the front panel of the terminal 700 is set; in other embodiments of the present specification, the display screen 704 can be at least two, which are respectively set on different surfaces of the terminal 700 or are folded; in some other embodiments of the present specification, the display screen 704 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 700. Even, the display screen 704 can also be set as a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 704 can be made of materials such as a liquid crystal display (LCD) and an organic light-emitting diode (OLED).

[0115] Camera 705 is used to capture images or videos. Optionally, camera 705 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments of the present specification, camera 705 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0116] The audio circuit 706 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 701 for processing. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 700. The microphone may also be an array microphone or an omnidirectional collection microphone.

[0117] The power supply 707 is used to power various components in the terminal 700. The power supply 707 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 707 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0118] The terminal structure block diagram shown in the embodiment of this specification does not constitute a limitation on the terminal 700. The terminal 700 may include more or fewer components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0119] In this specification, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or order; the term "plurality" refers to two or more, unless otherwise clearly defined. The terms "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; "connected" can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in this specification can be understood according to specific circumstances.

[0120] In the description of this specification, it is necessary to understand that the directions or positional relationships indicated by the terms "upper" and "lower" are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing this specification and simplifying the description, rather than indicating or implying that the device or unit referred to must have a specific direction, be constructed and operated in a specific orientation. Therefore, it should not be understood as a limitation on this specification.

[0121] The embodiments of this specification also provide a computer-readable storage medium, which stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps in the above embodiments. If the components of the training device of the above detection model are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium.

[0122] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of this specification is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions can be stored in a computer-readable storage medium or transmitted by the above computer-readable storage medium. The above computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The above computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVD)), or semiconductor media (for example, solid state drives (SSD)), etc.

[0123] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0124] The above is only a specific implementation of this specification, but the protection scope of this specification is not limited to this. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.

Claims

1. A method for training a detection model, wherein: include: Inputting at least one element of the voucher image into a generation model, and determining a first type of sample according to the generated voucher image output by the generation model, wherein the first type of sample is a fake voucher image constructed by the generation model based on the at least one element of the voucher image; The detection model is trained by using the first category of samples, the second category of samples and the third category of samples to identify the difference between a real fake credential image and a constructed fake credential image through the detection model, and the parameters of the generation model are reversely adjusted according to the identified difference. The generation model after adjusting the parameters is used to output the generated credential image again, and the first category of samples is determined again through the generated credential image. The first category of samples determined again are used to train the detection model to strengthen the learning of the generation model and the detection model. The second category of samples are real credential images, and the third category of samples are real fake credential images.

2. The method for training a detection model according to claim 1, wherein: The elements include certification text, electronic seal and background paper image; The step of inputting at least one element related to the credential image into the generation model comprises: Acquire the certification text about the voucher image, acquire the electronic seal about the voucher image, and acquire the background paper image about the voucher image; At least one of the certificate text, the electronic seal and the background paper image is input into the generation model, so that the generation model performs feature fusion processing on the certificate text, the electronic seal and the background paper image to obtain the generated voucher image.

3. The method for training a detection model according to claim 2, wherein: The obtaining of the certification text about the credential image includes: Generate the certification text according to a preset font size and / or font type; The step of obtaining the electronic seal on the voucher image includes: The electronic seal is generated by arranging five-pointed stars and arc-shaped texts; The step of obtaining the background paper image related to the voucher image includes: The background paper image is generated according to the color of the blank paper in different scenes.

4. The method for training a detection model according to claim 2, wherein: The step of performing feature fusion processing on the certification text, the electronic seal and the background paper image through the generation model to obtain the generated voucher image includes: By using the generation model, the certification text, the electronic seal and the background paper image are mapped into one image; A blur function and background noise are added to the image to obtain the generated voucher image.

5. The method for training a detection model according to claim 1, wherein: The identifying the difference between the real fake credential image and the constructed fake credential image by the detection model includes: Calculating the intersection-and-union ratio of the pixel area of ​​the generated voucher image and the reference mark area; The generated voucher image is scored according to the intersection-over-union ratio.

6. The method for training a detection model according to claim 5, wherein: The method further comprises: adjusting the parameters of the generation model in reverse according to the identified difference, the generation model after the parameter adjustment is used to output the generated voucher image again, determining the first category of samples again according to the generated voucher image, and using the first category of samples determined again to train the detection model, so as to strengthen the learning of the generation model and the detection model, including: When the score is less than a preset value, adjusting the parameters of the generation model through backpropagation; Among them, the generation model after adjusting the parameters is used to output the generated credential image again, and the first category of samples is determined again through the generated credential image. The first category of samples determined again are used to train the detection model to strengthen the learning of the generation model and the detection model.

7. A method for detecting a voucher image, wherein: include: Obtain the target credential image to be detected; The target credential image is input into a detection model, and a detection result of the target credential image is determined according to an output of the detection model; wherein the detection model is determined according to the training method of the detection model according to any one of claims 1 to 6.

8. A training device for a detection model, wherein: include: A generation module, configured to input at least one element of the voucher image into a generation model, and determine a first type of sample according to the generated voucher image output by the generation model, wherein the first type of sample is a fake voucher image constructed by the generation model based on the at least one element of the voucher image; A training module is used to train the detection model through the first category of samples, the second category of samples and the third category of samples, so as to identify the difference between the real fake credential images and the constructed fake credential images through the detection model, and reversely adjust the parameters of the generation model through the identified difference. The generation model with adjusted parameters is used to output the generated credential image again, and the first category of samples is determined again through the generated credential image. The first category of samples determined again are used to train the detection model to strengthen the learning of the generation model and the detection model. The second category of samples are real credential images, and the third category of samples are real fake credential images.

9. A device for detecting a voucher image, wherein: include: An acquisition module, used to acquire a target credential image to be detected; A detection module, configured to input the target credential image into a detection model, and determine a detection result of the target credential image according to an output of the detection model; wherein the detection model is determined according to the training method of the detection model according to any one of claims 1 to 6.

10. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the processor implements the method for training a detection model as described in any one of claims 1 to 6, or implements the method for detecting a credential image as described in claim 7.

11. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the computer program implements the method for training a detection model as described in any one of claims 1 to 6, or executes the method for detecting a credential image as described in claim 7.

12. A computer program product comprising instructions, wherein: When the computer program product runs on a computer or a processor, the computer or the processor executes the method for training a detection model as claimed in any one of claims 1 to 6, or executes the method for detecting a credential image as claimed in claim 7.

Citation Information

Patent Citations

  • Bill recognition model training method , bill recognition method and device

    CN113392835A