CN113989548B - Certificate classification model training method and device, electronic equipment and storage medium - Google Patents

Certificate classification model training method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113989548B
CN113989548B CN202111219802.8A CN202111219802A CN113989548B CN 113989548 B CN113989548 B CN 113989548B CN 202111219802 A CN202111219802 A CN 202111219802A CN 113989548 B CN113989548 B CN 113989548B
Authority
CN
China
Prior art keywords
certificate
image set
image
enhanced
document image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111219802.8A
Other languages
Chinese (zh)
Other versions
CN113989548A (en
Inventor
董伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202111219802.8A priority Critical patent/CN113989548B/en
Publication of CN113989548A publication Critical patent/CN113989548A/en
Application granted granted Critical
Publication of CN113989548B publication Critical patent/CN113989548B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to artificial intelligence technology, and discloses a training method for a certificate classification model, which comprises the following steps: performing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set, generating similar certificate images of the corresponding enhanced certificate images according to pixel distribution information of each enhanced certificate image in the enhanced certificate image set, and selecting the similar certificate images with effective information quantity meeting a first preset condition to form an effective similar certificate image set; and carrying out image classification prediction training on the pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set to obtain a trained certificate classification model, and carrying out classification judgment on the certificate image to be detected by using the trained certificate classification model to obtain a classification result of the certificate image to be detected. The invention also provides a certificate classification model training device, equipment and medium. The method and the device can improve the accuracy of training the certificate classification model.

Description

Certificate classification model training method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of artificial intelligence, and in particular, to a method and apparatus for training a document classification model, an electronic device, and a computer readable storage medium.
Background
When a user transacts financial, government affairs, medical treatment and other businesses on line through a mobile phone APP or an applet, the user needs to upload corresponding certificate images according to specified requirements. For the requirement of supervision of business handling or compliance risk management, the document image uploaded by the user needs to be detected, and whether the type of the document image of the user meets the requirement is identified, for example, in order to ensure the definition and integrity of subpoena images on the user, a business system requires that the user cannot upload a document turnup or a document screen capture picture.
Common types of document images include document reproduction, electronic documents, copies or screen shots, and how to identify the types of document images uploaded by users is currently a popular way to use a neural network model based on deep learning to extract the characteristics of each document image under different document image types, and to perform classification analysis on the extracted characteristics, thereby realizing judgment on the document image types.
The neural network model is utilized to classify the document images, a large number of document image samples are required to be relied on, the classification accuracy of the neural network model can be guaranteed through training of feature extraction of the neural network model on the large number of document image samples, however, the document images relate to personal privacy data of users, and the large number of document sample images cannot be directly obtained due to safety protection of personal privacy of the users, so that the accuracy of training of the current document classification model based on the neural network model is required to be improved.
Disclosure of Invention
The invention provides a method and a device for training a certificate classification model and a computer readable storage medium, and mainly aims to improve the accuracy of training the certificate classification model.
In order to achieve the above object, the present invention provides a training method for a document classification model, including:
acquiring an original certificate image set, and executing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set;
Extracting pixel distribution information of each enhanced document image in the enhanced document image set, and generating a similar document image of the corresponding enhanced document image according to the pixel distribution information;
calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
And carrying out image classification prediction training on the pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set until the prediction training meets a second preset condition, and exiting the prediction training to obtain the trained certificate classification model.
Optionally, the performing a data enhancement operation on the set of raw document images includes:
Performing rotation operation on the original document image set according to a preset rotation angle to obtain a rotated image set;
Performing scaling operation on the original document image set according to a preset scaling scale to obtain a scaled image set;
Performing at least one noise enhancement operation of noise addition on the underlying document image set to obtain an enhanced noise image set;
And collecting the rotated image set, the zoomed image set and the enhanced noise image set to be an enhanced certificate image set.
Optionally, the performing at least one noise enhancement operation with respect to the image set of the underlying document to obtain an enhanced noise image set includes:
carrying out noise dyeing on each original document image in the original document image set to obtain a first noise-increased image set;
And carrying out local covering on each first noise-added image in the first noise-added image set to obtain an enhanced noise image set.
Optionally, the generating a similar document image of the corresponding enhanced document image according to the pixel distribution information includes:
generating a model by utilizing the pre-constructed image, and generating an initial similar document image corresponding to each enhanced document image according to the pixel distribution information of each enhanced document image;
Calculating the difference degree between each initial similar document image and the corresponding enhanced document image, and counting the generation proportion between the number of the initial similar document images corresponding to the difference degree smaller than a preset difference threshold value and the number of all the initial similar document images;
When the generation ratio is smaller than a preset generation ratio threshold, parameters of the image generation model are adjusted, the image generation model is returned to the step of generating the corresponding initial similar document image of each enhanced document image according to the pixel distribution information of each enhanced document image until the generation ratio is larger than or equal to the preset generation ratio threshold;
and selecting an initial similar document image corresponding to the difference degree smaller than a preset difference threshold value from the difference degree as a similar document image.
Optionally, said calculating the effective information content of each of said similar document images includes:
counting the number of pixels of effective information contained in the similar document image and the total number of pixels in the similar document image;
Calculating the ratio between the number of pixels containing effective information in the similar document image and the total number of pixels in the similar document image, and taking the ratio as the effective information amount of each similar document image;
optionally, before the counting the number of pixels of the effective information contained in the similar document image, the method further includes:
performing binarization processing on pixel points in each similar document image to obtain a gray value of each pixel point;
And taking the pixel point with the gray value larger than the preset pixel threshold value as the pixel point of the effective information.
Optionally, the performing image classification prediction training on the pre-constructed document classification model by using the original document image set, the enhanced document image set and the valid similar document image set until the prediction training meets a second preset condition, exiting the prediction training, and obtaining a trained document classification model, including:
Assigning the same number to each original document image, the corresponding enhanced document image and the corresponding effective similar document image in the original document image set, the enhanced document image set and the effective similar document image set;
carrying out image classification prediction training on a pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set to obtain a classification prediction result;
Counting the duty ratio between the number of images of the same classification result with the same number and the total amount of the images with the number in the classification prediction result, and averaging the duty ratios of all numbers to obtain an average duty ratio;
Judging whether the average occupation ratio meets a second preset condition or not;
If the average ratio is not the second preset condition, adjusting parameters of the pre-constructed certificate classification model, and returning to the step of performing image classification prediction training on the pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set;
And if the average occupation ratio meets the second preset condition, exiting the predictive training to obtain a trained certificate classification model.
In order to solve the above problems, the present invention further provides a training device for a document classification model, the device comprising:
the enhancement sample generation module is used for acquiring an original certificate image set, and executing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set;
The effective similar sample generation module is used for extracting pixel distribution information of each enhanced document image in the enhanced document image set and generating a similar document image of the corresponding enhanced document image according to the pixel distribution information; calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
And the classification model training module is used for carrying out prediction training of image classification on the pre-constructed certificate classification model by utilizing the original certificate image set, the enhanced certificate image set and the effective similar certificate image set until the prediction training meets a second preset condition, exiting the prediction training, and obtaining the trained certificate classification model.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
a memory storing at least one instruction; and
And the processor executes the instructions stored in the memory to realize the certificate classification model training method.
In order to solve the above-mentioned problems, the present invention further provides a computer readable storage medium having at least one instruction stored therein, the at least one instruction being executed by a processor in an electronic device to implement the above-mentioned document classification model training method.
According to the method, the enhanced certificate image set is obtained by carrying out data enhancement operation on the original certificate image set, further, a similar certificate image set of the enhanced certificate image set is generated, an effective similar certificate image set is obtained by screening the effective information amount of the similar certificate image set, and the original certificate image set, the enhanced certificate image set and the effective similar certificate image set are utilized to carry out prediction training of image classification on a pre-built certificate classification model, so that the number of samples of the certificate images is increased, the classification model is guaranteed to be fully trained, and the accuracy of training of the certificate classification model is improved.
Drawings
FIG. 1 is a flowchart of a training method for classifying documents according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a detailed implementation flow of one of the steps in the training method of the document classification model shown in FIG. 1;
FIG. 3 is a schematic diagram showing a detailed implementation flow of one of the steps in the training method of the document classification model shown in FIG. 1;
FIG. 4 is a schematic diagram showing a detailed implementation flow of one of the steps in the training method of the document classification model shown in FIG. 1;
FIG. 5 is a functional block diagram of a training device for classifying documents according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device for implementing the training method of the document classification model according to an embodiment of the present invention.
Fig. 7 is a schematic structural diagram of an electronic device for implementing the training method of the document classification model according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a training method for a certificate classification model. The execution subject of the certificate classification model training method includes, but is not limited to, at least one of a server, a terminal, and the like, which can be configured to execute the method provided by the embodiment of the application. In other words, the credential classification model training method can be performed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (ContentDelivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flowchart of a training method for a document classification model according to an embodiment of the invention is shown. In this embodiment, the method for training the certificate classification model includes:
s1, acquiring an original certificate image set, and executing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set;
In the embodiment of the invention, the original document image set comprises, but is not limited to, document images such as identity cards, driving cards, academic documents, employee cards and the like of users, wherein the types of the original document image set comprise, but are not limited to, screen capturing images, reproduction images, black and white copy images, electronic document images and the like.
In the embodiment of the invention, the original certificate image uploaded by the user can be acquired from a specified system or database according to the authorization.
In the embodiment of the invention, the data enhancement operation refers to that the data distribution of the image after the data enhancement operation accords with the real data distribution condition of the original document image through operations such as rotation, scaling, random shielding and the like on the basis of keeping the type label of the original document image unchanged.
In detail, referring to fig. 2, the step S1 includes:
S11, executing rotation operation on the original document image set according to a preset rotation angle to obtain a rotated image set;
s12, scaling operation is carried out on the original document image set according to a preset scaling proportion, and a scaled image set is obtained;
s13, performing at least one noise enhancement operation of noise addition on the original certificate image set to obtain an enhanced noise image set;
S14, collecting the rotated image set, the zoomed image set and the enhanced noise image set to be an enhanced certificate image set.
In the embodiment of the invention, the rotation and scaling operation of the image can be realized by using the common image processing function provided in the TensorFlow depth learning library of the open source, for example, the scaling function of the image can be realized by using the tf.image.resize function, for example, the original document image a is scaled to 224×224, and the corresponding scaling function is tf.image resize= (a, [224,224 ]).
Further, the noise enhancement operation of performing at least one noise addition on the image set of the original document to obtain an enhanced noise image set includes: carrying out noise dyeing on each original document image in the original document image set to obtain a first noise-increased image set; and carrying out local covering on each first noise-added image in the first noise-added image set to obtain an enhanced noise image set.
In the embodiment of the invention, one or more color parameters can be obtained from a pre-constructed database by using a python sentence with a data grabbing function, for example, the color parameter of red is r, the color range of red is (q, p), the pixel value of a target pixel is k, and k is not in the (q, p) range, and the pixel value of the target pixel is subjected to numerical adjustment by using the color parameter r, so that the pixel value of the target pixel falls in the (q, p) range. And respectively carrying out numerical adjustment on pixel values of all pixel points in the original image by utilizing various color parameters so as to achieve the effect of carrying out noise dyeing on the original document image.
According to the embodiment of the invention, through at least one noise addition to the original document image, a plurality of different types of noise images can be obtained, and the training of the image classification model with higher universality by using the plurality of different types of noise images is facilitated.
In the embodiment of the invention, the data enhancement operations such as translation, clipping, visual angle changing and the like can be adopted in the practical application.
S2, extracting pixel distribution information of each enhanced document image in the enhanced document image set, and generating a similar document image of the corresponding enhanced document image according to the pixel distribution information;
In the embodiment of the invention, munpy (digital Python) or other methods can be used to obtain the pixel distribution information of each pixel point in the enhanced document image.
In the embodiment of the invention, the similar document image can be generated through a pre-constructed image generation model, wherein the pre-constructed image generation model is a convolutional neural network model constructed based on a Conditional GAN (CGAN) algorithm.
In detail, referring to fig. 3, the step S2 includes:
S21, generating a model by utilizing a pre-constructed image, and generating an initial similar document image corresponding to each enhanced document image according to the pixel distribution information of each enhanced document image;
S22, calculating the difference degree between each initial similar document image and the corresponding enhanced document image, and counting the generation proportion between the number of the initial similar document images corresponding to the difference degree smaller than a preset difference threshold value and the number of all the initial similar document images;
S23, when the generation ratio is smaller than a preset generation ratio threshold, parameters of the image generation model are adjusted, the image generation model is returned to, and according to pixel distribution information of each enhanced document image, the corresponding initial similar document image of each enhanced document image is generated until the generation ratio is larger than or equal to the preset generation ratio threshold;
s24, selecting an initial similar document image corresponding to the difference degree smaller than a preset difference threshold value from the difference degree as a similar document image.
In the embodiment of the present invention, the difference between the initial similar document image and the corresponding enhanced document image may be calculated by a difference function including:
D=Lc+Ls
Lc=E[logP(C|Xreal)]+E[logP(C|Xfake)]
Ls=E[logP(S|Xreal)]+E[logP(S|Xfake)
Wherein E [ ] is an expected value calculation, lc is an expected value of the similarity between the initial similar document image and the enhanced document image, ls is an expected value of the effective information amount in the enhanced document image, xreal is the enhanced document image, xfake is the initial similar document image; c is the effective information amount in the initial similar document image, and S is the effective information amount of the enhanced document image.
In the embodiment of the present invention, the preset generation ratio threshold may be determined according to practical situations, and may be set to 80% or 90%, for example.
Another embodiment of the present invention may also be based on providing a method of generating a challenge sample in an open-source TensorFlow deep learning library that generates a similar document image for each of the set of enhanced document images.
S3, calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
In the embodiment of the present invention, the effective information refers to information that can be used for assisting in image classification, and it can be understood that each enhanced document image only includes a part of effective information that is helpful for image classification, and accordingly, each similar document image also includes only a part of the effective information, so that a screening operation needs to be further performed on the similar document image to obtain an effective sample set that can be used for image classification.
In the embodiment of the present invention, before the counting of the number of pixels containing effective information in the similar document image, the method further includes: performing binarization processing on pixel points in each similar document image to obtain a gray value of each pixel point; and taking the pixel point with the gray value larger than the preset pixel threshold value as the pixel point of the effective information.
In detail, referring to fig. 4, the step S3 includes:
S31, counting the number of pixels of effective information contained in the similar document image and the total number of pixels in the similar document image;
s32, calculating the ratio between the number of pixels containing effective information in the similar document image and the total number of pixels in the similar document image, and taking the ratio as the effective information amount of each similar document image;
s33, selecting the similar document images with the effective information quantity meeting the first preset condition from all the similar document images to form an effective similar document image set.
In the embodiment of the present invention, the first preset condition may be a maximum number of valid samples, for example, the similar document images are ranked in order of from the large to the small of the valid information amount, and N similar document images with the largest valid information amount are selected from the ranks, so as to obtain the valid similar document image set, where N is the maximum number of valid samples specified by the first preset condition.
In another embodiment of the present invention, the first preset condition may be an effective information amount threshold, for example, similar document images with an effective information amount greater than or equal to the effective information amount threshold specified by the first preset condition are selected from the similar document image set, and the effective similar document image set is formed.
S4, carrying out image classification prediction training on the pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set until the prediction training meets a second preset condition, and exiting the prediction training to obtain the trained certificate classification model.
In the embodiment of the present invention, the set of original document images, the set of enhanced document images, and the set of valid similar document images form a training sample set of the pre-constructed document classification model, where the pre-constructed document classification model may be a neural network model based on deep learning.
In detail, referring to fig. 5, the step S4 includes:
S41, distributing the same number for each original document image, the corresponding enhanced document image and the corresponding effective similar document image in the original document image set, the enhanced document image set and the effective similar document image set;
S42, carrying out image classification prediction training on a pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set to obtain a classification prediction result;
s43, counting the duty ratio between the number of images with the same classification result and the total amount of the images with the same number in the classification prediction result, and averaging the duty ratios of all the numbers to obtain an average duty ratio;
s44, judging whether the average duty ratio meets a second preset condition or not;
if the average occupation ratio does not meet the second preset condition, executing S45, adjusting parameters of the pre-constructed classification model, and returning to S42;
and if the average occupation ratio meets the second preset condition, executing S46, exiting the predictive training to obtain a trained certificate classification model.
In the embodiment of the invention, it can be understood that the true classification results corresponding to the enhanced document image and the effective similar document image obtained from the same original document image are the same, and when the number of the images with the same classification result in the images with the same number is increased in the classification prediction results output by the prediction training, the classification accuracy of the corresponding pre-constructed classification model is also higher.
Illustratively, for example, there are 4 images under the same number, wherein the classification results of 3 images are similar, and the ratio of the number of images under the same number with the same classification result to the total number of images under the number is 3/4.
In the embodiment of the present invention, the second preset condition may be a specified average duty ratio threshold, where the average duty ratio threshold may be set according to practical situations, for example, 80%, that is, an average value of the duty ratios under all numbers is greater than or equal to 80%, which indicates that the pre-built classification model achieves a pre-optimal effect.
In the embodiment of the invention, the training-completed classification model is utilized to extract the characteristics of the to-be-detected certificate image, the probability of each classification type corresponding to the to-be-detected certificate image is calculated according to the characteristics, and the classification type with the highest probability is selected as the classification result of the to-be-detected certificate image.
According to the method, the enhanced certificate image set is obtained by carrying out data enhancement operation on the original certificate image set, further, a similar certificate image set of the enhanced certificate image set is generated, an effective similar certificate image set is obtained by screening the effective information amount of the similar certificate image set, and the original certificate image set, the enhanced certificate image set and the effective similar certificate image set are utilized to carry out prediction training of image classification on a pre-built certificate classification model, so that the number of samples of the certificate images is increased, the classification model is guaranteed to be fully trained, and the accuracy of training of the certificate classification model is improved.
FIG. 6 is a functional block diagram of a training device for document classification models according to an embodiment of the present invention.
The document classification model training apparatus 100 of the present invention may be installed in an electronic device. Depending on the functionality implemented, the credential classification model training device 100 can include an enhanced sample generation module 101, an effective similar sample generation module 102, and a classification model training module 103. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
The enhanced sample generating module 101 is configured to obtain an original document image set, perform a data enhancement operation on the original document image set, and obtain an enhanced document image set;
The effective similar sample generating module 102 is configured to extract pixel distribution information of each enhanced document image in the enhanced document image set, and generate a similar document image of the corresponding enhanced document image according to the pixel distribution information; calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
The classification model training module 103 is configured to perform predictive training of image classification on a pre-constructed document classification model by using the original document image set, the enhanced document image set and the valid similar document image set, until the predictive training meets a second preset condition, quit the predictive training, and obtain a trained document classification model.
In detail, each module in the document classification model training device 100 in the embodiment of the present invention adopts the same technical means as the above-mentioned document classification model training method described in fig. 1 to 5, and can produce the same technical effects, which are not described herein.
Fig. 7 is a schematic structural diagram of an electronic device for implementing a training method of a document classification model according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a document classification model training program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, including flash memory, a mobile hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may in other embodiments also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of a document classification model training program, etc., but also for temporarily storing data that has been output or is to be output.
The processor 10 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device 1 and processes data by running or executing programs or modules (e.g., document classification model training programs, etc.) stored in the memory 11, and calling data stored in the memory 11.
The bus may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
Fig. 7 shows only an electronic device with components, it being understood by a person skilled in the art that the structure shown in fig. 7 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or may combine certain components, or may be arranged in different components.
For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for supplying power to each component, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described herein.
Further, the electronic device 1 may also comprise a network interface, optionally the network interface may comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the electronic device 1 and other electronic devices.
The electronic device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The document classification model training program stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
acquiring an original certificate image set, and executing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set;
Extracting pixel distribution information of each enhanced document image in the enhanced document image set, and generating a similar document image of the corresponding enhanced document image according to the pixel distribution information;
calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
And carrying out image classification prediction training on the pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set until the prediction training meets a second preset condition, and exiting the prediction training to obtain the trained certificate classification model.
Specifically, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
acquiring an original certificate image set, and executing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set;
Extracting pixel distribution information of each enhanced document image in the enhanced document image set, and generating a similar document image of the corresponding enhanced document image according to the pixel distribution information;
calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
And carrying out image classification prediction training on the pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set until the prediction training meets a second preset condition, and exiting the prediction training to obtain the trained certificate classification model.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A method for training a document classification model, the method comprising:
acquiring an original certificate image set, and executing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set;
Extracting pixel distribution information of each enhanced document image in the enhanced document image set, and generating a similar document image of the corresponding enhanced document image according to the pixel distribution information;
calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
And carrying out image classification prediction training on the pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set until the prediction training meets a second preset condition, and exiting the prediction training to obtain the trained certificate classification model.
2. The document classification model training method of claim 1, wherein the performing a data enhancement operation on the set of raw document images comprises:
Performing rotation operation on the original document image set according to a preset rotation angle to obtain a rotated image set;
Performing scaling operation on the original document image set according to a preset scaling scale to obtain a scaled image set;
Performing at least one noise enhancement operation of noise addition on the underlying document image set to obtain an enhanced noise image set;
And collecting the rotated image set, the zoomed image set and the enhanced noise image set to be an enhanced certificate image set.
3. The document classification model training method of claim 2, wherein performing at least one noise-added noise enhancement operation on the set of raw document images results in a set of enhanced noise images, comprising:
carrying out noise dyeing on each original document image in the original document image set to obtain a first noise-increased image set;
And carrying out local covering on each first noise-added image in the first noise-added image set to obtain an enhanced noise image set.
4. The document classification model training method of claim 1, wherein the generating a similar document image of the corresponding enhanced document image from the pixel distribution information comprises:
generating a model by utilizing the pre-constructed image, and generating an initial similar document image corresponding to each enhanced document image according to the pixel distribution information of each enhanced document image;
Calculating the difference degree between each initial similar document image and the corresponding enhanced document image, and counting the generation proportion between the number of the initial similar document images corresponding to the difference degree smaller than a preset difference threshold value and the number of all the initial similar document images;
When the generation ratio is smaller than a preset generation ratio threshold, parameters of the image generation model are adjusted, the image generation model is returned to the step of generating the corresponding initial similar document image of each enhanced document image according to the pixel distribution information of each enhanced document image until the generation ratio is larger than or equal to the preset generation ratio threshold;
and selecting an initial similar document image corresponding to the difference degree smaller than a preset difference threshold value from the difference degree as a similar document image.
5. The document classification model training method of claim 1, wherein said calculating the effective information content of each of said similar document images comprises:
counting the number of pixels of effective information contained in the similar document image and the total number of pixels in the similar document image;
and calculating the ratio between the number of pixels containing effective information in the similar document image and the total number of pixels in the similar document image, and taking the ratio as the effective information amount of each similar document image.
6. The document classification model training method of claim 5, wherein prior to counting the number of pixels of valid information contained in the similar document image, the method further comprises:
performing binarization processing on pixel points in each similar document image to obtain a gray value of each pixel point;
And taking the pixel point with the gray value larger than the preset pixel threshold value as the pixel point of the effective information.
7. The method of claim 1, wherein said performing predictive training of image classification of a pre-constructed document classification model using said set of raw document images, said set of enhanced document images, and said set of valid similar document images, until said predictive training meets a second predetermined condition, exiting said predictive training, and obtaining a trained document classification model, comprises:
Assigning the same number to each original document image, the corresponding enhanced document image and the corresponding effective similar document image in the original document image set, the enhanced document image set and the effective similar document image set;
carrying out image classification prediction training on a pre-constructed certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set to obtain a classification prediction result;
Counting the duty ratio between the number of images of the same classification result with the same number and the total amount of the images with the number in the classification prediction result, and averaging the duty ratios of all numbers to obtain an average duty ratio;
Judging whether the average occupation ratio meets a second preset condition or not;
If the average ratio does not meet the second preset condition, adjusting parameters of the pre-built certificate classification model, and returning to the step of performing image classification prediction training on the pre-built certificate classification model by using the original certificate image set, the enhanced certificate image set and the effective similar certificate image set;
And if the average occupation ratio meets the second preset condition, exiting the predictive training to obtain a trained certificate classification model.
8. A document classification model training apparatus, the apparatus comprising:
the enhancement sample generation module is used for acquiring an original certificate image set, and executing data enhancement operation on the original certificate image set to obtain an enhanced certificate image set;
The effective similar sample generation module is used for extracting pixel distribution information of each enhanced document image in the enhanced document image set and generating a similar document image of the corresponding enhanced document image according to the pixel distribution information; calculating the effective information quantity of each similar document image, and selecting similar document images with the effective information quantity meeting a first preset condition to form an effective similar document image set;
And the classification model training module is used for carrying out prediction training of image classification on the pre-constructed certificate classification model by utilizing the original certificate image set, the enhanced certificate image set and the effective similar certificate image set until the prediction training meets a second preset condition, exiting the prediction training, and obtaining the trained certificate classification model.
9. An electronic device, the electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the document classification model training method of any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program which when executed by a processor implements a document classification model training method according to any one of claims 1 to 7.
CN202111219802.8A 2021-10-20 Certificate classification model training method and device, electronic equipment and storage medium Active CN113989548B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111219802.8A CN113989548B (en) 2021-10-20 Certificate classification model training method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111219802.8A CN113989548B (en) 2021-10-20 Certificate classification model training method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113989548A CN113989548A (en) 2022-01-28
CN113989548B true CN113989548B (en) 2024-07-02

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090465A (en) * 2017-12-29 2018-05-29 国信优易数据有限公司 A kind of dressing effect process model training method and dressing effect processing method
CA3070817A1 (en) * 2020-01-31 2021-07-31 Element Ai Inc. Method of and system for joint data augmentation and classification learning

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090465A (en) * 2017-12-29 2018-05-29 国信优易数据有限公司 A kind of dressing effect process model training method and dressing effect processing method
CA3070817A1 (en) * 2020-01-31 2021-07-31 Element Ai Inc. Method of and system for joint data augmentation and classification learning

Similar Documents

Publication Publication Date Title
CN113283446B (en) Method and device for identifying object in image, electronic equipment and storage medium
CN111898538B (en) Certificate authentication method and device, electronic equipment and storage medium
CN112507934B (en) Living body detection method, living body detection device, electronic equipment and storage medium
CN112507922A (en) Face living body detection method and device, electronic equipment and storage medium
CN112651342B (en) Face recognition method and device, electronic equipment and storage medium
CN113887438B (en) Watermark detection method, device, equipment and medium for face image
CN112668575B (en) Key information extraction method and device, electronic equipment and storage medium
CN110795714A (en) Identity authentication method and device, computer equipment and storage medium
CN108648189A (en) Image fuzzy detection method, apparatus, computing device and readable storage medium storing program for executing
CN115471775A (en) Information verification method, device and equipment based on screen recording video and storage medium
CN112862703B (en) Image correction method and device based on mobile photographing, electronic equipment and medium
CN113705469A (en) Face recognition method and device, electronic equipment and computer readable storage medium
CN115439850B (en) Method, device, equipment and storage medium for identifying image-text characters based on examination sheets
CN112883346A (en) Safety identity authentication method, device, equipment and medium based on composite data
CN113989548B (en) Certificate classification model training method and device, electronic equipment and storage medium
CN113255456B (en) Inactive living body detection method, inactive living body detection device, electronic equipment and storage medium
CN113887408B (en) Method, device, equipment and storage medium for detecting activated face video
CN113705686B (en) Image classification method, device, electronic equipment and readable storage medium
CN113792801B (en) Method, device, equipment and storage medium for detecting face dazzling degree
CN112233194B (en) Medical picture optimization method, device, equipment and computer readable storage medium
CN113989548A (en) Certificate classification model training method and device, electronic equipment and storage medium
CN114118412A (en) Method, system, device and medium for certificate recognition model training and certificate recognition
CN114049676A (en) Fatigue state detection method, device, equipment and storage medium
CN113920590A (en) Living body detection method, living body detection device, living body detection equipment and readable storage medium
CN112183520A (en) Intelligent data information processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant