Method and device for acquiring scanned file image, storage medium and electronic device

By generating an adversarial neural network and multi-expert sub-content-aware network structure, the problem of poor repair quality of scanned files is solved, the accuracy of character recognition is improved, and the better repair effect of scanned files is achieved.

CN119276994APending Publication Date: 2025-01-07HUANENG MANZHOULI WIND POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411344914.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing image repair technology has poor quality in image repair of scanned files, making it difficult to effectively improve the accuracy of character recognition, especially the high requirements for unclear text repair, and the existing models have poor generalization in file scanning images.

Method used

Using a method based on the generation and adversarial neural network, through training generators and discriminators, using multi-expert content-aware network structure, automatically divide the image content information of the scanned file pictures into different categories, improve the understanding of image content, and achieve more Good scan file image repair.

Benefits of technology

It improves the repair quality of scanned file images, enhances the accuracy of character recognition, and solves the problem of poor repair quality of scanned file images by image repair technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276994A_ABST
    Figure CN119276994A_ABST
Patent Text Reader

Abstract

The invention discloses a scanned file image obtaining method and device, a storage medium and an electronic device.The method comprises the steps that a first scanned file image is obtained, the first scanned file image is an image obtained by scanning a paper file, and the text information density of the paper file is higher than a preset threshold value; the first scanning file image is input into a first generator to obtain a second scanning file image, and the quality of the second scanning file image is higher than that of the first scanning file image. The problem that the repairing quality of the scanned file image is poor by an image repairing technology is solved, and the technical effect of improving the repairing quality of the scanned file image is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and device for acquiring a scanned document image, a storage medium, and an electronic device. Background Art

[0002] Checking, evaluating, and analyzing the numerous paper documents in a project is an important part of post-project evaluation. Manual review of these documents is obviously a huge workload and inefficient. One way to greatly improve work efficiency is to digitize paper documents in an automated way, so that more advanced technologies can be used to understand the content of the documents, extract knowledge, and achieve structured management of the documents.

[0003] However, the scanned images obtained by document scanning often have problems such as low image contrast, tilted and blurred text, stains and damage, which will affect the accuracy of character recognition.

[0004] In order to improve the accuracy of character recognition, in addition to improving character recognition technology, another solution is to repair the scanned document images, and improve the accuracy of character recognition by improving the quality of the scanned document images. With the development of artificial intelligence, image processing methods based on deep learning are a very good method to improve the quality of scanned document images. However, there are some limitations in the direct application of existing image super-resolution, image restoration and other related technologies in the field of computer vision to the repair of scanned document images: on the one hand, the existing trained models are based on a large number of daily pictures, and it is difficult to maintain good generalization on the scanned document images; on the other hand, scanning document images requires a large amount of unclear text to be repaired, which has higher requirements for understanding the image content than the traditional image repair tasks in the field of computer vision. Therefore, in the related technologies, there is a problem of poor repair quality of scanned document images by image repair technology.

[0005] In the related art, there is no effective solution to the problem that the image restoration technology has poor restoration quality for scanned document images. Summary of the invention

[0006] The embodiments of the present application provide a method and device for acquiring a scanned document image, a storage medium, and an electronic device, so as to at least solve the problem of poor restoration quality of scanned document images by image restoration technology in the related art.

[0007] According to an embodiment of the embodiments of the present application, a method for obtaining a scanned document image is provided, comprising: obtaining a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold; inputting the first scanned document image into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

[0008] In an exemplary embodiment, before inputting the first scanned document image into the first generator to obtain the second scanned document image, the method further includes: acquiring a third scanned document image, wherein the third scanned document image includes: a fourth scanned document image having a quality similar to that of the first scanned document, and a fifth scanned document image having a quality similar to that of the second scanned document image; and training a preset model through the third scanned document image input to obtain the first generator.

[0009] In an exemplary embodiment, training a preset model through the third scanned document image input to obtain the first generator includes: inputting the fourth scanned document image into a second generator included in the preset model to obtain a sixth scanned document image, wherein the sixth scanned document image is a restored image of the fourth scanned document image; and training the preset model through the sixth scanned document image and the fifth scanned document image to obtain the first generator.

[0010] In an exemplary embodiment, before inputting the fourth scanned document image into the second generator included in the preset model to obtain the sixth scanned document image, the method further includes: determining a generator architecture of the second generator, wherein the generator architecture includes: L up-convolution blocks, M convolution blocks, and N deconvolution blocks connected in series in sequence, wherein L, M, and N are all positive integers.

[0011] In an exemplary embodiment, the preset model is trained by the sixth scanned document image and the fifth scanned document image to obtain the first generator, comprising: inputting the seventh scanned document image into a discriminator in the preset model to obtain an output result of the discriminator, wherein the discriminator is respectively connected to a data input interface of the preset model and the second generator; wherein the seventh scanned document image comprises at least one of the following: the sixth scanned document image and the fifth scanned document image; and the preset model is trained by the output result to obtain the first generator.

[0012] In an exemplary embodiment, the seventh scanned document image is input into the discriminator in the preset model to obtain the output result of the discriminator, including: determining the feature representation matrix of the seventh scanned document image through the discriminator; splitting the feature representation matrix according to the channels of the feature representation matrix to obtain multiple feature maps corresponding to the channels respectively; determining the classification results of the multiple feature maps through multiple expert perception networks in the discriminator; and determining the output result through the multiple classification results.

[0013] In an exemplary embodiment, the preset model is trained with the output result to obtain the first generator, including: inputting the output result into a loss function to obtain a loss value of the output result; training the preset model with the loss value to obtain the first generator, wherein the first generator is the trained second generator.

[0014] According to another embodiment of the embodiments of the present application, a device for acquiring a scanned document image is also provided, including: a first acquisition module, used to acquire a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold; a second acquisition module, used to input the first scanned document image into a first generator to acquire a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

[0015] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above method when running.

[0016] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method through the computer program.

[0017] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0018] In an embodiment of the present application, a first scanned document image is obtained, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold; the first scanned document image is input into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image. Through the above embodiment, the problem of poor restoration quality of scanned document images by image restoration technology in the related art is solved, and the technical effect of improving the restoration quality of scanned document images is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for acquiring a scanned document image according to an embodiment of the present application;

[0021] Figure 2 is a flow chart of a method for acquiring a scanned document image according to an embodiment of the present application;

[0022] Figure 3 is a model architecture diagram of a method for acquiring a scanned document image according to an embodiment of the present application;

[0023] Figure 4 is a generator architecture diagram of a method for acquiring a scanned document image according to an embodiment of the present application;

[0024] Figure 5 is a diagram of a discriminator architecture of a method for acquiring a scanned document image according to an embodiment of the present application;

[0025] Figure 6 It is a structural block diagram of a device for acquiring a scanned document image according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices; "plurality" means two or more.

[0028] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or similar computing device or cloud platform or independent physical server or software platform, wherein the above software platform is run through one or more servers. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal for a method for acquiring a scanned document image according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. A person skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the methods in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, the above-mentioned methods are implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, a method for acquiring a scanned document image is provided, which is applied to the above-mentioned computer terminal. Figure 2 : is a flowchart of a method for obtaining a scanned document image according to an embodiment of the present application, the process comprising the following steps:

[0032] Step S202, obtaining a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold;

[0033] Step S204: input the first scanned document image into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

[0034] Through the above steps, a first scanned document image is obtained, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold; the first scanned document image is input into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image. Through the above embodiments, the problem of poor restoration quality of scanned document images by image restoration technology in the related art is solved, and the technical effect of improving the restoration quality of scanned document images is achieved.

[0035] In an exemplary embodiment, before inputting the first scanned document image into the first generator to obtain the second scanned document image, the method further includes: acquiring a third scanned document image, wherein the third scanned document image includes: a fourth scanned document image having a quality similar to that of the first scanned document, and a fifth scanned document image having a quality similar to that of the second scanned document image; and training a preset model through the third scanned document image input to obtain the first generator.

[0036] Furthermore, the preset model is trained by inputting the third scanned document image to obtain the first generator, including: inputting the fourth scanned document image into the second generator included in the preset model to obtain a sixth scanned document image, wherein the sixth scanned document image is a restored image of the fourth scanned document image; and the preset model is trained by the sixth scanned document image and the fifth scanned document image to obtain the first generator.

[0037] Optionally, the preset model uses an adversarial neural network, and the preset model architecture is as follows Figure 3 As shown, it includes: a second generator (corresponding to Figure 3 The specific training process of this preset model includes:

[0038] Step 31: Acquire a third scanned document image, the third scanned document image comprising: a fourth scanned document image (equivalent to Figure 3 a low-quality document scan image in the example above), and a fifth scanned document image having a quality similar to that of the second scanned document image (equivalent to Figure 3 High-quality document scan images in );

[0039] Step 32: Input the fourth scanned document image in the third scanned document image into the second generator to obtain the sixth scanned document image generated by the second generator (equivalent to Figure 3 Scan and repair images in the file);

[0040] Step 33: Input the sixth document scan image and the fifth document scan image into the discriminator, calculate the loss value, and update the preset model by the loss value to complete a training of the preset model. It should be noted that there is no correlation between the time when the sixth and fifth document scan images are input into the discriminator.

[0041] In an exemplary embodiment, before inputting the fourth scanned document image into the second generator included in the preset model to obtain the sixth scanned document image, the method further includes: determining a generator architecture of the second generator, wherein the generator architecture includes: L up-convolution blocks, M convolution blocks, and N deconvolution blocks connected in series in sequence, wherein L, M, and N are all positive integers.

[0042] Optional, such as Figure 4 As shown, the architecture of the second generator used in the embodiment of the present application is: 3 up-convolution blocks, 4 convolution blocks, and 3 deconvolution blocks connected in series in sequence.

[0043] More specifically, each upconvolution block includes a convolution layer, an activation function, and a pooling layer connected in series; each convolution block includes a convolution layer and an activation function connected in series; each deconvolution block includes a bilinear upsampling layer, a deconvolution layer, and an activation function connected in series.

[0044] In an exemplary embodiment, the preset model is trained by the sixth scanned document image and the fifth scanned document image to obtain the first generator, comprising: inputting the seventh scanned document image into a discriminator in the preset model to obtain an output result of the discriminator, wherein the discriminator is respectively connected to a data input interface of the preset model and the second generator; wherein the seventh scanned document image comprises at least one of the following: the sixth scanned document image and the fifth scanned document image; and the preset model is trained by the output result to obtain the first generator.

[0045] The third scanned document image is input into the preset model through the data input interface. Specifically, the fourth scanned document image is input into the second generator through the data input interface. The fifth scanned document image is input into the discriminator through the data input interface.

[0046] In an exemplary embodiment, the seventh scanned document image is input into the discriminator in the preset model to obtain the output result of the discriminator, including: determining the feature representation matrix of the seventh scanned document image through the discriminator; splitting the feature representation matrix according to the channels of the feature representation matrix to obtain multiple feature maps corresponding to the channels respectively; determining the classification results of the multiple feature maps through multiple expert perception networks in the discriminator; and determining the output result through the multiple classification results.

[0047] Optionally, the architecture of the discriminator in the embodiment of the present application is as follows: Figure 5 As shown, it includes: a ResNet layer, a hybrid multi-expert perception module connected in series with the ResNet layer, and a post-fusion layer connected in series with the hybrid multi-expert perception module; wherein the hybrid multi-expert perception module includes a channel splitting layer and multiple expert perception networks connected to the channel splitting layer respectively. Optionally, multiple classification results are fused through the post-fusion layer to obtain an output result.

[0048] In an exemplary embodiment, the preset model is trained with the output result to obtain the first generator, including: inputting the output result into a loss function to obtain a loss value of the output result; training the preset model with the loss value to obtain the first generator, wherein the first generator is the trained second generator.

[0049] Optionally, the loss function can be chosen to be a cross entropy loss function.

[0050] In order to better understand the process of the above-mentioned method for acquiring the scanned document image, the above-mentioned method for acquiring the scanned document image is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0051] An optional embodiment of the present application proposes a document scan image repair method based on a generative adversarial neural network (equivalent to the method for obtaining the scanned document image in the above facts). The method designs a multi-expert content-aware neural network structure, which automatically divides the image content information of the scanned document image into different categories of features through the model, and assigns different categories of features to different "experts" for content perception and information learning, so as to achieve a deeper understanding of the image content, thereby achieving better scanned document image repair.

[0052] The overall architecture of a document scanning image restoration method based on a generative adversarial neural network proposed in an optional embodiment of the present application is as follows: Figure 3 As shown in the figure, the core of the architecture consists of a generator (i.e., the second generator) and a discriminator: the generator is responsible for reconstructing the low-quality document scan image and generating a repaired image of the original document scan image (equivalent to Figure 3 The discriminator is responsible for determining whether the input image is a true high-quality document scan image or a repaired image generated from a low-quality document scan image (equivalent to Figure 3 The training goal of the entire architecture is to enable the generator to better repair low-quality document scan images, making it difficult for the discriminator to distinguish between the generated repair images and high-quality document scan images. The architectures of the generator and the discriminator are as follows: Figure 4 and Figure 5 As shown. The generator part of this application adopts a network architecture similar to U-Net; in the discriminator part, this application designs a multi-expert content-aware neural network structure to improve the discriminator's ability to distinguish between the repaired image and the original high-quality image, thereby improving the generator's image restoration ability. The details of the generator and the discriminator and the loss function design are described in detail below.

[0053] (1) Generator:

[0054] The generator uses a network architecture similar to U-Net, which consists of a series of up-convolution blocks, convolution blocks, and deconvolution blocks. Figure 4 As shown, each upconvolution block is composed of a neural network of "convolution (i.e., convolution layer)-activation function-pooling (i.e., pooling layer)", each convolution block is composed of a neural network of "convolution-activation function", and each deconvolution block is composed of a neural network of "bilinear upsampling (layer)-deconvolution (layer)-activation function".

[0055] (2) Discriminator:

[0056] In the discriminator part, the optional embodiment of the present application designs a multi-expert content-aware neural network structure. First, the feature representation matrix of the input image is obtained through ResNet (layer). Without loss of generality, the feature representation matrix can be expressed as F∈R C×H×W , where C, H, W represent the number of channels, feature map height, and feature map width, respectively, and R represents a set of real numbers.

[0057] Then, the optional embodiment of the present application designs and constructs a hybrid multi-expert perception module. Since different channels can usually represent different image features, the module splits the feature representation matrix F by channel, and then sends the feature map corresponding to each channel to an expert perception network to finely learn the recognition result corresponding to the feature (i.e., F = [f1, f2, ..., f C ], f i ∈F is input into the corresponding i-th expert perception network). Each expert perception network first passes through an orthogonal convolution layer and activation function ReLU to extract the feature map f of the channel i Maximize with other feature maps f j (i≠j) independent features. Then, through the neural network structure of convolution-batch normalization-activation function ReLU-residual connection-convolution-batch normalization-activation function ReLU-adaptive pooling-linear classifier, the expert perception network can perceive and learn the mapping relationship between the feature and the corresponding recognition result, and obtain the classification result.

[0058] Each expert perception network can obtain the classification result of the corresponding feature map. Since there are C channels, C classification results will be obtained, which can be expressed as O = [o1, o2, ..., o C ]. Through the post-fusion module, the C classification results are fused to obtain the final output result of the discriminator. The formula is as follows:

[0059] A = Softmax(WO+b);

[0060] RO = Softmax(W(O×A)+b);

[0061] Among them, W and b are training parameters, RO is the final output result, indicating whether the input image is a repaired image generated by the generator, and A represents the weight of each output result.

[0062] (3) Loss function:

[0063] The training goal of the entire architecture is to enable the generator to better repair low-quality document scan images, making it difficult for the discriminator to distinguish between the generated repaired images and high-quality document scan images. The output result RO of the discriminator is provided to the loss function. The loss function is expressed as follows:

[0064]

[0065] Among them, G represents the generator, D represents the discriminator, CrossEntropy(D,G) is the difference between the repaired image and the real high-quality scanned document image expressed by the cross entropy loss function, x~P highquality (x) represents a real high-quality document scan image, z~P repaired (z) represents a low-quality document scan image.

[0066] When the training of the entire architecture is stable, the generator (i.e., the first generator) can be used to take the low-quality document scan image (i.e., the first scanned document image) as input and output the repaired document scan image (i.e., the second scanned document image).

[0067] In summary, the optional embodiment of the present application proposes a document scan image restoration method based on a generative adversarial neural network. The method designs a multi-expert content-aware GAN framework, which automatically divides the image content information of the scanned document image into different categories of features through the model, and assigns different categories of features to different "experts" for content perception and information learning, so as to achieve a deeper understanding of the image content, thereby achieving better scanned document image restoration.

[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0069] The present application also provides a structural block diagram of a device for acquiring a scanned document image. Figure 6 is a structural block diagram of a device for acquiring a scanned document image according to an embodiment of the present application; Figure 6 As shown, including:

[0070] A first acquisition module 62, configured to acquire a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold;

[0071] The second acquisition module 64 is used to input the first scanned document image into the first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

[0072] Through the above device, a first scanned document image is obtained, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold; the first scanned document image is input into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image. Through the above embodiment, the problem of poor restoration quality of scanned document images by image restoration technology in the related art is solved, and the technical effect of improving the restoration quality of scanned document images is achieved.

[0073] In an exemplary embodiment, before inputting the first scanned document image into the first generator to obtain the second scanned document image, the device further includes a training module for: acquiring a third scanned document image, wherein the third scanned document image includes: a fourth scanned document image having a quality similar to that of the first scanned document image, and a fifth scanned document image having a quality similar to that of the second scanned document image; and training a preset model through the third scanned document image input to obtain the first generator.

[0074] In an exemplary embodiment, the training module is further used to: input the fourth scanned document image into the second generator included in the preset model to obtain a sixth scanned document image, wherein the sixth scanned document image is a restored image of the fourth scanned document image; and train the preset model through the sixth scanned document image and the fifth scanned document image to obtain the first generator.

[0075] In an exemplary embodiment, the training module is also used to: determine the generator architecture of the second generator, wherein the generator architecture includes: L up-convolution blocks, M convolution blocks, and N deconvolution blocks connected in series in sequence, wherein L, M, and N are all positive integers.

[0076] In an exemplary embodiment, the training module is further used to: input the seventh scanned document image into the discriminator in the preset model to obtain an output result of the discriminator, wherein the discriminator is respectively connected to the data input interface of the preset model and the second generator; wherein the seventh scanned document image includes at least one of the following: the sixth scanned document image and the fifth scanned document image; and the preset model is trained through the output result to obtain the first generator.

[0077] In an exemplary embodiment, the training module is also used to: determine the feature representation matrix of the seventh scanned document image through the discriminator; split the feature representation matrix according to the channels of the feature representation matrix to obtain multiple feature maps corresponding to the channels; determine the classification results of the multiple feature maps through multiple expert perception networks in the discriminator; and determine the output result through the multiple classification results.

[0078] In an exemplary embodiment, the training module is also used to: input the output result into a loss function to obtain a loss value of the output result; train the preset model through the loss value to obtain the first generator, wherein the first generator is the trained second generator.

[0079] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0080] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0081] S1, obtaining a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold;

[0082] S2, inputting the first scanned document image into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

[0083] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0084] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0085] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0086] S1, obtaining a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold;

[0087] S2, inputting the first scanned document image into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

[0088] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0089] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0090] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0091] An embodiment of the present application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0092] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0093] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0094] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for acquiring a scanned document image, characterized in that: include: Acquire a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold; The first scanned document image is input into a first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

2. The method for acquiring a scanned document image according to claim 1, characterized in that: Before inputting the first scanned document image into the first generator to obtain the second scanned document image, the method further includes: Acquire a third scanned document image, wherein the third scanned document image includes: a fourth scanned document image having a quality similar to that of the first scanned document image, and a fifth scanned document image having a quality similar to that of the second scanned document image; The preset model is trained through the third scanned document image input to obtain the first generator.

3. The method for acquiring a scanned document image according to claim 2, characterized in that: The preset model is trained by inputting the third scanned document image to obtain the first generator, including: Inputting the fourth scanned document image into the second generator included in the preset model to obtain a sixth scanned document image, wherein the sixth scanned document image is a restored image of the fourth scanned document image; The preset model is trained using the sixth scanned document image and the fifth scanned document image to obtain the first generator.

4. The method for acquiring a scanned document image according to claim 3, characterized in that: Before inputting the fourth scanned document image into the second generator included in the preset model to obtain the sixth scanned document image, the method further includes: Determine a generator architecture of the second generator, wherein the generator architecture includes: L up-convolution blocks, M convolution blocks, and N deconvolution blocks connected in series in sequence, wherein L, M, and N are all positive integers.

5. The method for acquiring a scanned document image according to claim 3, characterized in that: The preset model is trained by using the sixth scanned document image and the fifth scanned document image to obtain the first generator, including: Inputting the seventh scanned document image into the discriminator in the preset model to obtain an output result of the discriminator, wherein the discriminator is connected to the data input interface of the preset model and the second generator respectively; wherein the seventh scanned document image includes at least one of the following: the sixth scanned document image and the fifth scanned document image; The preset model is trained using the output result to obtain the first generator.

6. The method for acquiring a scanned document image according to claim 5, characterized in that: Inputting the seventh scanned document image into the discriminator in the preset model to obtain an output result of the discriminator includes: Determining a feature representation matrix of the seventh scanned document image by the discriminator; Splitting the feature characterization matrix according to the channels of the feature characterization matrix to obtain feature graphs corresponding to a plurality of the channels respectively; Determining classification results of the plurality of feature maps through a plurality of expert perception networks in the discriminator; The output result is determined by a plurality of the classification results.

7. The method for acquiring a scanned document image according to claim 5, characterized in that: The preset model is trained by the output result to obtain the first generator, including: The output result is input into a loss function to obtain a loss value of the output result; the preset model is trained using the loss value to obtain the first generator, wherein the first generator is the trained second generator.

8. A device for acquiring a scanned document image, characterized in that: include: A first acquisition module, configured to acquire a first scanned document image, wherein the first scanned document image is an image obtained by scanning a paper document, and the text information density of the paper document is higher than a preset threshold; The second acquisition module is used to input the first scanned document image into the first generator to obtain a second scanned document image, wherein the quality of the second scanned document image is higher than the quality of the first scanned document image.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.