Paper document scanning and filing method and device, electronic equipment and storage medium
The noise point recognition model processes the scanned images of paper documents, generates target mask images, and extracts text content, solving the problem of inaccurate information recognition caused by complex backgrounds in paper documents, and achieving efficient text recognition and archiving.
Patent Information
- Application Number
- CN202510715577.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-02
AI Technical Summary
The prior art cannot effectively deal with inaccurate information identification problems caused by poor quality and complex backgrounds in paper documents, especially blurred bill images, distorted, uneven lighting and complex backgrounds, stains, handwriting traces, etc., which affect the accuracy of text recognition.
The noise point recognition model is adopted, including a false positive noise point recognition module and a feature recognition module, and the noise point obscuring operation is performed on the scanned image, a target mask image is generated, and the target content of the paper document is extracted and archived through the feature recognition module.
It improves the accuracy of text recognition, ensures the completeness and efficiency of information recognition, and solves the inaccuracy problem of scanning and archiving paper documents in complex backgrounds.
Smart Images

Figure CN120580698A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for scanning and archiving paper documents. Background Art
[0002] Machine vision recognition technology has been applied in many business scenarios, significantly improving processing efficiency. However, traditional bill scanning still faces challenges. For example, customer-provided bill images may be of poor quality. These issues include, but are not limited to, blurry, distorted, and uneven lighting. Complex backgrounds, stains, and handwritten marks on bills can lead to inaccurate recognition, impacting subsequent text recognition accuracy.
[0003] To extract information from paper documents, we can currently scan customer documents into images and convert them into fixed-format pictures, use DBnet to perform text recognition on the images, and extract content on demand based on keywords. However, this method is only applicable to pure document scanning. Alternatively, we can scan paper documents to the server, pre-process the images, and use OCR technology to perform character recognition and verify the document content. However, none of the above solutions can handle images with complex backgrounds, resulting in the problem of not being able to extract complete and accurate information. Summary of the Invention
[0004] The present invention provides a method, device, electronic device and storage medium for scanning and filing paper documents, so as to solve the problem of inaccurate scanning and filing of paper documents.
[0005] According to one aspect of the present invention, a method for scanning and archiving paper documents is provided, comprising:
[0006] Obtaining a scanned image corresponding to a paper document;
[0007] The scanned image is input into a pre-trained noise point recognition model to perform noise point concealment operations, thereby obtaining a target mask image of the text content in the paper document. The noise point recognition model includes a false positive noise point recognition module and a feature recognition module. The false positive noise point recognition module is used to generate a background noise image corresponding to the scanned image, and the feature recognition module is used to perform feature processing on the background noise image and the scanned image.
[0008] By performing content extraction processing on the target mask image, the target content of the paper document is obtained and archived, wherein the format of the target content is the same as the format of the text content contained in the paper document.
[0009] Optionally, the scanned image is input into a pre-trained noise point recognition model to perform a noise point concealment operation to obtain a target mask image of the text content in the paper document, including: identifying noise points in the scanned image based on a false positive noise point recognition module in the noise point recognition model to obtain a background noise image; splicing the background noise image and the scanned image to obtain an image to be feature extracted to be input into a feature recognition module; and performing feature extraction processing on the image to be feature extracted by the feature recognition module to obtain a target mask image.
[0010] Optionally, the method also includes: determining multiple training samples, wherein the training samples include a sample scan image, a content annotation mask image corresponding to the sample scan image, and a binarized mask image of the sample scan image; wherein the binarized value in the binarized mask image is determined by analyzing the sample scan image; for multiple training samples, inputting the sample scan image in the training sample into the noise point recognition model to be trained, so as to process the sample scan image based on the false positive noise point recognition module in the noise point recognition model to obtain a first mask image, and processing the first mask image and the sample scan image based on the feature recognition module to obtain a predicted mask image; determining a first loss value for loss processing of the false positive noise point recognition module and a second loss value for loss processing of the feature recognition module based on the predicted mask image, the first mask image, the content annotation mask image and the binarized mask image; the noise point recognition model to be trained obtained when the target loss function in the noise point recognition model to be trained is used as the noise point recognition model; wherein the target loss function includes the first loss function of the false positive noise point recognition module and the second loss function of the feature recognition module.
[0011] Optionally, a first loss value for loss processing of a false positive noise point recognition module and a second loss value for loss processing of a feature recognition module are determined based on the predicted mask image, the first mask image, the content annotation mask image and the binarized mask image, including: determining a pseudo false positive mask image based on the content annotation mask image and the binarized mask image; determining a first loss value based on the pseudo false positive mask image, the first mask image and the first loss function of the false positive noise point recognition module; and determining a second loss value based on the content annotation mask image, the predicted mask image and the second loss function of the feature recognition module.
[0012] Optionally, a first loss value is determined based on the pseudo false positive mask image, the first mask image, and the first loss function of the false positive noise point recognition module, including: determining the second mask image based on the binary mask image and the content annotation mask image corresponding to the pseudo false positive mask image; determining the third mask information based on the pseudo false positive mask image, the content annotation mask image, and the second mask image; substituting the first mask information and the third mask image into the first loss function to determine the first loss value.
[0013] Optionally, the false positive noise point identification module includes, in sequence according to the input-output relationship: a first encoding module, a first bottleneck network layer, and a first decoding module, and the first encoding module and the first decoding module are symmetrical with respect to the first bottleneck network layer; in sequence according to the input-output relationship, the first encoding module includes, in sequence, a first feature extraction layer, a first downsampling layer, a second feature extraction layer, a second downsampling layer, a third feature extraction layer, a third downsampling layer, a fourth feature extraction layer, and a fourth downsampling layer, and the depth value of the feature extraction layer increases in sequence according to the input-output relationship; in sequence according to the input-output relationship, the first decoding module includes, in sequence, a first upsampling layer, a fifth feature extraction layer, a second upsampling layer, a , the sixth feature extraction layer, the third upsampling layer, the seventh feature extraction layer, the fourth upsampling layer and the eighth feature extraction layer, the depth value of the feature extraction layer decreases in sequence according to the input-output relationship; wherein, the output result of the third feature extraction layer is processed by the first convolution to obtain a first input data to be input to the fifth feature extraction layer, and the first input data and the output result of the first upsampling are input to the fifth feature extraction layer after residual processing; the output result of the fourth feature extraction layer is processed by the second convolution to obtain a second input data to be input to the sixth feature extraction layer, and the second input data and the output result of the second upsampling are input to the sixth feature extraction layer after residual processing.
[0014] Optionally, the feature recognition module includes: a second encoding module, a second bottleneck network layer and a second decoding module, the second encoding module and the second decoding module have a symmetrical structure relative to the second bottleneck network layer, the second encoding block includes multiple encoding layers, the second decoding module includes multiple decoding layers, and the number of encoding layers and decoding layers is the same; wherein, the third output result of the target encoding layer in the symmetrical structure is the third input data of the target decoding layer, and the third input data and the fourth output result of the previous decoding layer of the target decoding layer are input to the target decoding layer after residual processing, and the hierarchical structures in the target encoding layer and the target decoding layer are different.
[0015] According to another aspect of the present invention, there is provided a device for scanning and filing paper documents, comprising:
[0016] An image acquisition module, used to acquire a scanned image corresponding to a paper document;
[0017] A target mask image determination module is configured to input the scanned image into a pre-trained noise point recognition model to perform noise point concealment operations, thereby obtaining a target mask image of the text content in the paper document. The noise point recognition model includes a false positive noise point recognition module and a feature recognition module. The false positive noise point recognition module is configured to generate a background noise image corresponding to the scanned image, and the feature recognition module is configured to perform feature processing on the background noise image and the scanned image.
[0018] The target content archiving process is used to obtain the target content of the paper document and archive it by performing content extraction on the target mask image, wherein the format of the target content is the same as the format of the text content contained in the paper document.
[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0020] at least one processor; and
[0021] a memory communicatively connected to at least one processor; wherein,
[0022] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the method for scanning and archiving paper documents according to any embodiment of the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the method for scanning and archiving paper documents according to any embodiment of the present invention when executed.
[0024] The technical solution of the embodiment of the present invention obtains a scanned image corresponding to a paper document; inputs the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation, thereby obtaining a target mask image of the text content in the paper document; wherein the noise point recognition model includes a false positive noise point recognition module and a feature recognition module, the false positive noise point recognition module is used to generate a background noise image corresponding to the scanned image, and the feature recognition module is used to perform feature processing on the background noise image and the scanned image; the false positive noise point recognition module and the feature recognition module in the noise point recognition model are used to process the scanned image to determine false positive noise points in the scanned image to obtain a background noise image; the feature recognition module is used to distinguish foreground data and background data in the scanned image to highlight the text content in the image, thereby helping to improve the accuracy of text recognition; and by performing content extraction processing on the target mask image, the target content of the paper document is obtained and archived, wherein the format of the target content is the same as the format of the text content contained in the paper document, thereby achieving content recognition of the target mask image and archiving of the recognized content, thereby improving the efficiency of recognition and archiving of paper documents. This solution realizes the processing of scanned images, performs noise point concealment on the scanned images through a noise point recognition model to highlight the document content in the scanned images, performs feature recognition on the document content to obtain a target mask image, and then performs content recognition and archiving on the target mask image, thereby improving the efficiency of identifying and archiving paper documents, solving the problem of inaccurate information recognition caused by poor image quality and complex background problems, and improving the efficient processing of scanned images and the integrity and efficiency of scanning and archiving of paper documents.
[0025] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 This is a flow chart of a method for scanning and archiving paper documents provided in the first embodiment of the present invention;
[0028] Figure 2 Schematic diagram of a noise point recognition model applicable to an embodiment of the present invention;
[0029] Figure 3 2 is a schematic structural diagram of a false positive noise point identification module applicable to an embodiment of the present invention;
[0030] Figure 4 Schematic diagram of the structure of a feature recognition module applicable to an embodiment of the present invention;
[0031] Figure 5 This is a flow chart of a method for scanning and archiving paper documents provided in the second embodiment of the present invention;
[0032] Figure 6 This is a schematic structural diagram of a paper document scanning and archiving device provided in a third embodiment of the present invention;
[0033] Figure 7 The figure is a schematic structural diagram of an electronic device for implementing the method for scanning and filing paper documents according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention 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 numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] Example 1
[0037] Figure 1 This is a flow chart of a method for scanning and filing paper documents provided in the first embodiment of the present invention. This embodiment is applicable to situations where paper documents are scanned and filed. The method can be executed by a scanning and filing device for paper documents. The scanning and filing device for paper documents can be implemented in the form of hardware and / or software. The scanning and filing device for paper documents can be configured in electronic devices such as servers and computers. Figure 1 As shown, the method includes:
[0038] S110: Obtain a scanned image corresponding to the paper document.
[0039] In this embodiment, a paper document specifically refers to a document completed by a user based on business needs. This can include bills and application documents completed by users in banking scenarios, or paper materials completed by users in government business scenarios, without limitation. A scanned image specifically refers to an image obtained by scanning a paper document using a scanning device. The scanned image is uploaded to a data processing terminal for processing to obtain the content within the scanned image. Optionally, the corresponding scanned images can be categorized and stored based on business needs to facilitate management of the scanned images corresponding to the paper documents.
[0040] Specifically, when archiving paper documents filled out by users, the paper documents filled out by users can be scanned by the scanning module of the smart terminal device to obtain a scanned image of the paper document, and the obtained scanned image can be transmitted to the data processing end for processing the scanned image.
[0041] S120: Input the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation, and obtain a target mask image of the text content in the paper document.
[0042] The noise point recognition model includes a false positive noise point recognition module and a feature recognition module. The false positive noise point recognition module is used to generate a background noise image corresponding to the scanned image, and the feature recognition module is used to perform feature processing on the background noise image and the scanned image. The background noise image can be specifically understood as a high-resolution feature map containing complex background information. Specifically, it is an image formed by non-document content interference pixels generated during the scanning process. Non-document content interference pixels include but are not limited to paper texture, stains, and scanning device noise. In other words, the background noise image includes false positive pixels that are easily misjudged as text. It should be noted that background pixels recognized in addition to text content in the scanned image can be called false positive pixels. It is understandable that in the case of insufficient lighting and the presence of stains and handwriting on paper documents, the scanned image obtained will have a relatively complex background, which will affect the integrity and accuracy of the information extracted from the scanned image. The target mask image specifically refers to the digitized image generated after processing the scanned image, accurately marking or extracting the text content area in the original scanned image and hiding irrelevant noise such as paper texture and stains. For example, it can be presented in an execution form, for example, in a binary form, to achieve clear separation of text and background, provide clean and regular input materials for subsequent operations such as content recognition and content extraction, and improve processing efficiency and accuracy.
[0043] Specifically, the scanned image is input into a pre-trained noise point recognition model. The false positive noise point recognition module in the model identifies false positive pixels that are easily misjudged as text by analyzing the image pixel distribution and texture features, thereby generating a background noise image corresponding to the scanned image; then, the feature recognition module performs feature extraction processing on the background noise image and the original scanned image, and on the premise of indicating the background noise image, marks and hides the noise points in the scanned image, and finally outputs a target mask image that only retains the text content in the paper document.
[0044] In this embodiment, through the dual-module design of the false positive noise point recognition module and the feature recognition module, real text and background noise can be accurately distinguished, thereby improving the accuracy of noise reduction; there is no need to manually check the noise line by line, which greatly reduces manual intervention and has high automated processing efficiency; while removing noise points, it can retain text strokes, spacing, layout structure and other features to the maximum extent, laying a high-quality foundation for subsequent operations; and the trained model can adapt to noise scenarios under different paper quality, scanning equipment or lighting conditions, and the processing results are highly stable.
[0045] Optionally, the method also includes: determining multiple training samples, wherein the training samples include a sample scan image, a content annotation mask image corresponding to the sample scan image, and a binarized mask image of the sample scan image; wherein the binarized value in the binarized mask image is determined by analyzing the sample scan image; for multiple training samples, inputting the sample scan image in the training sample into the noise point recognition model to be trained, so as to process the sample scan image based on the false positive noise point recognition module in the noise point recognition model to obtain a first mask image, and processing the first mask image and the sample scan image based on the feature recognition module to obtain a predicted mask image; determining a first loss value for loss processing of the false positive noise point recognition module and a second loss value for loss processing of the feature recognition module based on the predicted mask image, the first mask image, the content annotation mask image and the binarized mask image; the noise point recognition model to be trained obtained when the target loss function in the noise point recognition model to be trained is used as the noise point recognition model; wherein the target loss function includes the first loss function of the false positive noise point recognition module and the second loss function of the feature recognition module.
[0046] Each sample includes a sample scan image, a content annotation mask image, and a binarized mask image. The content annotation mask image specifically refers to a mask image of the true value of the text region manually annotated by an annotation device. The binarized mask image specifically refers to the binarization result generated by analyzing the sample scan image using a binarization processing algorithm, which is used to distinguish foreground from background. In this embodiment, the sample scan image is processed using the maximum inter-class variance method to obtain a binarized mask image corresponding to the sample scan image. Exemplarily, the maximum inter-class variance method includes but is not limited to the OTSU algorithm, which is used to automatically determine the image binarization threshold to accommodate the situation where foreground and background pixels in the image have different grayscale distributions. An optimal binarization threshold is determined based on the image's grayscale histogram, so that when the image is divided into two categories, the intra-class variance is minimized or the inter-class variance is maximized, thereby better distinguishing foreground and background pixels in the image. The first mask image is a false positive mask image, which includes background noise areas in the image and is output by the false positive noise point recognition module. The predicted mask image refers to the final result output by the noise point recognition model after processing the input sample scan image, including the target area in the image, such as text content.
[0047] Specifically, multiple sample data are obtained from a preset storage space or server. The multiple sample data can be sample data corresponding to the same business scenario or sample data corresponding to multiple business scenarios. Each sample includes a sample scan image, a content annotation mask image, and a binary mask image. During model training, for multiple training samples, the sample scan image in each training sample is input into the noise point recognition model to be trained. The sample scan image is processed by a false positive noise point recognition module to generate a first mask image. The first mask image and the corresponding sample scan image are processed by a feature recognition module. Under the guidance of the first mask image, further processing is performed to generate a predicted mask image. That is, the predicted mask image is the final prediction result that eliminates noise points and includes text features. By comparing the predicted mask image, the first mask image with the content annotation mask image and the binarized mask image, the first loss value and the second loss value are calculated, wherein the first loss function is used to measure the error of the false positive noise point recognition module, and the second loss value is used to measure the error of the feature recognition module. The corresponding modules are optimized respectively by the first loss value and the second loss value. Through continuous iterative training, until the target loss function of the model converges, a trained noise point recognition model is finally obtained, wherein the target loss function includes the first loss function of the false positive noise point recognition module and the second loss function of the feature recognition module.
[0048] For example, Figure 2 The schematic diagram of the structure of a noise point recognition model shown in FIG. An original sample scan image is input into a false positive noise point recognition module for false positive pixel recognition, which outputs a complex background prediction result that can be easily misidentified as text, namely a first mask image. The first mask image and the corresponding sample scan image are then channel-connected to generate a high-resolution feature map containing complex background information. This feature map is finally input into a feature recognition module, which, while indicating the complex background prediction result, outputs a binary prediction result corresponding to the text content, namely a predicted mask image. A pseudo false positive mask image is determined based on the content annotation mask image and the binary mask image; a first loss value is determined based on the pseudo false positive mask image, the first mask image, and the first loss function of the false positive noise point recognition module; and a second loss value is determined based on the content annotation mask image, the predicted mask image, and the second loss function of the feature recognition module.
[0049] In this embodiment, the sample scan image is subjected to two-stage image processing through the noise point recognition model. In the first stage, the sample scan image is processed through the false positive noise point recognition module to generate a first mask image for separating the main easily confused background. In the second stage, the image obtained by integrating the first mask image and the corresponding sample scan image is subjected to detail segmentation processing through the feature recognition model, that is, detail segmentation processing is performed under the guidance of the first mask image to generate a predicted mask image corresponding to the sample scan image. On the one hand, the false positive mask is used to exclude background pixels with a high positive probability and segment out text pixels; on the other hand, the high-resolution information of the mask network is restored from the abstract information through deconvolution, which will lose some detail features, and the detail segmentation network restores them by re-extracting the high-resolution features of the original image.
[0050] Optionally, a first loss value for loss processing of a false positive noise point recognition module and a second loss value for loss processing of a feature recognition module are determined based on the predicted mask image, the first mask image, the content annotation mask image and the binarized mask image, including: determining a pseudo false positive mask image based on the content annotation mask image and the binarized mask image; determining a first loss value based on the pseudo false positive mask image, the first mask image and the first loss function of the false positive noise point recognition module; and determining a second loss value based on the content annotation mask image, the predicted mask image and the second loss function of the feature recognition module.
[0051] Among them, the pseudo-false positive mask image specifically represents the image formed by the pseudo-label of the background that is mistakenly identified as the text area in the scanned image. The pseudo-false positive mask image is obtained by performing a relative complement operation on the content annotation mask image and the binary mask image. The formula for determining is: Among them, M OUST is the binary mask image, M gt Label mask images for content.
[0052] Specifically, a relative complement operation is performed on the content annotation mask image and the binary mask image to obtain a pseudo false positive mask image, which is used to mark the false positive area of the complex background in the scanned image. The pseudo false positive mask image and the first mask image are input into the first loss function of the false positive noise point recognition module. Exemplarily, the first loss function includes but is not limited to cross entropy loss and Dice loss. The difference between the two is calculated to obtain a first loss value, which is used to measure the error of the false positive noise point recognition module in distinguishing between noise and text, especially the misjudgment of the false positive area. The content annotation mask image and the predicted mask image are input into the second loss function of the feature recognition module. The pixel level of the two is calculated by the loss function to obtain a second loss value, which is used to evaluate the feature recognition module's retention accuracy of the real text area after fusing the noise suppression results.
[0053] Optionally, a first loss value is determined based on the pseudo false positive mask image, the first mask image, and the first loss function of the false positive noise point recognition module, including: determining the second mask image based on the binary mask image and the content annotation mask image corresponding to the pseudo false positive mask image; determining the third mask information based on the pseudo false positive mask image, the content annotation mask image, and the second mask image; substituting the first mask information and the third mask image into the first loss function to determine the first loss value.
[0054] The second mask image specifically represents a set of pixels in the image that do not belong to the binary mask image or the content annotation mask image. The method to determine is:
[0055]
[0056] The third mask image specifically represents an image formed by fusing the false positive mask image, the content annotation mask image, and the second mask image. The method for determining the third mask image is as follows:
[0057]
[0058] Specifically, the false positive mask image and the content annotation mask image are processed by the second mask image determination method to obtain a second mask image, and then the false positive mask image, the content annotation mask image and the second mask image are spliced according to the third mask image determination method to obtain a third mask image, and the first mask information and the third mask image are substituted into the first loss function to calculate the corresponding first loss value, wherein the calculation method of the first loss function is:
[0059] L mask =L dice (sigmod(F mask ),Maskgt );
[0060] L dice (X,Y)=1-Dice(X,Y);
[0061]
[0062] Among them, L dice is the Dice coefficient loss, X represents F mask , Y represents Mask gt .
[0063] For the calculation of the second loss value of the feature recognition module, the feature recognition module has two inputs, one is the sample scan image, and the other is the complex background prediction M output by the false positive noise point recognition module. FP-pred , the final feature recognition module outputs the binary prediction mask image M binarize , whose output uses the binarization loss L binarize Constraints are performed, corresponding to the calculation method of the second loss, and the loss function is:
[0064] L binarize =L dice (M binarize ,M gt );
[0065] M binarize =D(concat(I,M FP-pred ));
[0066] Where D(·) represents the feature recognition module, which is used to segment the input image into details, I is the input scanned image, and M FP-pred The prediction result output by the false positive noise point recognition module is a complex background prediction, and it has been activated by the sigmoid function.
[0067] Optionally, the false positive noise point identification module includes, in sequence according to the input-output relationship: a first encoding module, a first bottleneck network layer, and a first decoding module, and the first encoding module and the first decoding module are symmetrical with respect to the first bottleneck network layer; in sequence according to the input-output relationship, the first encoding module includes, in sequence, a first feature extraction layer, a first downsampling layer, a second feature extraction layer, a second downsampling layer, a third feature extraction layer, a third downsampling layer, a fourth feature extraction layer, and a fourth downsampling layer, and the depth value of the feature extraction layer increases in sequence according to the input-output relationship; in sequence according to the input-output relationship, the first decoding module includes, in sequence, a first upsampling layer, a fifth feature extraction layer, a second upsampling layer, a , the sixth feature extraction layer, the third upsampling layer, the seventh feature extraction layer, the fourth upsampling layer and the eighth feature extraction layer, the depth value of the feature extraction layer decreases in sequence according to the input-output relationship; wherein, the output result of the third feature extraction layer is processed by the first convolution to obtain a first input data to be input to the fifth feature extraction layer, and the first input data and the output result of the first upsampling are input to the fifth feature extraction layer after residual processing; the output result of the fourth feature extraction layer is processed by the second convolution to obtain a second input data to be input to the sixth feature extraction layer, and the second input data and the output result of the second upsampling are input to the sixth feature extraction layer after residual processing.
[0068] The encoding layer is the module in the neural network responsible for converting input data (such as images or text) from the original space into an abstract feature space. It is usually located in the first half of the network and extracts local or global features of the input data through convolutional layers (in CNNs) or self-attention mechanisms (in Transformers). The decoding layer is the module corresponding to the encoding layer and is responsible for restoring the abstract feature maps output by the bottleneck layer into a representation of the target space (such as masks for image segmentation or text for machine translation). It is usually located in the second half of the network. The decoding layer is often connected to the corresponding layer of the encoding layer through the decoding layer to fuse features and combine the shallow details of the encoding layer with the deep semantics of the decoding layer. The bottleneck layer is the intermediate module connecting the encoding and decoding layers in the encoding-decoding structure. It is usually the part of the network with the smallest feature dimension and the most abstract semantics. It is shaped like a "bottleneck". Through a small number of convolutional layers, fully connected layers, or global pooling operations, it compresses the high-dimensional feature maps output by the encoding layer and extracts the core semantic information.
[0069] Specifically, the false positive noise point recognition module is responsible for the first stage of image processing, which is used to distinguish the complex background that is easily misjudged from the document image and generate a false positive mask image. Figure 3The schematic diagram of the structure of a false positive noise point identification module is shown. The false positive noise point identification module consists of four symmetrical encoder-decoder groups and a bottleneck layer. That is, the false positive noise point identification module includes a first encoding module, a first bottleneck network layer, and a first decoding module. The first encoding module and the first decoding module are symmetrical with respect to the first bottleneck network layer. The input image passes through the first to fourth feature extraction layers in sequence, with the depth value increasing layer by layer, that is, the number of convolutional layers or channels increases. After each layer, it is downsampled by a downsampling layer to reduce the spatial size and gradually extract features from shallow texture to deep semantics. For example, the first feature extraction layer captures the basic noise texture of the scanned image, while the fourth feature extraction layer focuses on the complex noise distribution pattern. In this embodiment, the first downsampling layer after the first feature extraction layer and the second downsampling layer after the second feature extraction layer use the same downsampling method, the third downsampling layer after the third feature extraction layer and the fourth downsampling layer after the fourth feature extraction layer use the same downsampling method, and the downsampling method used by the first downsampling layer and the second downsampling layer is different from the downsampling method used by the third downsampling layer and the fourth downsampling layer. After downsampling, the deepest layer of the encoding phase, the fourth feature extraction layer, undergoes global feature integration through the first bottleneck network layer, compressing the feature dimensions and refining the core noise representation. The output of the bottleneck layer is scaled up by the first upsampling layer and then fused with the feature maps of the corresponding layer in the encoding phase through a residual connection. Specifically, the output of the third feature extraction layer undergoes the first convolution, and the residual is added to the output of the first upsampling layer before being input into the fifth feature extraction layer, restoring shallow details while retaining deep noise features. The output of the fourth feature extraction layer undergoes the second convolution, and the residual is connected to the output of the second upsampling layer before being input into the sixth feature extraction layer, further balancing noise suppression and feature resolution. Subsequently, through layer-by-layer upsampling and feature extraction, the depth value decreases as the fifth to eighth feature extraction layers are sequentially passed through, ultimately generating the first mask image to mark the noise area. In this embodiment, the output result of the third feature extraction layer is processed by the first convolution, and the output result of the fourth feature extraction layer is processed by the second convolution, so that the jump connection between the shallow encoding and decoding can be removed in the mask generation module. Through convolution processing, the semantic difference is compensated to ensure that the network layer that processes high-level semantic information is activated during the training process, wherein the shallow encoding and decoding specifically refers to the first feature extraction and the second feature extraction layer, and the seventh feature extraction layer and the eighth feature extraction layer that are symmetrical relative to the first bottleneck layer. Residual processing is introduced in the deep network to ensure that there is no excessive parameter redundancy in the network layer and to avoid the problem of slow convergence, wherein the deep network specifically refers to the third feature extraction and the fourth feature extraction layer, and the fifth feature extraction layer and the sixth feature extraction layer that are symmetrical relative to the first bottleneck layer.
[0070] In this embodiment, noise features at different levels (shallow texture → deep semantics) are extracted in the encoding stage, and high- and low-frequency features of the corresponding levels are fused through residual connections in the decoding stage to avoid detail loss caused by simple upsampling and improve the recognition ability of different types of noise (such as point noise and block stains); the symmetric encoding and decoding structure utilizes the hierarchical correspondence to achieve feature reuse while reducing the number of parameters, reducing computational complexity, and is suitable for processing high-resolution scanned images; residual connections provide a shortcut for gradient conduction, alleviate the gradient vanishing problem during deep network training, and improve the model convergence stability; through global feature analysis of the bottleneck layer and detail recovery in the decoding stage, the model can accurately locate the noise area while avoiding excessive suppression of text edges close to the noise, thereby achieving a refined distinction between noise and text.
[0071] Optionally, the feature recognition module includes: a second encoding module, a second bottleneck network layer and a second decoding module, the second encoding module and the second decoding module have a symmetrical structure relative to the second bottleneck network layer, the second encoding block includes multiple encoding layers, the second decoding module includes multiple decoding layers, and the number of encoding layers and decoding layers is the same; wherein, the third output result of the target encoding layer in the symmetrical structure is the third input data of the target decoding layer, and the third input data and the fourth output result of the previous decoding layer of the target decoding layer are input to the target decoding layer after residual processing, and the hierarchical structures in the target encoding layer and the target decoding layer are different.
[0072] Specifically, the feature recognition module is responsible for the second stage of detail segmentation processing, specifically for performing binary segmentation on the scanned image under the guidance of the false positive mask image to obtain the target mask image. The feature recognition module includes a second encoding module, a second bottleneck network layer and a second decoding module, such as Figure 4 A schematic diagram of the structure of a feature recognition module is shown, in which the second encoding module and second decoding module are symmetrically arranged relative to the second bottleneck network layer. The input image is processed layer by layer through multiple encoding layers. Each layer reduces the spatial dimension through downsampling while increasing the number of feature channels, extracting a multi-level representation from low-level visual features to high-level semantic features. Each encoding layer outputs a third output result, recording feature information at different scales. The output of the deepest encoding layer is passed through the second bottleneck network layer for global feature compression, refining the core distinguishing features between text and noise. The output of the second bottleneck network layer is upsampled and amplified, and then fused with the third output of the target encoding layer (such as shallow edge features) at a symmetrical position during the encoding phase through a residual connection. The third output of the target encoding layer serves as the third input data and is residually added to the fourth output of the previous decoding layer (i.e., the upsampled features) of the target decoding layer to compensate for the details lost during the upsampling process. The fused features are input to the target decoding layer, which restores spatial resolution and optimizes feature representation layer by layer, ultimately generating a predicted mask image.
[0073] In this embodiment, the low-level detail features extracted in the encoding stage are fused with the high-level semantic features in the decoding stage through symmetrical hierarchical residual connections, thereby improving the recognition accuracy of complex text structures; the hierarchical structures of the target encoding layer and the decoding layer are different, avoiding feature redundancy caused by simple symmetry and adapting to the differentiated modeling requirements of text features and noise features; the residual connection increases the path diversity of the network, alleviates the overfitting problem caused by too many parameters in the deep network, and at the same time reduces the optimization difficulty and accelerates model convergence; the bottleneck layer captures the global semantics of the image, and the decoding stage supplements local details through jump connections, so that the model can suppress background noise while retaining the subtle structure of the text, thereby improving the integrity and accuracy of the mask image.
[0074] S130 , performing content extraction processing on the target mask image to obtain the target content of the paper document and archive it.
[0075] The format of the target content is the same as the text content format contained in the paper document.
[0076] Specifically, a preset content extraction algorithm is invoked to process the target mask image, extract the target content from the target mask image, and archive the target content. Based on the business type corresponding to the target mask image, a template file matching the business type can be retrieved from the target storage space. The identified content is then sequentially entered into the corresponding positions in the template to generate an electronic file corresponding to the paper document. The electronic file corresponding to the paper document is then archived, ensuring that the format of the target content is consistent with the text content contained in the paper document.
[0077] For example, OCR (Optical Character Recognition) technology is used to convert text pixels in the target mask image into an editable text character sequence. At the same time, the document's original formatting information, such as font, font size, paragraph spacing, and chart position, is retained. A layout analysis algorithm is used to analyze the layout features in the mask image and reorganize the text content according to the original format of the paper document, such as column divisions, paging, and heading hierarchy. Finally, the extracted and formatted target content is stored in a designated archiving system as an electronic document, completing the digital archiving process for the paper document. Electronic document formats include, but are not limited to, Word and PDF.
[0078] In this embodiment, the target mask image is processed by a content extraction algorithm, which can maximize the consistency of the extracted target content with the paper document and reduce errors that may occur in manual recognition; the text content format is retained intact, and the text format of the paper document can be accurately restored to avoid the readability and usability of the content being affected by format errors; compared with manual word-by-word entry and format adjustment, the automated content extraction and processing process can significantly shorten the operation time and improve work efficiency; the document is archived for easy management and retrieval. After the target content is electronically archived, the powerful management and retrieval functions of the electronic storage system can be used to quickly find and call the required content, thereby improving the convenience and intelligence of document management.
[0079] The technical solution of this embodiment is to obtain a scanned image corresponding to a paper document; input the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation to obtain a target mask image of the text content in the paper document; wherein the noise point recognition model includes a false positive noise point recognition module and a feature recognition module, the false positive noise point recognition module is used to generate a background noise image corresponding to the scanned image, and the feature recognition module is used to perform feature processing on the background noise image and the scanned image; by performing content extraction processing on the target mask image, the target content of the paper document is obtained and archived, wherein the format of the target content is the same as the format of the text content contained in the paper document. This solution realizes the processing of the scanned image, performs a noise point concealment operation on the scanned image through the noise point recognition model to highlight the document content in the scanned image, and performs feature recognition on the document content to obtain a target mask image, and then performs content recognition and archiving processing on the target mask image, thereby improving the efficiency of paper document recognition and archiving processing, solving the problem of inaccurate information recognition caused by poor image quality and complex background problems, and improving the efficient processing of scanned images and the integrity and efficiency of paper document scanning and archiving.
[0080] Example 2
[0081] Figure 5 This is a flowchart of a method for scanning and archiving paper documents provided in the second embodiment of the present invention. The method of this embodiment is a further optimization of the method of the above embodiment. Optionally, the false positive noise point recognition module in the noise point recognition model recognizes noise points in the scanned image to obtain a background noise image; the background noise image and the scanned image are spliced to obtain a feature extraction image to be input to the feature recognition module; the feature recognition module performs feature extraction processing on the feature extraction image to obtain a target mask image. Figure 5 As shown, the method includes:
[0082] S510: Obtain a scanned image corresponding to a paper document.
[0083] S520 , identifying noise points in the scanned image based on the false positive noise point identification module in the noise point identification model to obtain a background noise image.
[0084] Specifically, the scanned image is input into the false positive noise point recognition module of the noise point recognition model. This module is constructed based on the codec structure. It analyzes the local features of the scanned image such as the pixel grayscale distribution and texture pattern layer by layer through multiple layers of feature extraction layers (such as convolution layers). The downsampling layer is used to gradually compress the spatial size and capture the noise features from shallow noise texture to deep noise features. For example, shallow noise texture includes but is not limited to paper fibers and scanning noise points, and deep noise features include but are not limited to multi-level representations of stain shapes and equipment shadows. After the bottleneck layer integrates the global noise features, the spatial resolution is restored through the upsampling layer, and the noise information of different scales is fused in combination with the cross-layer residual connection to finally generate a background noise image with the same size as the scanned image. For example, the noise area can refer to non-text interference elements, which are marked as specific values, such as grayscale value 0 or mask value 0. The non-noise area refers to text content, which can be retained or marked as a high value.
[0085] In this embodiment, the false positive noise point recognition module is used to identify noise points in the scanned image to obtain a background noise image, which is used to separate the noise points in the scanned image that affect text recognition and is used for subsequent text information recognition processing, thereby helping to reduce the interference of noise points in the scanned image and improve the accuracy of text recognition.
[0086] S530 , obtaining an image to be input into a feature recognition module for feature extraction by splicing the background noise image and the scanned image.
[0087] Specifically, the background noise image output by the false positive noise point recognition module is pixel-wise spliced with the original scanned image. For example, the background noise image and the original scanned image are superimposed in the channel dimension to form an image to be feature extracted. In the specific processing, the background noise image usually exists in the form of a single-channel grayscale image or mask. After splicing with the RGB three-channel data of the scanned image, input data with multi-channel information is generated. Among them, the single-channel grayscale image can be a noise area marked with a low pixel value, such as 0; the non-noise area is marked with a high pixel value, such as 255, and the 3 channels corresponding to the scanned image and the 1 channel of the noise image, a total of 4 channels. It is directly input into the feature recognition module for subsequent processing to obtain the image to be extracted.
[0088] In this embodiment, by fusing the visual information of the scanned image with the background noise image mask information, richer input is provided for feature recognition, and the ability to distinguish between noise and text is enhanced; noise positioning is used to guide feature extraction to improve targeting; repeated calculations are avoided to optimize efficiency and maintain processing fluency; and image diversity and mask universality are combined to enhance the model's adaptability to complex scanning scenarios.
[0089] S540 , performing feature extraction processing on the image to be feature extracted by a feature recognition module to obtain a target mask image.
[0090] Specifically, the image to be feature extracted, which is a fusion of the scanned image and the background noise image, is input into the feature recognition module. The module automatically extracts multi-level information from the scanned image, from pixel-level details to semantic-level features, through a multi-layer neural network. After global feature integration and scale restoration, it outputs the target mask image to accurately mark the text area in the image in a binary form.
[0091] In this embodiment, the pertinence and richness of feature extraction are improved by fusing the original image visual information with the noise prior positioning; a neural network is used to automatically learn the differentiated features of text and noise, avoiding the limitations of manual rule design; text details are retained while suppressing noise, ensuring the integrity and accuracy of the mask image; the entire process is automated to adapt to different scanning scenarios and efficiently generate high-quality target mask images.
[0092] S550 , performing content extraction processing on the target mask image to obtain target content of the paper document and archive the target content, wherein the format of the target content is the same as the format of the text content contained in the paper document.
[0093] The technical solution of this embodiment is to obtain a scanned image corresponding to a paper document; identify noise points in the scanned image based on the false positive noise point recognition module in the noise point recognition model to obtain a background noise image; obtain a feature extraction image to be input into the feature recognition module by splicing the background noise image and the scanned image; perform feature extraction on the feature extraction image by the feature recognition module to obtain a target mask image; and perform content extraction on the target mask image to obtain and archive the target content of the paper document. This solution realizes the processing of the scanned image, performs noise point concealment operation on the scanned image by the noise point recognition model to highlight the document content in the scanned image, and performs feature recognition on the document content to obtain a target mask image, and then performs content recognition and archiving on the target mask image, thereby improving the efficiency of identifying and archiving paper documents, solving the problem of inaccurate information recognition caused by poor image quality and complex background problems, and improving the efficient processing of scanned images and the integrity and efficiency of scanning and archiving paper documents.
[0094] Example 3
[0095] Figure 6 This is a schematic diagram of the structure of a paper document scanning and archiving device provided by the third embodiment of the present invention. Figure 6 As shown, the device includes:
[0096] An image acquisition module 610 is configured to acquire a scanned image corresponding to a paper document;
[0097] A target mask image determination module 620 is configured to input the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation, thereby obtaining a target mask image of the text content in the paper document. The noise point recognition model includes a false positive noise point recognition module and a feature recognition module. The false positive noise point recognition module is configured to generate a background noise image corresponding to the scanned image, and the feature recognition module is configured to perform feature processing on the background noise image and the scanned image.
[0098] The target content archiving process 630 is used to obtain the target content of the paper document by performing content extraction processing on the target mask image and archive it, wherein the format of the target content is the same as the format of the text content contained in the paper document.
[0099] The technical solution of this embodiment is to obtain a scanned image corresponding to a paper document through an image acquisition module; the target mask image determination module inputs the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation to obtain a target mask image of the text content in the paper document; wherein, the noise point recognition model includes a false positive noise point recognition module and a feature recognition module, the false positive noise point recognition module is used to generate a background noise image corresponding to the scanned image, and the feature recognition module is used to perform feature processing on the background noise image and the scanned image; the target content archiving processing obtains the target content of the paper document and archives it by performing content extraction processing on the target mask image, wherein the format of the target content is the same as the format of the text content contained in the paper document. This solution realizes the processing of scanned images, performs noise point concealment on the scanned images through a noise point recognition model to highlight the document content in the scanned images, performs feature recognition on the document content to obtain a target mask image, and then performs content recognition and archiving on the target mask image, thereby improving the efficiency of identifying and archiving paper documents, solving the problem of inaccurate information recognition caused by poor image quality and complex background problems, and improving the efficient processing of scanned images and the integrity and efficiency of scanning and archiving of paper documents.
[0100] On the basis of the above embodiment, optionally, the target content archiving processing 630 is specifically used to identify noise points in the scanned image based on the false positive noise point recognition module in the noise point recognition model to obtain a background noise image; by splicing the background noise image and the scanned image, an image to be feature extracted to be input into the feature recognition module is obtained; and the feature recognition module performs feature extraction processing on the image to be feature extracted to obtain a target mask image.
[0101] Optionally, the device is used to determine multiple training samples, wherein the training samples include a sample scan image, a content annotation mask image corresponding to the sample scan image, and a binarized mask image of the sample scan image; wherein the binarized value in the binarized mask image is determined by analyzing the sample scan image; for multiple training samples, the sample scan image in the training sample is input into the noise point recognition model to be trained, so as to process the sample scan image based on the false positive noise point recognition module in the noise point recognition model to obtain a first mask image, and the first mask image and the sample scan image are processed based on the feature recognition module to obtain a predicted mask image; according to the predicted mask image, the first mask image, the content annotation mask image and the binarized mask image, a first loss value for loss processing of the false positive noise point recognition module and a second loss value for loss processing of the feature recognition module are determined; the noise point recognition model to be trained obtained when the target loss function in the noise point recognition model to be trained converges is used as the noise point recognition model; wherein the target loss function includes the first loss function of the false positive noise point recognition module and the second loss function of the feature recognition module.
[0102] Optionally, the device is specifically used to determine a pseudo-false positive mask image based on the content annotation mask image and the binarized mask image; determine a first loss value based on the pseudo-false positive mask image, the first mask image, and the first loss function of the false positive noise point recognition module; and determine a second loss value based on the content annotation mask image, the predicted mask image, and the second loss function of the feature recognition module.
[0103] Optionally, the device is specifically used to determine a second mask image based on a binary mask image corresponding to the pseudo-false positive mask image and a content annotation mask image; determine third mask information based on the pseudo-false positive mask image, the content annotation mask image and the second mask image; and substitute the first mask information and the third mask image into the first loss function to determine a first loss value.
[0104] Optionally, the false positive noise point identification module includes, in sequence according to the input-output relationship: a first encoding module, a first bottleneck network layer, and a first decoding module, and the first encoding module and the first decoding module are symmetrical with respect to the first bottleneck network layer; in sequence according to the input-output relationship, the first encoding module includes, in sequence, a first feature extraction layer, a first downsampling layer, a second feature extraction layer, a second downsampling layer, a third feature extraction layer, a third downsampling layer, a fourth feature extraction layer, and a fourth downsampling layer, and the depth value of the feature extraction layer increases in sequence according to the input-output relationship; in sequence according to the input-output relationship, the first decoding module includes, in sequence, a first upsampling layer, a fifth feature extraction layer, a second upsampling layer, a , the sixth feature extraction layer, the third upsampling layer, the seventh feature extraction layer, the fourth upsampling layer and the eighth feature extraction layer, the depth value of the feature extraction layer decreases in sequence according to the input-output relationship; wherein, the output result of the third feature extraction layer is processed by the first convolution to obtain a first input data to be input to the fifth feature extraction layer, and the first input data and the output result of the first upsampling are input to the fifth feature extraction layer after residual processing; the output result of the fourth feature extraction layer is processed by the second convolution to obtain a second input data to be input to the sixth feature extraction layer, and the second input data and the output result of the second upsampling are input to the sixth feature extraction layer after residual processing.
[0105] Optionally, the feature recognition module includes: a second encoding module, a second bottleneck network layer and a second decoding module, the second encoding module and the second decoding module have a symmetrical structure relative to the second bottleneck network layer, the second encoding block includes multiple encoding layers, the second decoding module includes multiple decoding layers, and the number of encoding layers and decoding layers is the same; wherein, the third output result of the target encoding layer in the symmetrical structure is the third input data of the target decoding layer, and the third input data and the fourth output result of the previous decoding layer of the target decoding layer are input to the target decoding layer after residual processing, and the hierarchical structures in the target encoding layer and the target decoding layer are different.
[0106] The paper document scanning and filing device provided in the embodiment of the present invention can execute the paper document scanning and filing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0107] Example 4
[0108] Figure 71 is a structural diagram of an electronic device provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0109] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0110] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0111] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the method for scanning and archiving paper documents.
[0112] In some embodiments, the method for scanning and filing paper documents can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for scanning and filing paper documents described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the method for scanning and filing paper documents in any other appropriate manner (e.g., by means of firmware).
[0113] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] The computer programs for implementing the paper document scanning and archiving method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0115] Example 5
[0116] The fifth embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a processor to execute a method for scanning and archiving paper documents, the method comprising:
[0117] Obtaining a scanned image corresponding to a paper document;
[0118] The scanned image is input into a pre-trained noise point recognition model to perform noise point concealment operations, thereby obtaining a target mask image of the text content in the paper document. The noise point recognition model includes a false positive noise point recognition module and a feature recognition module. The false positive noise point recognition module is used to generate a background noise image corresponding to the scanned image, and the feature recognition module is used to perform feature processing on the background noise image and the scanned image.
[0119] By performing content extraction processing on the target mask image, the target content of the paper document is obtained and archived, wherein the format of the target content is the same as the format of the text content contained in the paper document.
[0120] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0121] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0122] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0123] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0124] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0125] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for scanning and archiving paper documents, characterized in that: include: Obtaining a scanned image corresponding to a paper document; Inputting the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation, thereby obtaining a target mask image of the text content in the paper document; wherein the noise point recognition model includes a false positive noise point recognition module and a feature recognition module, wherein the false positive noise point recognition module is used to generate a background noise image corresponding to the scanned image, and the feature recognition module is used to perform feature processing on the background noise image and the scanned image; By performing content extraction processing on the target mask image, the target content of the paper document is obtained and archived, wherein the format of the target content is the same as the format of the text content contained in the paper document.
2. The method according to claim 1, characterized in that Inputting the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation to obtain a target mask image of the text content in the paper document includes: Identifying noise points in the scanned image based on a false positive noise point identification module in the noise point identification model to obtain the background noise image; By performing splicing processing on the background noise image and the scanned image, an image to be extracted for feature extraction to be input into the feature recognition module is obtained; The feature recognition module performs feature extraction processing on the image to be feature extracted to obtain the target mask image.
3. The method according to claim 1, characterized in that The method further comprises: Determining a plurality of training samples, wherein the training samples include a sample scan image, a content annotation mask image corresponding to the sample scan image, and a binarized mask image of the sample scan image; wherein the binarized values in the binarized mask image are determined by analyzing the sample scan image; For the plurality of training samples, inputting a sample scan image in the training sample into a noise point recognition model to be trained, processing the sample scan image based on a false positive noise point recognition module in the noise point recognition model to obtain a first mask image, and processing the first mask image and the sample scan image based on the feature recognition module to obtain a predicted mask image; Determining a first loss value for performing loss processing on the false positive noise point recognition module and a second loss value for performing loss processing on the feature recognition module based on the predicted mask image, the first mask image, the content annotation mask image, and the binarized mask image; The noise point recognition model to be trained obtained when the target loss function in the noise point recognition model to be trained converges is used as the noise point recognition model; wherein the target loss function includes the first loss function of the false positive noise point recognition module and the second loss function of the feature recognition module.
4. The method according to claim 3, characterized in that The determining, based on the predicted mask image, the first mask image, the content annotation mask image, and the binarized mask image, a first loss value for performing loss processing on the false positive noise point recognition module and a second loss value for performing loss processing on the feature recognition module includes: determining a pseudo-false positive mask image according to the content-annotated mask image and the binarized mask image; determining the first loss value according to the pseudo false positive mask image, the first mask image, and a first loss function of the false positive noise point identification module; The second loss value is determined according to the content annotation mask image, the predicted mask image, and the second loss function of the feature recognition module.
5. The method according to claim 4, characterized in that The determining the first loss value according to the pseudo false positive mask image, the first mask image, and the first loss function of the false positive noise point identification module includes: determining a second mask image according to the binary mask image corresponding to the pseudo-false-positive mask image and the content-annotated mask image; determining third mask information according to the pseudo-false-positive mask image, the content-annotated mask image, and the second mask image; Substituting the first mask information and the third mask image into the first loss function to determine the first loss value.
6. The method according to claim 1, characterized in that The false positive noise point identification module includes, in order according to the input-output relationship: a first encoding module, a first bottleneck network layer, and a first decoding module, wherein the first encoding module and the first decoding module are symmetrically structured relative to the first bottleneck network layer; According to the input-output relationship, the first encoding module includes a first feature extraction layer, a first downsampling layer, a second feature extraction layer, a second downsampling layer, a third feature extraction layer, a third downsampling layer, a fourth feature extraction layer, and a fourth downsampling layer in sequence, and the depth values of the feature extraction layers increase in sequence according to the input-output relationship; According to the input-output relationship, the first decoding module includes a first upsampling layer, a fifth feature extraction layer, a second upsampling layer, a sixth feature extraction layer, a third upsampling layer, a seventh feature extraction layer, a fourth upsampling layer, and an eighth feature extraction layer in sequence, and the depth values of the feature extraction layers decrease in sequence according to the input-output relationship; The output result of the third feature extraction layer is subjected to a first convolution process to obtain a first input data to be input to the fifth feature extraction layer, and the first input data and the output result of the first upsampling are subjected to residual processing and input to the fifth feature extraction layer; The output result of the fourth feature extraction layer is subjected to a second convolution process to obtain a second input data to be input to the sixth feature extraction layer. The second input data and the output result of the second upsampling are subjected to residual processing and input to the sixth feature extraction layer.
7. The method according to claim 1, characterized in that The feature recognition module includes: a second encoding module, a second bottleneck network layer, and a second decoding module. The second encoding module and the second decoding module are symmetrical with respect to the second bottleneck network layer. The second encoding block includes multiple encoding layers, and the second decoding module includes multiple decoding layers. The number of the encoding layers and the number of the decoding layers are the same. Among them, the third output result of the target coding layer in a symmetrical structure is the third input data of the target decoding layer, and the third input data and the fourth output result of the previous decoding layer of the target decoding layer are input to the target decoding layer after residual processing, and the hierarchical structures in the target coding layer and the target decoding layer are different.
8. A scanning and filing device for paper documents, characterized in that: include: An image acquisition module, used to acquire a scanned image corresponding to a paper document; a target mask image determination module, configured to input the scanned image into a pre-trained noise point recognition model to perform a noise point concealment operation, thereby obtaining a target mask image of the text content in the paper document; wherein the noise point recognition model includes a false positive noise point recognition module and a feature recognition module, wherein the false positive noise point recognition module is configured to generate a background noise image corresponding to the scanned image, and the feature recognition module is configured to perform feature processing on the background noise image and the scanned image; Target content archiving processing is used to obtain the target content of the paper document and archive it by performing content extraction processing on the target mask image, wherein the format of the target content is the same as the format of the text content contained in the paper document.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the method for scanning and archiving paper documents according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for scanning and archiving paper documents according to any one of claims 1 to 7 when executed.