OCR (Optical Character Recognition) method and system based on machine learning
Machine learning technology is used to extract and analyze feature information of image blocks and generate business shielding windows, which solves the problems of low accuracy and difficulty in shielding interference content of OCR technology in complex background and deformed character recognition, achieving more efficient and accurate recognition. sex.
Patent Information
- Application Number
- CN202410728081.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-08-30
AI Technical Summary
Existing OCR technology has low recognition accuracy when dealing with complex backgrounds or deformed characters, and it is difficult to effectively block business interference content, such as seals and signatures, which affects recognition accuracy.
Using the OCR recognition method based on machine learning, by extracting key business feature node vectors, single-dimensional and composite-dimensional spatial gradients, and business adaptive vectors of current and past scanned image blocks, the target business shielding window is generated to shield interference content in the image. , improve the recognition accuracy.
It significantly improves the accuracy and efficiency of OCR recognition, can more accurately identify key business features, effectively shields business interference content, is suitable for static and dynamic image sequences, and has strong adaptability and scalability.
Smart Images

Figure CN118570809A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to an OCR recognition method and system based on machine learning. Background Art
[0002] In the field of information technology and image processing, OCR (Optical Character Recognition) technology has always been a hot topic and a difficult point of research. Traditional OCR technology is mainly based on template matching method, which realizes text recognition by comparing characters in the image with predefined character templates. However, due to the influence of various factors such as font, size, angle, and lighting, the recognition accuracy of traditional OCR technology has certain limitations.
[0003] With the rapid development of computer vision technology, OCR methods based on feature extraction and pattern recognition have gradually become mainstream. This type of method uses digital image processing technology to extract the characteristic information of characters (such as contours, corners, etc.) for character recognition. Although this method has improved the recognition accuracy to a certain extent, it still faces certain challenges when dealing with complex backgrounds or deformed characters.
[0004] In recent years, with the rise of deep learning technology, OCR technology has ushered in new development opportunities. Deep learning models, especially convolutional neural networks (CNN) and recurrent neural networks (RNN), have demonstrated powerful capabilities in areas such as image recognition and natural language processing. By applying deep learning technology to the OCR field, more accurate recognition of complex backgrounds and deformed characters can be achieved.
[0005] However, in practical applications, the images to be recognized often contain a lot of business interference content, such as seals, signatures, etc. These interference contents will have a negative impact on OCR recognition. Therefore, how to effectively shield these business interference contents has become the key to improving OCR recognition accuracy. Summary of the invention
[0006] In order to at least overcome the above-mentioned deficiencies in the prior art, an object of the embodiments of the present application is to provide an OCR recognition method and system based on machine learning.
[0007] According to one aspect of the present application, a machine learning-based OCR recognition method is provided, the method comprising: Acquire a current target scanned image block and X past scanned image blocks corresponding to the image to be recognized; the current target scanned image block and the X past scanned image blocks are both preprocessed grayscale images, and each of the X past scanned image blocks is a preprocessed grayscale image before the current target scanned image block; When Y key business feature node vectors of the current target scanned image block are extracted, Z single-dimensional spatial gradients and Z composite-dimensional spatial gradients corresponding to the current target scanned image block are obtained according to the Y key business feature node vectors; Extract the Y past business feature node vectors corresponding to each of the past scanned image blocks, and past business feature node vectors to determine a business adaptation vector corresponding to the current target scanned image block; The Y key business feature node vectors, the Z single-dimensional space gradients, the Z composite-dimensional space gradients and the business adaptive vector are loaded into a target OCR business shielding recognition network, and the target OCR business shielding recognition network is used to generate a target business shielding window corresponding to the current target scanned image block; the target business shielding window is used to shield the business interference content in the image to be recognized, and generate a candidate recognition image corresponding to the image to be recognized.
[0008] In a possible implementation of the first aspect, after the step of loading the Y key business feature node vectors, the Z single-dimensional space gradients, the Z composite-dimensional space gradients, and the business adaptation vector into a target OCR business shielding recognition network, and using the target OCR business shielding recognition network to generate a target business shielding window corresponding to the current target scanned image block, the method further includes: Performing an interpolation operation on the target service shielding window to generate an interpolation service shielding window; the window parameters of the interpolation service shielding window are the same as the window parameters of the current target scanned image block; Performing element-by-element masking fusion on the interpolation service masking window and the current target scanned image block, transforming the element-by-element masking fusion result, and generating target scanned image data after service masking is performed on the current target scanned image block; After each current target scan image block corresponding to the image to be identified is service-shielded, a candidate identification image corresponding to the image to be identified is generated, wherein the candidate identification image is composed of the target scan image data after the service shielding; In a possible implementation manner of the first aspect, before the step of acquiring a current target scanned image block and X past scanned image blocks corresponding to the image to be recognized, the method further includes: Acquire a target example target scan image block and X past example scan image data corresponding to the example scan image data, and extract a sample business shielding window corresponding to the target example target scan image block; the target example target scan image block and the X past example target scan image blocks are both preprocessed grayscale images, and each of the X past example target scan image blocks is a preprocessed grayscale image before the target example target scan image block; When Y target example business feature node vectors of the target example target scanned image block are extracted, Z example single-dimensional spatial gradients and Z example composite-dimensional spatial gradients corresponding to the target example target scanned image block are obtained according to the Y target example business feature node vectors; Extract the Y past example business feature node vectors corresponding to each of the past example target scan image blocks, and determining a sample service adaptation vector corresponding to the target sample target scanned image block based on the past sample service feature node vectors; Loading the Y target example service feature node vectors, the Z example single-dimensional space gradients, the Z example composite-dimensional space gradients, and the example service adaptive vector into a sample OCR service mask recognition network, and using the sample OCR service mask recognition network to generate a training service mask window corresponding to the target example target scan image block; The sample OCR business shielding recognition network is parameter optimized according to the training business shielding window and the example business shielding window to generate a target OCR business shielding recognition network for predicting a target business shielding window corresponding to a current target scanned image block corresponding to an image to be recognized; the target business shielding window is used to shield business interference content in the image to be recognized, and generate a candidate recognition image corresponding to the image to be recognized.
[0009] For example, in a possible implementation of the first aspect, the step of performing an interpolation operation on the target service masking window to generate an interpolated service masking window includes: Performing feature analysis on the target service shielding window to generate window feature information, wherein the window feature information includes size, shape, edge sharpness, and internal hole or break information of the target service shielding window; Adaptively define corresponding structural elements according to the shape and size of the target service shielding window, and use the defined structural elements to perform an expansion operation on the target service shielding window, and after the expansion operation, perform an erosion operation on the target service shielding window to restore the original size of the target service shielding window, thereby generating the target service shielding window after adaptive morphological filtering processing; Using the Canny edge detection algorithm or the Sobel algorithm to perform edge detection on the target service shielding window after the adaptive morphological filtering process, and generate edge detection information, wherein the edge detection information is used to determine the specific position that needs to be interpolated; Initializing an interpolation grid corresponding to the target service shielding window according to the size and shape of the window, wherein the interpolation grid is used to store interpolated pixel values; In the interpolation grid, determining a target point to be interpolated, the target point being a blank area between window edges corresponding to the edge detection information; For each target point that needs to be interpolated, a corresponding interpolation value is calculated according to known pixel values and edge information around the target point, wherein the interpolation value is weightedly calculated according to the direction and distance of edge pixels adjacent to the target point; The above process is repeated until all target points in the interpolation grid are filled, and after the interpolation is completed, an interpolation service shielding window is generated.
[0010] For example, in a possible implementation of the first aspect, the step of performing element-by-element masking fusion on the interpolation service masking window and the current target scanned image block, transforming the element-by-element masking fusion result, and generating target scanned image data after performing service masking on the current target scanned image block includes: Aligning the interpolation service masking window with the current target scanned image block in terms of size and position, and if the data types of the interpolation service masking window and the current target scanned image block are different, performing data type conversion on the interpolation service masking window or the current target scanned image block; Traversing each pixel point in the interpolation service masking window and comparing it with the pixel point at the corresponding position in the current target scanned image block, wherein in the interpolation service masking window, a binary value is used to represent the area to be masked or retained; For the pixel points marked as needing to be shielded in the interpolation service shielding window, the pixel value of the corresponding position in the current target scanned image block is set to a specific shielding value, and for the pixel points marked as reserved, the pixel value of the corresponding position in the current target scanned image block is kept unchanged. In the shielding fusion process, the edge of the current target scanned image block and the interpolation service shielding window is smoothed using image morphological operations; The result of element-by-element masking and fusion is saved as a new target scanning image data, and the target scanning image data only contains the non-business interference content in the current target scanning image block; Wherein, the method further comprises: Extract key features from the candidate recognition image using an OCR algorithm, wherein the key features include character outlines and stroke structures; The extracted key features are matched with predefined character templates or trained classifiers to achieve classification and recognition of the characters in the candidate recognition image.
[0011] According to one aspect of an embodiment of the present application, a machine learning system is provided, which includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and the machine-executable instructions are loaded and executed by the processor to implement the machine learning-based OCR recognition method in any one of the possible implementations described above.
[0012] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are 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 executes the methods provided in various optional implementations of the above three aspects.
[0013] In the technical solutions provided by some embodiments of the present application, the embodiments of the present application significantly improve the accuracy and efficiency of OCR recognition by comprehensively utilizing the key business feature node vectors, single-dimensional spatial gradients, composite-dimensional spatial gradients, and business adaptive vectors of the current target scanned image block, combined with the information of the past scanned image block. Specifically, by introducing the concepts of past scanned image blocks and business adaptive vectors, the present invention can more accurately identify the key business features in the image to be identified, especially in the scenario where there is business interference content. The generation of the target business shielding window effectively shields the business interference content and improves the accuracy of OCR recognition. A target OCR business shielding recognition network is adopted, which can quickly generate a target business shielding window based on the extracted feature vectors and gradient information, thereby reducing unnecessary computational overhead and optimizing the efficiency of OCR recognition. The present application is not only applicable to static images to be identified, but also to dynamic image sequences scanned continuously. By considering the information of the past scanned image blocks, it can better adapt to changes in the image sequence and improve the stability and adaptability of recognition. In addition, the embodiments of the present application can be easily integrated into the existing OCR system, and the performance and effect of recognition can be further improved by replacing or upgrading the target OCR business shielding recognition network. Therefore, by introducing the concepts of past scanned image blocks and business adaptive vectors, combined with the target OCR business shielding recognition network, effective shielding of business interference content is achieved, the accuracy and efficiency of OCR recognition are improved, and it has strong adaptability and scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be extracted in combination with these drawings without creative work.
[0015] Figure 1 A flowchart of an OCR recognition method based on machine learning provided in an embodiment of the present application; Figure 2 A schematic block diagram of the architecture of a machine learning system for implementing the above-mentioned machine learning-based OCR recognition method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0016] The following description is intended to enable one of ordinary skill in the art to implement and combine the present application, and the description is provided in the context of a specific application scenario and its requirements. It will be apparent to one of ordinary skill in the art that various changes may be made to the disclosed embodiments, and that the general principles defined in the present application may be applied to other embodiments and application scenarios without departing from the principles and scope of the present application. Therefore, the present application is not limited to the described embodiments, but should be given the broadest scope consistent with the claims.
[0017] Figure 1 This is a flow chart of an OCR recognition method based on machine learning provided by an embodiment of the present application. The OCR recognition method based on machine learning is introduced in detail below.
[0018] Step S110, obtaining a current target scanned image block and X past scanned image blocks corresponding to the image to be recognized. The current target scanned image block and the X past scanned image blocks are both preprocessed grayscale images, and each of the X past scanned image blocks is a preprocessed grayscale image before the current target scanned image block.
[0019] Specifically, the image to be identified refers to an original image that needs to be processed or analyzed, such as a document scan, a photo, etc. For example, suppose there is a scan containing the content of a contract, and this scan is the image to be identified. The server needs to perform OCR (optical character recognition) on it to extract the text information therein.
[0020] The current target scanned image block is one of the multiple small blocks (or regions) into which the image to be identified is divided, and is the object currently being processed or analyzed. For example, if the image to be identified is a large contract scan, the server may divide it into multiple 64x64 pixel small blocks. The small block currently being processed is the current target scanned image block.
[0021] The X past scanned image blocks refer to image blocks that have been processed and are located before the current target scanned image block in time or space, and can provide context information to help analyze the current target scanned image block. For example, assuming that the current target scanned image block is a small block in the upper left corner of the second page of the contract scan. Then, the small block at the corresponding position in the first page and the several small blocks before it in the second page are the past scanned image blocks.
[0022] In one scenario of this embodiment, the server receives an image to be identified, which may be a scanned copy of a contract containing various texts and business information. First, the server may pre-process the image to be identified and convert it into a grayscale image for subsequent analysis and processing.
[0023] Next, the server can perform image region segmentation on the preprocessed grayscale image to generate K image data blocks. For example, the server can segment the image to be identified into multiple small blocks of a fixed size (such as 64x64 pixels) according to the size and features of the image to be identified. Then, the server can perform feature mapping on each image data block to generate the corresponding target scan image block. Feature mapping can include operations such as contrast enhancement and edge detection to highlight the key information in the image to be identified.
[0024] Finally, the server determines the target scan image block currently being processed (e.g., the block number currently being processed) among the K target scan image blocks, and obtains X past scan image blocks before the target scan image block, where the past scan image blocks are arranged in chronological order and represent continuous image blocks during the scanning process.
[0025] Step S120, when Y key business feature node vectors of the current target scanned image block are extracted, Z single-dimensional spatial gradients and Z composite-dimensional spatial gradients corresponding to the current target scanned image block are obtained based on the Y key business feature node vectors.
[0026] In detail, the key business feature node vector refers to a feature vector extracted from the current target scanned image block and representing a key business feature (such as text, seal, signature, etc.). For example, in a contract scan, a text line, a seal outline, etc. may be regarded as a key business feature. The server extracts a key business feature node vector from these features through a feature extraction algorithm, and each key business feature node vector represents the key information of a feature.
[0027] The single-dimensional spatial gradient refers to the rate of change or difference of the key business feature node vector in a single dimension, reflecting the changing trend of the feature in a certain direction. For example, suppose there are two key business feature node vectors, representing the position and inclination of two text lines respectively. By calculating the difference between these two vectors in the inclination dimension, a single-dimensional spatial gradient can be obtained, which represents the changing trend of the text line inclination.
[0028] The composite dimensional space gradient refers to the comprehensive change rate or difference of the key business feature node vector in multiple dimensions, reflecting the comprehensive change trend of the feature in multiple directions. Taking the above text line as an example, in addition to the inclination dimension, the height, width and other dimensions of the text line can also be considered. By calculating the comprehensive differences in these dimensions, a composite dimensional space gradient can be obtained, which represents the comprehensive change trend of the text line in multiple dimensions.
[0029] That is, in one scenario of this embodiment, the server performs feature extraction on the current target scanned image block to generate Y key business feature node vectors, which may represent different business features such as text, lines, seals, etc. in the image.
[0030] Next, the server performs gradient calculation on the Y key business feature node vectors to generate (Y-1) gradient parameters. Each gradient parameter represents the rate of change between adjacent feature node vectors, i.e., a single-dimensional spatial gradient. The server selects Z single-dimensional spatial gradients that are most relevant to the current target scanned image block.
[0031] Then, the server performs advanced gradient calculation on (Y-1) single-dimensional spatial gradients to generate (Y-2) composite dimensional spatial gradients, which represent the comprehensive change rate between multiple feature node vectors. The server also selects Z composite dimensional spatial gradients that are most relevant to the current target scanned image block.
[0032] Step S130, extracting Y past business feature node vectors corresponding to each of the past scanned image blocks, and The business adaptation vector corresponding to the current target scanned image block is determined by using past business feature node vectors.
[0033] In detail, the past business feature node vector refers to a feature vector representing a key business feature extracted from a past scanned image block, which is similar to the key business feature node vector in the current target scanned image block, but belongs to a previously processed image block. For example, suppose that when processing a scanned contract, the server has processed the first page of the contract and extracted multiple key business feature node vectors (such as text lines, seal outlines, etc.). When processing the second page, these feature vectors extracted from the first page are the past business feature node vectors.
[0034] The business adaptation vector is a vector that integrates the information of multiple past business feature node vectors and is used to describe the change trend or pattern of business features in the context of the current target scanned image block. It can be dynamically adjusted according to the features in the past scanned image blocks to adapt to different business scenarios. For example, consider a scanned contract containing multiple pages, in which some features (such as signature position, text format, etc.) may vary from page to page, but there is a certain regularity. The business adaptation vector can learn and predict the possible changes in business features in the current target scanned image block by analyzing the features in these past scanned image blocks, thereby more accurately identifying and processing the current image block.
[0035] Therefore, in a scenario of this embodiment, the server traverses X past scanned image blocks, and extracts Y past business feature node vectors for each past scanned image block, and these past business feature node vectors reflect the historical changes of business features in the image.
[0036] Then, the server determines the business adaptation vector associated with the current target scanned image block by analyzing these past business feature node vectors. The business adaptation vector may include information such as the feature change rate and trend between past scanned image blocks, which is used to predict the business features in the current target scanned image block.
[0037] Step S140, the Y key business feature node vectors, the Z single-dimensional space gradients, the Z composite-dimensional space gradients and the business adaptation vector are loaded into the target OCR business shielding recognition network, and the target OCR business shielding recognition network is used to generate a target business shielding window corresponding to the current target scanned image block. The target business shielding window is used to shield the business interference content in the image to be recognized, and generate a candidate recognition image corresponding to the image to be recognized.
[0038] In detail, the target OCR business shielding recognition network is a deep learning network model used to shield interference content in the OCR business. It accepts a series of feature vectors (such as key business feature node vectors, spatial gradients, etc.) and business adaptation vectors as input, and outputs a business shielding window to indicate the area that needs to be shielded in the image to be recognized. For example, suppose there is a scanned copy of a contract that contains multiple elements such as text, seals, and handwritten signatures. In order to more accurately recognize the text content, the server needs to use OCR technology. However, interference elements such as seals and signatures may affect the accuracy of OCR. The target OCR business shielding recognition network can predict and generate a business shielding window by learning the features in the past scanned image blocks, shielding interference elements such as seals and signatures, thereby generating a candidate recognition image containing only text content, thereby improving the accuracy of OCR.
[0039] The target business masking window is a binary image (or similar data structure) that indicates the area in the image to be recognized that needs to be masked. In the OCR business, this target business masking window is usually used to mask out interference content such as seals and signatures in contract scans in order to more accurately recognize text. For example, consider a contract scan that contains a seal and a signature. The target OCR business masking recognition network generates a target business masking window, which is 1 (indicating that it needs to be masked) at the location of the seal and signature, and 0 (indicating retention) at other locations. Applying this window to the original scan will result in a candidate recognition image containing only text content.
[0040] The candidate recognition image is an image to be recognized after business shielding processing, which is used for subsequent OCR recognition or other image processing tasks. Compared with the original image to be recognized, the interference content in the candidate recognition image is shielded or removed, thereby improving the accuracy and efficiency of subsequent processing. For example, in the OCR processing of a contract scan, the server first generates a target business shielding window to shield interference content such as seals and signatures. Then, this target business shielding window is applied to the original scan to obtain a candidate recognition image containing only text content. Finally, the server performs OCR recognition on this candidate recognition image to extract the text information therein. Since the interference content has been shielded, the accuracy of OCR recognition will be greatly improved.
[0041] Therefore, in one scenario of this embodiment, the server takes the Y key business feature node vectors, Z single-dimensional spatial gradients, Z composite-dimensional spatial gradients and business adaptation vector of the current target scanned image block as input and loads them into a pre-trained target OCR business shielding recognition network.
[0042] The target OCR business shielding recognition network generates a target business shielding window based on the input feature information. The target business shielding window accurately identifies the business interference content (such as seals, handwritten signatures, etc.) that needs to be shielded in the current target scanned image block.
[0043] Finally, the server applies the target business masking window to the image to be identified, shielding the business interference content and generating a candidate identification image. The candidate identification image only contains the key information (such as the contract text) in the image to be identified, which is convenient for subsequent OCR recognition and processing.
[0044] Based on the above steps, the embodiment of the present application significantly improves the accuracy and efficiency of OCR recognition by comprehensively utilizing the key business feature node vector, single-dimensional spatial gradient, composite dimensional spatial gradient and business adaptive vector of the current target scanned image block, combined with the information of the past scanned image block. Specifically, by introducing the concepts of past scanned image blocks and business adaptive vectors, the present invention can more accurately identify the key business features in the image to be identified, especially in the scenario where there is business interference content. The generation of the target business shielding window effectively shields the business interference content and improves the accuracy of OCR recognition. A target OCR business shielding recognition network is adopted, which can quickly generate a target business shielding window based on the extracted feature vector and gradient information, thereby reducing unnecessary computational overhead and optimizing the efficiency of OCR recognition. The present application is not only applicable to static images to be identified, but also to dynamic image sequences scanned continuously. By considering the information of the past scanned image blocks, it can better adapt to changes in the image sequence and improve the stability and adaptability of recognition. In addition, the embodiment of the present application can be easily integrated into the existing OCR system, and the performance and effect of recognition can be further improved by replacing or upgrading the target OCR business shielding recognition network. Therefore, by introducing the concepts of past scanned image blocks and business adaptive vectors, combined with the target OCR business shielding recognition network, effective shielding of business interference content is achieved, the accuracy and efficiency of OCR recognition are improved, and it has strong adaptability and scalability.
[0045] In a possible implementation, step S110 may include: Step S111 , dividing the image to be recognized into image regions to generate K image data blocks.
[0046] Let's continue to assume that the server is processing a scanned contract containing multiple pages. This scanned contract is the image to be recognized. The contract contains multiple elements such as text, seals, signatures, etc. The server's goal is to extract the text information for subsequent analysis.
[0047] In this embodiment, the server first loads the scanned contract image to be identified into the memory. In detail, the server divides it into multiple image data blocks according to the preset block size (for example, 64x64 pixels) and the size of the scanned document. Each image data block is an independent, smaller image area. In order to facilitate subsequent processing, the server assigns a unique number to each image data block, from 1 to K. Assuming that the scanned contract is divided into 100 image data blocks, then K=100.
[0048] Step S112 , performing feature mapping on each image data block respectively, to generate a target scan image block corresponding to each image data block.
[0049] In this embodiment, the server selects image data blocks one by one for processing according to the serial number sequence.
[0050] For each image data block, the server applies a series of image processing techniques (such as contrast enhancement, edge detection, filtering, etc.) to perform feature mapping. These operations are designed to highlight key information in the image, such as text outlines, seal shapes, etc. After feature mapping, each original image data block is converted into a target scan image block, which not only contains the information of the original block, but also has more prominent features, which is convenient for subsequent analysis. The server saves each target scan image block to memory for use in subsequent steps.
[0051] Step S113: Determine the current target scanned image block and X past scanned image blocks before the current target scanned image block among the K target scanned image blocks, where X is less than K.
[0052] In this embodiment, the server determines the processing order according to the serial number sequence of the image data blocks, for example, the target scanned image blocks may be processed one by one in the order from left to right and from top to bottom.
[0053] During the processing, the server regards the target scanned image block currently being processed as the current target scanned image block. For example, if the server is processing the image data block numbered 50, the corresponding target scanned image block is the current target scanned image block.
[0054] The server traces back X target scanned image blocks as past scanned image blocks according to the number of the current target scanned image block, and these past scanned image blocks provide context information of the current target scanned image block. For example, if X=5, then the target scanned image blocks numbered 45 to 49 are past scanned image blocks.
[0055] The server loads these past scanned image blocks and their related information from memory for use in subsequent analysis.
[0056] Through the above steps, the server successfully obtains the current target scanned image block and X past scanned image blocks corresponding to the image to be identified, laying a foundation for subsequent business feature extraction and analysis.
[0057] In a possible implementation manner, the K image data blocks include an image data block x, where x is a positive integer not greater than K.
[0058] Step S112 includes: Step S1121, extracting features from the image data block x to generate reference feature points and 2T feature points of the image data block x in a feature space. The 2T feature points include T feature points associated with a first feature point attribute and T feature points associated with a second feature point attribute.
[0059] In this embodiment, the server is processing a scanned contract containing multiple pages, which is divided into K image data blocks. Now, the server will perform feature mapping for each image data block (here, image data block x is taken as an example) to generate a corresponding target scanned image block.
[0060] The server first selects the image data block x for processing according to the number of the image data block. Then, it applies a predefined feature extraction algorithm (such as SIFT, SURF, etc.) to extract features from the image data block x. These algorithms can extract key points (i.e., feature points) and the descriptors (i.e., feature vectors) of these key points from the image.
[0061] After being processed by the feature extraction algorithm, the server generates multiple feature points in the image data block x, including a reference feature point and 2T other feature points. The reference feature point is usually selected based on some criteria (such as the first detected feature point or the center point of a feature point set) for subsequent feature mapping and comparison.
[0062] The server further divides the 2T feature points into two categories, each containing T feature points, and the two categories of feature points are associated with different feature point attributes. For example, the first category of feature points may be related to the features of the text area (such as the outline and spacing of the text), while the second category of feature points may be related to the features of the non-text area (such as seals, pictures, etc.).
[0063] Step S1122, obtaining T feature points associated with the first feature point attribute from the 2T feature points, and determining a target scanned image block corresponding to the image data block x according to the T feature points associated with the first feature point attribute and the reference feature point.
[0064] In this embodiment, the server selects T feature points associated with the first feature point attribute from the 2T feature points, and these feature points represent information related to a specific business feature (such as text) in the image data block x.
[0065] Next, mapping is performed on the original image data block x based on the positions, descriptors, and other information of these T feature points and the reference feature points. The mapping process may include operations such as scaling, rotation, and translation, aiming to highlight the business features represented by these feature points.
[0066] After feature point mapping, the server generates a new image, namely the target scanned image block corresponding to the image data block x. While retaining the original image information, the target scanned image block further highlights the business features (such as text) associated with the attributes of the first feature point, facilitating subsequent business feature analysis and identification.
[0067] The server saves the generated target scan image block to the memory for use in subsequent steps. At the same time, the server can repeat the above process to perform feature mapping on all image data blocks to generate a corresponding target scan image block set.
[0068] Through the above steps, the server successfully performs feature mapping on each image data block and generates the corresponding target scan image blocks, laying the foundation for subsequent business feature analysis and identification.
[0069] In a possible implementation, the current target scanned image block includes T1 feature points, the T1 feature points include a reference feature point and T2 feature points associated with feature point attributes, and the method further includes: Step A110: Map the T1 feature points to Y feature space domains. T1 is not less than Y.
[0070] Step A120, performing feature transformation processing on each feature space domain respectively, to generate a key business feature node vector corresponding to each feature space domain.
[0071] In this embodiment, when the server processes a current target scanned image block of the contract scan, it finds that the image block contains T1 feature points, which include a reference feature point and T2 feature points associated with specific business features (such as text, seal, etc.). The server will then use these feature points to generate key business feature node vectors through mapping and feature transformation processing for further analysis and identification.
[0072] In detail, the server first determines T1 feature points in the current target scanned image block, where the feature points include a reference feature point and T2 feature points associated with business feature attributes.
[0073] The server predefines Y feature space domains, each of which corresponds to one or more business feature attributes. For example, feature space domain 1 may correspond to text features, feature space domain 2 may correspond to seal features, and so on.
[0074] Next, the server maps T1 feature points to Y feature space domains. This process may involve the classification and allocation of feature points to ensure that each feature point is mapped to the most appropriate feature space domain according to its attributes. The mapping result is a correspondence between a set of feature points and feature space domains, that is, each feature space domain contains a portion of feature points related to its attributes.
[0075] For each feature space domain, the server extracts all feature points mapped to the domain, and these feature points collectively reflect the business feature attributes corresponding to the feature space domain.
[0076] The server performs feature transformation processing on the feature points in each feature space domain. The purpose of feature transformation processing is to convert the original feature points into more representative and discriminative feature vectors for subsequent analysis and recognition. Feature transformation processing can include operations such as dimensionality reduction, standardization, and normalization, as well as feature extraction and transformation using machine learning algorithms (such as principal component analysis PCA, linear discriminant analysis LDA, etc.).
[0077] After feature transformation processing, the server generates a key business feature node vector for each feature space domain. The vector is a representation of a high-dimensional space and contains comprehensive information of all feature points in the feature space domain, which can effectively describe and characterize the corresponding business feature attributes.
[0078] The server saves the generated key business feature node vector to the memory for use in subsequent steps. At the same time, the server can repeat the above process to process all feature space domains and generate a complete set of key business feature node vectors.
[0079] Through the above steps, the server successfully maps the feature points in the current target scanned image block to multiple feature space domains, and generates key business feature node vectors through feature transformation processing, providing important input data for subsequent business feature analysis and identification.
[0080] In a possible implementation, the Y feature space domains include a feature space domain y, where y is a positive integer not greater than Y.
[0081] Step A120 includes: Step A121, extracting the spatial domain vector of the feature spatial domain y, normalizing the spatial domain vector of the feature spatial domain y, and generating a normalized spatial domain vector of the feature spatial domain y.
[0082] In this embodiment, when processing the current target scanned image block of the contract scanned document, the server has determined the key feature points contained in the image block and mapped these feature points to multiple feature space domains. Now, the server will perform feature transformation processing on one of the feature space domains (assuming it is feature space domain y) to generate a corresponding key business feature node vector.
[0083] In detail, the server first determines the feature space domain y to be processed, which may correspond to a specific business feature, such as text, seal, etc. The server extracts all feature points assigned to the feature space domain y during the feature mapping process, which represent the key business features in the feature space domain.
[0084] Next, the server generates a spatial domain vector based on the position, direction, intensity and other attributes of these feature points. The spatial domain vector is a multi-dimensional representation that contains the comprehensive information of all feature points in the feature space domain y.
[0085] Since different feature points may have values at different scales or ranges, directly using the original spatial domain vector may cause the information of some feature points to be obscured or exaggerated. Therefore, the server needs to normalize the spatial domain vector to make it have a uniform scale for subsequent analysis and processing.
[0086] The server processes the spatial domain vector using a commonly used normalization method (such as Min-Max normalization, Z-score normalization, etc.). For example, when using the Min-Max normalization method, the server can find the maximum and minimum values in the spatial domain vector and then scale the value of each element to between 0 and 1.
[0087] After normalization, the server generates a normalized spatial domain vector, which maintains the shape and structure of the original spatial domain vector, but the values of all elements are scaled to a uniform scale.
[0088] Step A122, performing principal component analysis transformation on the normalized space domain vector of the feature space domain y to generate a key business feature node vector corresponding to the feature space domain y.
[0089] Principal component analysis is a commonly used dimensionality reduction technique that can project high-dimensional data into a low-dimensional space while retaining the main variation information in the data. Here, the server uses PCA to process the normalized spatial domain vector to extract the main business feature information in the feature space domain y and generate a key business feature node vector.
[0090] The server first calculates the covariance matrix of the normalized space domain vector, and then solves the eigenvalues and eigenvectors of the matrix. Next, the server selects the eigenvectors corresponding to the first few largest eigenvalues as the principal component directions, and projects the normalized space domain vector onto these principal component directions.
[0091] The result after projection is the key business feature node vector corresponding to the feature space domain y. This vector is a low-dimensional representation that contains the main business feature information in the feature space domain y and can be effectively used for subsequent business feature analysis and identification.
[0092] The server saves the generated key business feature node vector to the memory for use in subsequent steps. At the same time, the server can repeat the above process to process all feature space domains and generate a complete set of key business feature node vectors.
[0093] Through the above steps, the server successfully performs feature transformation processing on the feature space domain y and generates the corresponding key business feature node vector, providing strong support for subsequent business feature analysis and identification.
[0094] In a possible implementation, step S120 may include: Step S121, perform gradient calculation on the Y key business feature node vectors to generate (Y-1) gradient parameters, use each of the (Y-1) gradient parameters as the single-dimensional spatial gradient of the corresponding key business feature node vector, and obtain Z single-dimensional spatial gradients corresponding to the current target scanned image block from the (Y-1) single-dimensional spatial gradients.
[0095] In this embodiment, when processing a current target scanned image block of the contract scanned document, the server has generated Y key business feature node vectors through feature mapping and feature transformation. Now, the server needs to calculate Z single-dimensional spatial gradients and Z composite-dimensional spatial gradients corresponding to the current target scanned image block based on these key business feature node vectors.
[0096] Specifically, the server first performs gradient calculation on Y key business feature node vectors. Gradient calculation is a process of measuring the rate of change between vectors, which reflects the change trend of the vector in a certain dimension. The server can obtain the gradient parameter by calculating the difference or ratio between adjacent vectors.
[0097] After gradient calculation, the server obtains (Y-1) gradient parameters, because for Y vectors, only Y-1 pairs of adjacent vectors can be used for gradient calculation. Each gradient parameter corresponds to the change rate between a pair of adjacent key business feature node vectors.
[0098] The server regards each gradient parameter as a single-dimensional spatial gradient of the corresponding key business feature node vector. The single-dimensional spatial gradient reflects the change trend of the vector in a single dimension, which helps to identify local changes in business features in the image.
[0099] Since the server only needs Z single-dimensional spatial gradients, it selects the Z gradients most relevant to the current target scanned image block from the (Y-1) single-dimensional spatial gradients as the final single-dimensional spatial gradients. The selection process may be based on factors such as the size, direction, or relevance of the gradient to the business feature.
[0100] Step S122, perform advanced gradient calculation on the (Y-1) single-dimensional spatial gradients to generate (Y-2) gradient parameters, use each of the (Y-2) gradient parameters as the composite dimensional spatial gradient of the corresponding key business feature node vector, and obtain Z composite dimensional spatial gradients corresponding to the current target scanned image block from the (Y-2) composite dimensional spatial gradients.
[0101] In this embodiment, the server then performs advanced gradient calculation on (Y-1) single-dimensional spatial gradients. Advanced gradient calculation is a process that considers the relationship between multiple single-dimensional gradients, which reflects the comprehensive change trend of the vector in multiple dimensions. The server can obtain the advanced gradient parameter by calculating the difference or ratio between adjacent single-dimensional gradients.
[0102] After the advanced gradient calculation, the server obtains (Y-2) advanced gradient parameters. This is because for Y-1 single-dimensional gradients, only Y-2 pairs of adjacent gradients can be advanced. Each advanced gradient parameter corresponds to the comprehensive change trend between a pair of adjacent single-dimensional spatial gradients.
[0103] The server regards each advanced gradient parameter as the composite dimensional spatial gradient of the corresponding key business feature node vector. The composite dimensional spatial gradient reflects the comprehensive change trend of the vector in multiple dimensions, which helps to identify the global change pattern of business features in the image.
[0104] Similarly, the server selects the Z gradients most relevant to the current target scanned image block from the (Y-2) composite dimensional spatial gradients as the final composite dimensional spatial gradient. The selection process may also be based on factors such as the size, direction, or relevance of the gradient to the business feature.
[0105] Through the above steps, the server successfully calculates Z single-dimensional spatial gradients and Z composite-dimensional spatial gradients corresponding to the current target scanned image block. These gradient information will be used for subsequent business feature analysis and recognition processes.
[0106] In a possible implementation, step S130 includes: Step S131, among the X past scanned image blocks, obtaining past scanned image blocks with regional connections as the first past scanned image block and the second past scanned image block. The second past scanned image block is a preprocessed grayscale image generated after the first past scanned image block.
[0107] In this embodiment, when processing a scanned document containing multiple pages of a contract, the server has determined the current target scanned image block currently being processed, and hopes to determine a business adaptation vector based on X past scanned image blocks that have been processed before, so as to better understand and process the current target scanned image block.
[0108] In detail, the server first analyzes X past scanned image blocks and identifies those past scanned image blocks that are adjacent or close to the current target scanned image block in spatial position. There are regional connections between these image blocks because they may belong to consecutive pages of the contract or different regions of the same page.
[0109] The server selects two consecutive image blocks from the past scanned image blocks with regional connections as the first past scanned image block and the second past scanned image block, assuming that the second past scanned image block is processed after the first past scanned image block, that is, their positions in the contract are consecutive.
[0110] Step S131, extracting Y past service feature node vectors corresponding to the first past scanned image block in the storage space associated with the current target scanned image block, and extracting Y past service feature node vectors corresponding to the second past scanned image block.
[0111] In this embodiment, the server searches for the processing results of the first past scanned image block and the second past scanned image block in the storage space associated with the current target scanned image block, and these results include their respective corresponding Y past service feature node vectors.
[0112] The server extracts Y past service feature node vectors of the first past scanned image block from the storage space as the first past service feature node vector. Similarly, it also extracts Y past service feature node vectors of the second past scanned image block as the second past service feature node vector.
[0113] Step S132: taking the Y past business feature node vectors corresponding to the first past scanned image block extracted as the first past business feature node vector, and taking the Y past business feature node vectors corresponding to the second past scanned image block extracted as the second past business feature node vector.
[0114] In this embodiment, the server selects feature vectors with the same position in the first past service feature node vector and the second past service feature node vector for comparison. For example, Hg in the first past service feature node vector and Hf in the second past service feature node vector may be selected, where g and f are the indexes of the vectors in their respective sets, and g is equal to f.
[0115] The server calculates the vector distance between Hg and Hf, which may be the Euclidean distance, the Manhattan distance, or other suitable distance metrics, which reflects the degree of difference between the two feature vectors.
[0116] Step S133, obtaining a past service feature node vector Hg from the Y past service feature node vectors covered by the first past service feature node vector, and obtaining a past service feature node vector Hf from the Y past service feature node vectors covered by the second past service feature node vector. Both g and f are not greater than Y, and g=f.
[0117] Step S134: extracting the vector distance between the past service feature node vector Hg and the past service feature node vector Hf.
[0118] Step S135: determining a characteristic distance between the first past service characteristic node vector and the second past service characteristic node vector according to the vector distance, and using the characteristic distance as an inter-block distinguishing parameter between the first past scanned image block and the second past scanned image block.
[0119] In this embodiment, the server uses the calculated vector distance as the characteristic distance between the first past service feature node vector and the second past service feature node vector. The characteristic distance represents the difference between the two past scanned image blocks in terms of service features.
[0120] The server regards the characteristic distance as an inter-block difference parameter between the first past scanned image block and the second past scanned image block, and the inter-block difference parameter helps the server understand the change pattern and trend between the past scanned image blocks.
[0121] Step S136: When each associated past scanned image block among the X past scanned image blocks is used as the first past scanned image block and the second past scanned image block, an inter-block distinction parameter between the X past scanned image blocks is generated, and a service adaptation vector corresponding to the current target scanned image block is determined according to the inter-block distinction parameter between the X past scanned image blocks.
[0122] The server repeats the above steps to calculate all pairs of past scanned image blocks that have regional connections, and generates multiple inter-block distinguishing parameters between the X past scanned image blocks.
[0123] Comprehensive analysis: The server conducts a comprehensive analysis of the different parameters between these blocks, taking into account factors such as their size and change trend, to determine a business adaptation vector. The business adaptation vector reflects the changing rules and patterns of business features in the past scanned image blocks, which helps the server better understand and process the current target scanned image blocks.
[0124] Through the above steps, the server successfully determines the business adaptation vector corresponding to the current target scanned image block based on the business feature node vectors in the past scanned image blocks, providing valuable reference information for subsequent image analysis and processing.
[0125] In a possible implementation manner, the target OCR service masking identification network includes a service masking window prediction unit and a service masking window generation unit.
[0126] Step S140 may include: Step S141, taking the Y key business feature node vectors, the Z single-dimensional spatial gradients, the Z composite-dimensional spatial gradients and the business adaptive vector as the target image knowledge features of the current target scanned image block, loading the target image knowledge features into the business shielding window prediction unit, and using the business shielding window prediction unit to perform business shielding window prediction on the target image knowledge features, to generate business shielding window prediction features corresponding to the target image knowledge features.
[0127] In this embodiment, when processing a contract scan, the server has extracted Y key business feature node vectors, Z single-dimensional spatial gradients, Z composite-dimensional spatial gradients, and business adaptive vectors of the current target scanned image block. Now, the server is ready to use these feature information to generate a target business shielding window through the target OCR business shielding recognition network to shield out interfering content in the contract, such as seals, signatures, etc.
[0128] In detail, the server combines Y key business feature node vectors, Z single-dimensional spatial gradients, Z composite-dimensional spatial gradients and business adaptation vectors to form a complete target image knowledge feature set, which includes the key business features of the current target scanned image block and its spatial change trends, as well as the change patterns of business features in past scanned image blocks.
[0129] The server may need to perform format conversion or standardization on these feature data to ensure that they can be correctly received and processed by the target OCR service mask recognition network.
[0130] Next, the server loads the prepared target image knowledge features into the service shielding window prediction unit in the target OCR service shielding recognition network, and the prediction unit is responsible for predicting a rough service shielding window range based on the input feature information.
[0131] The business shielding window prediction unit may contain multiple neural network layers or computing modules, which will perform a series of complex calculations and transformations on the input target image knowledge features. These calculations may include operations such as convolution, pooling, and full connection, aiming to extract and integrate key elements in the feature information.
[0132] After the prediction calculation, the service shielding window prediction unit outputs a service shielding window prediction feature, which is an intermediate result. It contains information such as the predicted position, size, shape, etc. of the service shielding window, but may not be accurate or complete enough.
[0133] Step S142: loading the service shielding window prediction features into the service shielding window generation unit, integrating the service shielding window prediction features by using the service shielding window generation unit, and generating a target service shielding window corresponding to the current target scanned image block.
[0134] In this embodiment, the server loads the service shielding window prediction feature into the service shielding window generation unit in the target OCR service shielding recognition network, and the service shielding window generation unit is responsible for generating an accurate and complete target service shielding window according to the prediction feature.
[0135] The service shielding window generation unit may include some optimization algorithms or post-processing steps to further integrate and optimize the prediction features. For example, it may use morphological operations to smooth the window edges, fill internal holes, or remove noise points; it may also use interpolation algorithms to refine the window boundaries or adjust its size.
[0136] After integration and optimization, the business shielding window generation unit outputs an accurate and complete target business shielding window, which accurately identifies the areas that need to be shielded in the current target scanned image block (such as seals, signatures, etc.) so that these interfering contents can be ignored in the subsequent OCR recognition process.
[0137] Through the above steps, the server successfully generates an accurate and complete target business masking window using the target OCR business masking recognition network, providing strong support for subsequent OCR recognition.
[0138] In a possible implementation manner, the service shielding window prediction unit includes a first service shielding window prediction unit, a second service shielding window prediction unit, and a third service shielding window prediction unit which are cascaded across units.
[0139] Step S141 may include: Step S1411: Load the target image knowledge feature into the first service shielding window prediction unit, and use the first service shielding window prediction unit to generate a first temporary service shielding feature.
[0140] In this embodiment, when processing the contract scan, the server has extracted the target image knowledge features, including key business feature node vectors, single-dimensional spatial gradients, composite-dimensional spatial gradients, and business adaptive vectors. Now, the server is ready to load these features into the business shielding window prediction unit to generate business shielding window prediction features. The prediction unit consists of the first, second, and third business shielding window prediction units that are cascaded across units.
[0141] In detail, the server first prepares the target image knowledge feature set, ensuring that they have been properly formatted and standardized. The server loads these target image knowledge feature sets into the first business shielding window prediction unit, which is usually a neural network or machine learning model responsible for preliminary processing and analysis of input features.
[0142] The first service shielding window prediction unit performs preliminary calculation and analysis on the input features, extracts key service feature information, and generates first temporary service shielding features, which may contain information about the preliminary position and shape of the potential service shielding window.
[0143] Step S1412, based on the cross-unit cascade between the first business shielding window prediction unit and the second business shielding window prediction unit, the first temporary business shielding feature and the target image knowledge feature are integrated to generate a second temporary business shielding feature, the second temporary business shielding feature is loaded into the second business shielding window prediction unit, and the second business shielding window prediction unit is used to generate a third temporary business shielding feature.
[0144] In this embodiment, the server uses a cross-unit cascading mechanism between the first service shielding window prediction unit and the second service shielding window prediction unit. This cascading is usually achieved by using the output of the first prediction unit as the input of the second prediction unit.
[0145] The server not only transmits the first temporary service shielding feature to the second prediction unit, but also transmits the original target image knowledge feature together, in order to further integrate and utilize this information in the second prediction unit.
[0146] The second service shielding window prediction unit receives the integrated feature information and performs more in-depth calculation and analysis. It may use a more complex network structure or algorithm to generate a more accurate and complete service shielding window prediction. After processing, the second prediction unit outputs the second temporary service shielding feature.
[0147] Step S1413, based on the cross-unit cascade between the first business shielding window prediction unit and the third business shielding window prediction unit and the cross-unit cascade between the second business shielding window prediction unit and the third business shielding window prediction unit, the third temporary business shielding feature, the target image knowledge feature and the first temporary business shielding feature are integrated to generate a fourth temporary business shielding feature, the fourth temporary business shielding feature is loaded into the third business shielding window prediction unit, and the third business shielding window prediction unit is used to generate a business shielding window prediction feature corresponding to the target image knowledge feature.
[0148] In this embodiment, the server not only utilizes the cross-unit cascade between the first prediction unit and the third prediction unit, but also utilizes the cascade between the second prediction unit and the third prediction unit, which means that the third prediction unit can receive the outputs from the first two prediction units and the original feature information.
[0149] The server deeply integrates the third temporary service shielding feature, the target image knowledge feature and the first temporary service shielding feature. This integration may involve re-weighting, combining or transforming the features to extract higher-level information.
[0150] The integrated feature information is loaded into the third business shielding window prediction unit, which is usually the most complex and advanced, and uses more powerful algorithms and models to generate the final business shielding window prediction features. After a series of complex calculations and analyses, the third prediction unit outputs the business shielding window prediction features corresponding to the target image knowledge features.
[0151] Through the above steps, the server uses multiple business shielding window prediction units that are cascaded across units to gradually extract and integrate feature information, and finally generates accurate and complete business shielding window prediction features. These prediction features will serve as the basis for subsequent business shielding window generation, helping the server to accurately identify and shield interference content in contract scans.
[0152] In a possible implementation, after step S140, the method further includes: Step S150, performing interpolation operation on the target service masking window to generate an interpolated service masking window. The window parameters of the interpolated service masking window are the same as the window parameters of the current target scanned image block.
[0153] In this embodiment, the server has generated a target business shielding window for the current target scanned image block using the target OCR business shielding recognition network. Now, the server will perform further interpolation operations on this business shielding window to more accurately shield the interfering content in the contract scan, such as seals, signatures, etc. Then, the server will use the interpolated business shielding window to perform element-by-element shielding fusion on the current target scanned image block, and finally generate a candidate recognition image.
[0154] In detail, the server first analyzes the target service shielding window to identify possible defects or deficiencies therein, which may include irregularities of the window edges, internal holes or breaks, etc.
[0155] In order to perform interpolation operations, the server needs to determine the target area and interpolation method. The target area is usually the defective part of the window, and the interpolation method can be selected according to specific needs, such as interpolation based on neighboring pixels, morphological operations, etc.
[0156] The server performs interpolation operations on the target service masking window according to the selected interpolation method. For example, if the interpolation method based on neighboring pixels is used, the server can calculate the values of pixels near the edge of the window and use these values to fill the holes or broken parts inside the window. After the interpolation operation, the server generates an interpolated service masking window whose window parameters (such as size, position, etc.) are the same as those of the target scanned image block.
[0157] Step S160, performing element-by-element masking fusion on the interpolation service masking window and the current target scanned image block, transforming the element-by-element masking fusion result, and generating target scanned image data after service masking of the current target scanned image block.
[0158] In this embodiment, the server prepares the interpolation service masking window and the current target scan image block to ensure that their sizes and positions are aligned.
[0159] The server performs masking fusion of the interpolation service masking window and the current target scanned image block element by element. During the fusion process, the server can check each pixel value in the interpolation service masking window. If the pixel value is 1 (indicating that masking is required), the server sets the pixel value of the corresponding position in the current target scanned image block to a specific masking value (such as black or transparent) to mask out the pixel. If the pixel value is 0 (indicating retention), the server retains the original pixel value of the corresponding position in the current target scanned image block.
[0160] In order to eliminate jagged or other unnatural phenomena that may appear on the mask edge, the server may smooth the mask fusion result. This smoothing can be achieved through morphological operations (such as erosion, dilation, opening operation, closing operation, etc.).
[0161] Step S170, after each current target scan image block corresponding to the image to be identified is service-shielded, a candidate identification image corresponding to the image to be identified is generated, wherein the candidate identification image is composed of the target scan image data after service shielding.
[0162] In this embodiment, the server repeats the above interpolation operation and element-by-element masking and fusion steps to process each current target scan image block corresponding to the image to be identified. Each processed target scan image block contains interference content that is accurately masked.
[0163] The server combines all processed target scan image blocks according to their positions in the original image to be identified to generate a complete candidate identification image. The candidate identification image is composed of the target scan image data after business shielding and only contains the key information in the contract scan (such as text content), while the interfering content (such as seals, signatures, etc.) has been accurately shielded.
[0164] Through the above steps, the server successfully uses interpolation operations and element-by-element masking fusion technology to generate an accurate candidate recognition image, providing high-quality input data for subsequent OCR recognition or other image analysis tasks.
[0165] In a possible implementation, before step S110, the method further includes: Step S101, obtaining a target example target scan image block and X past example scan image data corresponding to the example scan image data, and extracting an example business shielding window corresponding to the target example target scan image block. The target example target scan image block and the X past example target scan image blocks are both pre-processed grayscale images, and each of the X past example target scan image blocks is a pre-processed grayscale image before the target example target scan image block.
[0166] In this embodiment, before the server formally processes the image to be recognized, it is necessary to first train an OCR recognition network for business shielding. The training process uses a set of example scanned image data, and optimizes the parameters of the sample OCR business shielding recognition network by extracting key features and information from the example data, and finally generates a target OCR business shielding recognition network that can accurately predict the business shielding window.
[0167] In detail, the server selects a set of representative sample scanned image data from the database. These sample scanned image data are usually pre-labeled and include scanned copies of various contracts, documents, etc.
[0168] The server preprocesses the selected sample scanned image data, including denoising, binarization, grayscale conversion and other operations, to generate a preprocessed grayscale image.
[0169] The server divides the preprocessed example scan image into a plurality of target example target scan image blocks, each of which represents an independent processing unit.
[0170] For each target example target scanned image block, the server extracts the example business shielding window from its corresponding annotation information, which accurately identifies the area in the image block that needs to be shielded (such as a seal, signature, etc.).
[0171] Step S102, when Y target example business feature node vectors of the target example target scan image block are extracted, Z example single-dimensional spatial gradients and Z example composite-dimensional spatial gradients corresponding to the target example target scan image block are obtained based on the Y target example business feature node vectors.
[0172] In this embodiment, the server extracts features from each target example target scanned image block and generates Y target example business feature node vectors, which describe the key business features in the image block. Based on the extracted target example business feature node vectors, the server calculates Z example single-dimensional spatial gradients and Z example composite-dimensional spatial gradients, which reflect the changing trends of features in spatial and composite dimensions.
[0173] Step S103, extracting Y past example business feature node vectors corresponding to each of the past example target scan image blocks, and The example service adaptation vector corresponding to the target example target scanned image block is determined by using the past example service feature node vectors.
[0174] In this embodiment, the server also extracts Y past example business feature node vectors corresponding to each past example target scan image block, and these vectors represent the business feature change history in the image block sequence. The example service feature node vectors are used to calculate an example service adaptation vector, which integrates the change rules of service features in the past image blocks and is used to predict the service features of the current image block.
[0175] Step S104, loading the Y target example business feature node vectors, the Z example single-dimensional spatial gradients, the Z example composite-dimensional spatial gradients and the example business adaptive vector into a sample OCR business masking recognition network, and using the sample OCR business masking recognition network to generate a training business masking window corresponding to the target example target scan image block.
[0176] In this embodiment, the server loads Y target example service feature node vectors, Z example single-dimensional space gradients, Z example composite-dimensional space gradients, and example service adaptation vectors into the sample OCR service shielding recognition network.
[0177] The sample OCR business mask recognition network generates a training business mask window based on the loaded feature information, and the training business mask window is the network's prediction result for the target example target scan image block.
[0178] Step S105, optimizing the parameters of the sample OCR business shielding recognition network according to the training business shielding window and the example business shielding window, generating a target OCR business shielding recognition network for predicting a target business shielding window corresponding to the current target scanned image block corresponding to the image to be recognized. The target business shielding window is used to shield the business interference content in the image to be recognized, and generate a candidate recognition image corresponding to the image to be recognized.
[0179] In this embodiment, the server compares the generated training service masking window with the real example service masking window and calculates the difference or loss between the two. Based on the calculated loss, the server adjusts the parameters of the sample OCR service masking recognition network through the back propagation algorithm to reduce the difference between the predicted window and the real window.
[0180] The server repeats the process of step S104 and step S105, and performs multiple rounds of iterative optimization on the sample OCR service shielding recognition network until the accuracy of the prediction window meets the preset standard.
[0181] After multiple rounds of iterative optimization, the parameters of the sample OCR service shielding recognition network have been fully trained and optimized. The server uses this trained network as the target OCR service shielding recognition network for subsequent prediction and generation of service shielding windows for the image to be recognized.
[0182] Through the above steps, the server successfully trained a target OCR business masking recognition network, which can accurately predict and generate a business masking window corresponding to the image to be recognized, providing strong support for subsequent OCR recognition and analysis.
[0183] For example, in a possible implementation, step S150 includes: Step S151 , performing feature analysis on the target service shielding window to generate window feature information, wherein the window feature information includes the size, shape, edge sharpness, and internal hole or break information of the target service shielding window.
[0184] In this embodiment, when the server processes a current target scanned image block of the contract scan, it has generated a target business shielding window. Since the target business shielding window may have irregular edges, internal holes or breaks, the server decides to perform an interpolation operation on it to obtain a more accurate and complete interpolated business shielding window.
[0185] Specifically, the server first performs feature analysis on the target service shielding window to extract basic information such as the window size, shape, edge sharpness, etc. At the same time, the server also checks whether there are holes or broken areas inside the window.
[0186] The server integrates the extracted feature information to form a window feature information set, which describes in detail the current state of the target service shielding window.
[0187] Step S152, adaptively define corresponding structural elements according to the shape and size of the target business shielding window, and use the defined structural elements to perform an expansion operation on the target business shielding window. After the expansion operation, perform an erosion operation on the target business shielding window to restore the original size of the target business shielding window, and generate the target business shielding window after adaptive morphological filtering processing.
[0188] In this embodiment, according to the shape and size of the target service shielding window, the server adaptively defines a corresponding structural element, which is usually a small rectangular or elliptical area for subsequent expansion and erosion operations.
[0189] Next, the server uses the defined structural elements to perform an expansion operation on the target service shielding window. The expansion operation will expand the edge of the window and fill some small holes or broken areas.
[0190] After the expansion operation, the server performs an erosion operation on the window to restore its original size. The erosion operation is actually the reverse process of the expansion operation, which can eliminate the redundant parts that may be generated by the expansion operation.
[0191] After the expansion and erosion operations, the server obtains a target service shielding window after adaptive morphological filtering. The edge of the target service shielding window is smoother, and the internal holes or broken areas are effectively filled.
[0192] Step S153, using the Canny edge detection algorithm or the Sobel algorithm to perform edge detection on the target service shielding window after the adaptive morphological filtering process, to generate edge detection information, wherein the edge detection information is used to determine a specific position that needs to be interpolated.
[0193] In this embodiment, the server selects to use the Canny edge detection algorithm or the Sobel algorithm to perform edge detection on the target service shielding window after the adaptive morphological filtering process.
[0194] The server applies the selected edge detection algorithm to scan the window pixel by pixel, detect and mark the edge of the window. The server integrates the edge detection results into edge detection information, which describes the location, direction and strength of the window edge in detail.
[0195] Step S154: initializing an interpolation grid corresponding to the target service shielding window according to the size and shape of the window, wherein the interpolation grid is used to store interpolated pixel values.
[0196] In this embodiment, the server determines the size of an interpolation grid corresponding to the target service shielding window according to its size and shape, and the size of the interpolation grid is usually the same as the size of the window. Next, the server initializes the interpolation grid and sets all its pixel values to initial values (such as 0 or transparent). The grid will be used to store the pixel values after the interpolation operation.
[0197] Step S155 , determining a target point to be interpolated in the interpolation grid, wherein the target point is a blank area between window edges corresponding to the edge detection information.
[0198] In this embodiment, the server analyzes the edge detection information to determine which areas need to be interpolated, which are usually blank areas between the window edges. The server marks all target points that need to be interpolated in the interpolation grid, and these target points are the pixel positions that need to be interpolated.
[0199] Step S156, for each target point to be interpolated, a corresponding interpolation value is calculated according to known pixel values and edge information around the target point, wherein the interpolation value is weightedly calculated according to the direction and distance of edge pixels adjacent to the target point.
[0200] For each target point that needs to be interpolated, the server obtains the values and edge information of the known pixels around it. These surrounding pixels are usually pixels adjacent to the target point and have been marked as the edge of the window or inside the window. The server calculates the interpolation value of the target point based on the values and edge information of the surrounding pixels. The specific calculation method can include algorithms such as weighted average and linear interpolation, while considering factors such as the direction and distance of adjacent edge pixels. The server fills the calculated interpolation value into the corresponding target point position in the interpolation grid.
[0201] Step S157, repeating the above process until all target points in the interpolation grid are filled, and after the interpolation is completed, generating an interpolation service shielding window.
[0202] The server repeats the process of step S155 and step S156 until all target points in the interpolation grid are filled in. After the interpolation is completed, the server combines the pixel values in the interpolation grid into a complete interpolation service shielding window, which accurately identifies the area to be shielded, has smooth edges, and is intact inside.
[0203] Through the above steps, the server successfully performs interpolation operation on the target service shielding window, generates a more accurate and complete interpolation service shielding window, and provides strong support for subsequent service shielding operations.
[0204] For example, in a possible implementation, step S160 may include: Step S161, aligning the interpolation service masking window with the current target scanned image block in size and position, and if the data types of the interpolation service masking window and the current target scanned image block are different, performing data type conversion on the interpolation service masking window or the current target scanned image block.
[0205] In this embodiment, when processing a scanned copy containing multiple pages of a contract, the server has generated an interpolation business shielding window to shield the interference content in the current target scanned image block. Now, the server is ready to merge this interpolation business shielding window with the current target scanned image block to generate target scanned image data containing only non-business interference content. After that, the server will use the OCR algorithm to perform character recognition and classification on the generated candidate recognition image.
[0206] In detail, the server first ensures that the interpolation service masking window is completely aligned with the current target scanned image block in size and position, which means that the sizes of the two must be the same and the corresponding pixel positions must be consistent. If the data types of the interpolation service masking window and the current target scanned image block are different (for example, one is a binary image and the other is a grayscale image), the server will convert the data type of one of them to ensure compatibility between the two.
[0207] Step S162, traverse each pixel point in the interpolation service masking window and compare it with the pixel points at the corresponding position in the current target scanned image block, wherein in the interpolation service masking window, a binary value is used to represent the area to be masked or retained.
[0208] Step S163, for the pixel points marked as needing to be masked in the interpolation business masking window, the pixel value of the corresponding position in the current target scanned image block is set to a specific masking value, and for the pixel points marked as retained, the pixel value of the corresponding position in the current target scanned image block is kept unchanged. In the masking fusion process, the image morphological operation is used to smooth the edges of the current target scanned image block and the interpolation business masking window.
[0209] Step S164, saving the result after element-by-element masking and fusion as a new target scan image data, which only contains the non-business interference content in the current target scan image block.
[0210] In this embodiment, the server starts to traverse each pixel in the interpolation service shielding window. The pixel in the interpolation service shielding window is represented by a binary value, usually 0 represents retention and 1 represents need to be shielded.
[0211] For each pixel in the interpolation service mask window, the server checks its value. If the value is 1 (i.e. masking is required), the server sets the pixel value at the corresponding position in the current target scan image block to a specific mask value (such as black or transparent). If the value is 0 (i.e. reserved), the pixel value at the corresponding position in the current target scan image block remains unchanged.
[0212] In the process of shielding fusion, in order to eliminate possible jagged or uneven edges, the server uses image morphological operations (such as corrosion and dilation) to smooth the edges of the interpolation service shielding window and the current target scan image block.
[0213] After completing the element-by-element masking fusion, the server saves the result as a new target scan image data, which only contains the non-business interference content in the current target scan image block, such as the contract text.
[0214] Wherein, the method further comprises: An OCR algorithm is used to extract key features from the candidate recognition image, where the key features include character outlines and stroke structures.
[0215] The extracted key features are matched with predefined character templates or trained classifiers to achieve classification and recognition of the characters in the candidate recognition image.
[0216] In this embodiment, the server uses an OCR algorithm to extract key features from a candidate recognition image (ie, a combination of multiple target scanned image blocks after service shielding). These key features usually include character outlines, stroke structures, etc., which are helpful for identifying text content in the image.
[0217] After extracting the key features, the server matches these features with predefined character templates or trained classifiers. By comparing the similarities between the features, the server can classify and recognize the characters in the candidate recognition images.
[0218] Finally, the server outputs the recognized character text in an editable format (such as TXT, PDF, etc.) for further processing and analysis by the user.
[0219] Through the above steps, the server successfully merges the interpolated business shielding window with the current target scan image block, generates target scan image data containing only non-business interference content, and uses the OCR algorithm to accurately identify and classify the characters in the candidate recognition image, which provides a high-quality data foundation for subsequent text processing and analysis.
[0220] Figure 2 The hardware structure of the machine learning system 100 provided in the embodiment of the present application for implementing the above-mentioned machine learning-based OCR recognition method is shown as follows: Figure 2 As shown, the machine learning system 100 may include a processor 110 , a machine-readable storage medium 120 , a bus 130 , and a communication unit 140 .
[0221] In an alternative embodiment, the machine learning system 100 may be a single server or a server group. The server group may be centralized or distributed (for example, the machine learning system 100 may be a distributed system). In an alternative embodiment, the machine learning system 100 may be local or remote. For example, the machine learning system 100 may access information and / or data stored in a machine-readable storage medium 120 via a network. For another example, the machine learning system 100 may be directly connected to the machine-readable storage medium 120 to access the stored information and / or data. In an alternative embodiment, the machine learning system 100 may be implemented on a cloud platform. By way of example only, the cloud platform may include a private cloud, a public cloud, an aggregated cloud, a community cloud, a distributed cloud, an internal cloud, a multi-layer cloud, or the like, or any integration thereof.
[0222] The machine-readable storage medium 120 may store data and / or instructions. In an alternative embodiment, the machine-readable storage medium 120 may store data obtained from an external terminal. In an alternative embodiment, the machine-readable storage medium 120 may store data and / or instructions used by the machine learning system 100 to execute or use to complete the exemplary methods described in this application. In an alternative embodiment, the machine-readable storage medium 120 may include a mass storage, a removable storage, a volatile read-write memory, a read-only memory, or the like, or any integration thereof. Exemplary mass storage may include a magnetic disk, an optical disk, a solid-state disk, or the like. Exemplary removable storage may include a flash drive, a floppy disk, an optical disk, a memory card, a compressed disk, a magnetic tape, or the like.
[0223] In the specific implementation process, multiple processors 110 execute computer executable instructions stored in the machine-readable storage medium 120, so that the processor 110 can execute the OCR recognition method based on machine learning in the above method embodiment. The processor 110, the machine-readable storage medium 120 and the communication unit 140 are connected through the bus 130, and the processor 110 can be used to describe the sending and receiving actions of the communication unit 140.
[0224] The specific implementation process of the processor 110 can refer to the various method embodiments executed by the above-mentioned machine learning system 100. The implementation principles and technical effects are similar and will not be repeated in this embodiment.
[0225] In addition, an embodiment of the present application further provides a readable storage medium, in which computer executable instructions are pre-installed. When a processor executes the computer executable instructions, the above-mentioned OCR recognition method based on machine learning is implemented.
[0226] Similarly, it should be noted that in order to simplify the description disclosed in the present application and thereby facilitate the understanding of one or more embodiments of the invention, in the foregoing description of the embodiments of the present application, multiple features are sometimes grouped into one embodiment, drawing or description thereof.
Claims
1. An OCR recognition method based on machine learning, characterized in that: The method comprises: Acquire a current target scanned image block and X past scanned image blocks corresponding to the image to be recognized; the current target scanned image block and the X past scanned image blocks are both preprocessed grayscale images, and each of the X past scanned image blocks is a preprocessed grayscale image before the current target scanned image block; When Y key business feature node vectors of the current target scanned image block are extracted, Z single-dimensional spatial gradients and Z composite-dimensional spatial gradients corresponding to the current target scanned image block are obtained according to the Y key business feature node vectors; Extract the Y past business feature node vectors corresponding to each of the past scanned image blocks, and past business feature node vectors to determine a business adaptation vector corresponding to the current target scanned image block; The Y key business feature node vectors, the Z single-dimensional space gradients, the Z composite-dimensional space gradients and the business adaptive vector are loaded into a target OCR business shielding recognition network, and the target OCR business shielding recognition network is used to generate a target business shielding window corresponding to the current target scanned image block; the target business shielding window is used to shield the business interference content in the image to be recognized, and generate a candidate recognition image corresponding to the image to be recognized.
2. The OCR recognition method based on machine learning according to claim 1, characterized in that: The step of obtaining a current target scanned image block and X past scanned image blocks corresponding to the image to be recognized includes: Divide the image to be recognized into image regions and generate K image data blocks; Performing feature mapping on each image data block respectively to generate a target scan image block corresponding to each image data block; A current target scanned image block and X past scanned image blocks before the current target scanned image block are determined from K target scanned image blocks; X is less than K.
3. The OCR recognition method based on machine learning according to claim 2, characterized in that: The K image data blocks include an image data block x, where x is a positive integer not greater than K; The performing feature mapping on each image data block to generate a target scanned image block corresponding to each image data block includes: Performing feature extraction on the image data block x to generate a reference feature point and 2T feature points of the image data block x in a feature space; the 2T feature points include T feature points associated with a first feature point attribute and T feature points associated with a second feature point attribute; T feature points associated with the first feature point attribute are obtained from the 2T feature points, and a target scanned image block corresponding to the image data block x is determined according to the T feature points associated with the first feature point attribute and the reference feature point.
4. The OCR recognition method based on machine learning according to claim 1, characterized in that: The current target scanned image block includes T1 feature points, wherein the T1 feature points include a reference feature point and T2 feature points associated with feature point attributes, and the method further includes: Map the T1 feature points to Y feature space domains; T1 is not less than Y; Perform feature transformation processing on each feature space domain respectively to generate key business feature node vectors corresponding to each feature space domain.
5. The OCR recognition method based on machine learning according to claim 4, characterized in that: The Y feature space domains include a feature space domain y, where y is a positive integer not greater than Y; The performing feature transformation processing on each feature space domain respectively to generate a key business feature node vector corresponding to each feature space domain includes: Extracting the spatial domain vector of the feature spatial domain y, normalizing the spatial domain vector of the feature spatial domain y, and generating a normalized spatial domain vector of the feature spatial domain y; A principal component analysis transformation is performed on the normalized space domain vector of the feature space domain y to generate a key business feature node vector corresponding to the feature space domain y.
6. The OCR recognition method based on machine learning according to claim 1, characterized in that: The step of obtaining Z single-dimensional spatial gradients and Z composite-dimensional spatial gradients corresponding to the current target scanned image block according to the Y key business feature node vectors includes: Performing gradient calculation on the Y key business feature node vectors to generate (Y-1) gradient parameters, using each gradient parameter of the (Y-1) gradient parameters as a single-dimensional spatial gradient of the corresponding key business feature node vector, and obtaining Z single-dimensional spatial gradients corresponding to the current target scanned image block from the (Y-1) single-dimensional spatial gradients; Perform advanced gradient calculation on the (Y-1) single-dimensional spatial gradients to generate (Y-2) gradient parameters, use each of the (Y-2) gradient parameters as the composite dimensional spatial gradient of the corresponding key business feature node vector, and obtain Z composite dimensional spatial gradients corresponding to the current target scanned image block from the (Y-2) composite dimensional spatial gradients.
7. The OCR recognition method based on machine learning according to claim 1, characterized in that: The extracting of Y past business feature node vectors corresponding to each of the past scanned image blocks is based on the extracted The business adaptation vector corresponding to the current target scanned image block is determined by using past business feature node vectors, including: Among the X past scanned image blocks, past scanned image blocks with regional connections are obtained as first past scanned image blocks and second past scanned image blocks; the second past scanned image blocks are preprocessed grayscale images generated after the first past scanned image blocks; Extracting Y past service feature node vectors corresponding to the first past scanned image block in a storage space associated with the current target scanned image block, and extracting Y past service feature node vectors corresponding to the second past scanned image block; Using the Y past service feature node vectors corresponding to the first past scanned image block extracted as the first past service feature node vector, and using the Y past service feature node vectors corresponding to the second past scanned image block extracted as the second past service feature node vector; Obtain a past business feature node vector Hg from among the Y past business feature node vectors covered by the first past business feature node vector, and obtain a past business feature node vector Hf from among the Y past business feature node vectors covered by the second past business feature node vector; g and f are both not greater than Y, and g=f; Extracting the vector distance between the past service feature node vector Hg and the past service feature node vector Hf; determining a characteristic distance between the first past service characteristic node vector and the second past service characteristic node vector according to the vector distance, and using the characteristic distance as an inter-block distinguishing parameter between the first past scanned image block and the second past scanned image block; When each associated past scanned image block among the X past scanned image blocks is used as the first past scanned image block and the second past scanned image block, an inter-block distinction parameter between the X past scanned image blocks is generated, and a service adaptation vector corresponding to the current target scanned image block is determined according to the inter-block distinction parameter between the X past scanned image blocks.
8. The OCR recognition method based on machine learning according to claim 1, characterized in that: The target OCR service shielding recognition network includes a service shielding window prediction unit and a service shielding window generation unit; The step of loading the Y key business feature node vectors, the Z single-dimensional space gradients, the Z composite-dimensional space gradients, and the business adaptation vector into a target OCR business shielding recognition network, and using the target OCR business shielding recognition network to generate a target business shielding window corresponding to the current target scanned image block includes: The Y key business feature node vectors, the Z single-dimensional space gradients, the Z composite-dimensional space gradients, and the business adaptation vector are used as target image knowledge features of the current target scanned image block, the target image knowledge features are loaded into the business shielding window prediction unit, and the business shielding window prediction unit is used to perform business shielding window prediction on the target image knowledge features to generate business shielding window prediction features corresponding to the target image knowledge features; Loading the business shielding window prediction feature into the business shielding window generation unit, integrating the business shielding window prediction feature by using the business shielding window generation unit, and generating a target business shielding window corresponding to the current target scanned image block; The service shielding window prediction unit includes a first service shielding window prediction unit, a second service shielding window prediction unit and a third service shielding window prediction unit which are cascaded across units; The step of loading the target image knowledge feature into the business shielding window prediction unit, using the business shielding window prediction unit to perform business shielding window prediction on the target image knowledge feature, and generating a business shielding window prediction feature corresponding to the target image knowledge feature includes: Loading the target image knowledge feature into the first service shielding window prediction unit, and using the first service shielding window prediction unit to generate a first temporary service shielding feature; Based on the cross-unit cascade between the first business shielding window prediction unit and the second business shielding window prediction unit, the first temporary business shielding feature and the target image knowledge feature are integrated to generate a second temporary business shielding feature, the second temporary business shielding feature is loaded into the second business shielding window prediction unit, and the second business shielding window prediction unit is used to generate a third temporary business shielding feature; Based on the cross-unit cascade between the first business shielding window prediction unit and the third business shielding window prediction unit and the cross-unit cascade between the second business shielding window prediction unit and the third business shielding window prediction unit, the third temporary business shielding feature, the target image knowledge feature and the first temporary business shielding feature are integrated to generate a fourth temporary business shielding feature, the fourth temporary business shielding feature is loaded into the third business shielding window prediction unit, and the third business shielding window prediction unit is used to generate a business shielding window prediction feature corresponding to the target image knowledge feature.
9. The OCR recognition method based on machine learning according to claim 1, characterized in that: After the step of loading the Y key business feature node vectors, the Z single-dimensional space gradients, the Z composite-dimensional space gradients, and the business adaptation vector into a target OCR business shielding recognition network, and using the target OCR business shielding recognition network to generate a target business shielding window corresponding to the current target scanned image block, the method further includes: Performing an interpolation operation on the target service shielding window to generate an interpolation service shielding window; the window parameters of the interpolation service shielding window are the same as the window parameters of the current target scanned image block; Performing element-by-element masking fusion on the interpolation service masking window and the current target scanned image block, transforming the element-by-element masking fusion result, and generating target scanned image data after service masking is performed on the current target scanned image block; After each current target scan image block corresponding to the image to be identified is service-shielded, a candidate identification image corresponding to the image to be identified is generated, wherein the candidate identification image is composed of the target scan image data after the service shielding; Furthermore, before the step of obtaining the current target scanned image block and X past scanned image blocks corresponding to the image to be recognized, the method further includes: Acquire a target example target scan image block and X past example scan image data corresponding to the example scan image data, and extract a sample business shielding window corresponding to the target example target scan image block; the target example target scan image block and the X past example target scan image blocks are both preprocessed grayscale images, and each of the X past example target scan image blocks is a preprocessed grayscale image before the target example target scan image block; When Y target example business feature node vectors of the target example target scanned image block are extracted, Z example single-dimensional spatial gradients and Z example composite-dimensional spatial gradients corresponding to the target example target scanned image block are obtained according to the Y target example business feature node vectors; Extract the Y past example business feature node vectors corresponding to each of the past example target scan image blocks, and determining a sample service adaptation vector corresponding to the target sample target scanned image block based on a past sample service feature node vector; Loading the Y target example service feature node vectors, the Z example single-dimensional space gradients, the Z example composite-dimensional space gradients, and the example service adaptive vector into a sample OCR service mask recognition network, and using the sample OCR service mask recognition network to generate a training service mask window corresponding to the target example target scan image block; The sample OCR business shielding recognition network is parameter optimized according to the training business shielding window and the example business shielding window to generate a target OCR business shielding recognition network for predicting a target business shielding window corresponding to a current target scanned image block corresponding to an image to be recognized; the target business shielding window is used to shield business interference content in the image to be recognized, and generate a candidate recognition image corresponding to the image to be recognized.
10. A machine learning system, characterized in that: The machine learning system includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and the machine-executable instructions are loaded and executed by the processor to implement the machine learning-based OCR recognition method of any one of claims 1-9.
