Method, system and equipment for correcting OCR (Optical Character Recognition) result in answer sheet consistency verification and medium
By setting the reference area on the answer sheet and using the multi-recognition model and shape feature correction method, the problems of inaccurate positioning of the OCR recognition area and unexplainable results are solved, and the accuracy of the answer sheet consistency verification is improved.
Patent Information
- Application Number
- CN202510219468.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-02-26
AI Technical Summary
In the existing answer sheet consistency verification, the OCR identification area positioning is inaccurate and the identification results are poorly interpretable, so it cannot effectively correct the doubtful results.
By setting a reference area on the answer sheet, splitting the OCR recognition area into multiple single-character images, using a multi-recognition model for aggregate recognition, and logically judged and corrected doubtful characters based on shape characteristics and confidence.
It improves the positioning accuracy of the OCR recognition area and the reliability of the identification results, and enhances the accuracy of the consistency verification of the answer sheet.
Smart Images

Figure CN120260060A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of answer sheet consistency verification, and particularly relates to a method, system, device and medium for correcting OCR recognition results in answer sheet consistency verification. Background Art
[0002] In the answer sheet scanning process, to ensure that the information on the answer sheet corresponds correctly to the candidate information, it is necessary to perform OCR recognition on the information filled in by the candidate and manually check the answer sheets with abnormal keyword consistency verification to prevent incorrect answer sheet scanning.
[0003] In the existing answer sheet consistency verification process, the recognition area is mainly intercepted by coordinates and then transmitted into the OCR recognition model to obtain the candidate information, ignoring the problems such as stretching and deformation of the answer sheet during scanning, which lead to inaccurate positioning of the recognition area. In addition, the commonly used OCR recognition neural network models are all single black-box models, with poor interpretability of the recognition results. During the recognition process, the results output by the model generally cannot be further analyzed and processed, and the suspicious recognition results cannot be effectively corrected. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a method, system, device and medium for correcting OCR recognition results in answer sheet consistency verification, which is used to improve the positioning effect of the OCR recognition area and the recognition rate of suspicious results, and better perform the answer sheet consistency verification work.
[0005] In a first aspect, an embodiment of the present application provides a method for correcting OCR recognition results in answer sheet consistency verification, including: During the answer sheet scanning process, determine the OCR recognition area according to the relative position of the preset reference area in the answer sheet, and split the OCR recognition area into multiple single-character images; Perform image preprocessing operations on each single-character image, and use multiple recognition models to perform aggregated recognition on the preprocessed character images, and output recognition results and confidence levels. Among them, the multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters aggregated based on a parallel integrated learning method; If it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level, then extract the shape features of each single-character image, and perform logical judgment on the suspicious character and its alternative characters according to the shape features. If the features of the alternative character match the target character and the value of the target character in the output confidence meets the preset condition, then correct the suspicious character to the alternative character.
[0006] Optionally, during the answer sheet scanning process, an OCR recognition area is determined according to the relative position of a preset reference area in the answer sheet, including: Select an area on the answer sheet that can be used as a position reference as the reference area, and use the area that expands the preset multiple of the reference area around the position of the reference area of the sample card on the answer sheet as the detection space of the reference area; Search for and locate the alternative points that meet the shape characteristics of the reference area of the sample card in the detection space, determine the position of the alternative point closest to the area as the position of the reference area of the answer sheet, and calculate the OCR recognition area on the answer sheet according to the relative position between the reference area on the sample card and the OCR recognition area; If the reference area is not detected, determine the position of the reference area on the sample card as the position of the reference area of the answer sheet, and calculate the OCR recognition area on the answer sheet according to the relative position between the reference area on the sample card and the OCR recognition area; If the answer sheet is stretched during the answer sheet scanning, determine the stretching direction according to the answer sheet scanning direction, find two reference areas as positioning reference points in the stretching direction with the OCR recognition area, and calculate the stretching ratio of the answer sheet by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet, and obtain the position of the OCR recognition area after conversion according to the stretching ratio.
[0007] Optionally, perform image preprocessing operations on each single-character image, including: Intercept the OCR recognition area from the answer sheet and separate the candidate's handwriting from the background color of the answer sheet; Clear the interference factors in the OCR recognition area through contour detection and area determination, and evenly divide the OCR recognition area according to the number of recognized digits; For each single-character detection area after equal division, use the connected component analysis algorithm to detect the outer contour of the handwritten character and obtain the minimum bounding rectangle of each character, and uniformly scale the handwritten character image to the standard size.
[0008] Optionally, use multiple recognition models to perform aggregated recognition on the preprocessed character images, and output the recognition results and confidence levels, including: Before performing answer sheet OCR recognition, train and generate multiple independent recognition models according to the OCR content to be recognized. Among them, if recognizing simple characters including but not limited to numbers or English letters, select the LeNet network model; if recognizing complex characters including but not limited to Chinese characters, select the AlexNet network model; Based on the parallel integrated learning method, aggregate the LeNet network model or the AlexNet network model to output multiple sets of recognition result sets during answer sheet recognition. Each set of recognition result sets contains the doubtful characters and their corresponding confidence levels, and use the recognition character with the highest confidence level in each set as the recognition result of the set.
[0009] Optionally, based on the recognition result and the confidence level, it is determined whether it is necessary to correct the OCR recognition result, including: The first threshold and the second threshold are preset according to OCR recognition experience, where the first threshold is less than the second threshold; When the confidence level is lower than the first threshold and multiple groups of recognition results are inconsistent, the recognition result is considered an invalid character; When the confidence level is higher than the first threshold and lower than the second threshold and multiple groups of recognition results are inconsistent, the recognition result is considered a doubtful character and the result needs to be corrected; When multiple groups of recognition results are consistent or the confidence level is higher than the second threshold, the recognition result is considered a valid character.
[0010] Optionally, the method for correcting the OCR recognition result in the answer sheet consistency check further includes: verifying the recognized valid characters with the barcode information pasted on the candidate's answer sheet or the OMR information filled in. When the verification is inconsistent or the character is invalid, the quality inspection personnel are submitted to check the answer sheet information and then process it.
[0011] Optionally, the shape features of each single-character image extracted include but are not limited to the number of inner contours in the character, whether the character edge is a convex hull, the area difference at different positions of the character, and the overall or local area threshold of the character.
[0012] In a second aspect, the embodiment of the present application further provides a system for correcting the OCR recognition result in the answer sheet consistency check, including: A positioning module, which is used to determine the OCR recognition area according to the relative position of the preset reference area in the answer sheet during the answer sheet scanning process, and split the OCR recognition area into multiple single-character images; An identification module, which is used to perform image preprocessing operations on each single-character image, and perform aggregated recognition on the preprocessed character images using multiple recognition models, and output the recognition result and the confidence level, where the multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters aggregated based on the parallel integrated learning method; A correction module, which is used to, if it is determined based on the recognition result and the confidence level that the OCR recognition result needs to be corrected, extract the shape features of each single-character image, and perform logical judgment on the doubtful character and its alternative characters according to the shape features. If the features of the alternative character match the target character and the value of the target character in the output confidence meets the preset conditions, the doubtful character is corrected to the alternative character.
[0013] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the method for correcting the OCR recognition result in the above-mentioned answer sheet consistency check are implemented.
[0014] In a fourth aspect, an embodiment of the present application further provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for correcting the OCR recognition result in the above-mentioned answer sheet consistency check are implemented.
[0015] As can be seen from the above technical solutions, the present invention has the following advantages: In the method, system, device, and medium for correcting the OCR recognition result in the answer sheet consistency check provided by the present application, the OCR recognition area is located according to the position of the answer sheet reference area, the characters in the recognition area are split and preprocessed into standard character images, the single-character images are sequentially input into the aggregation model for OCR recognition and the recognition confidence is obtained. When the recognition result correction condition is met, the recognition result is corrected according to the shape feature and confidence of the character. Through multi-reference area positioning, the problem of inaccurate positioning caused by stretching deformation during scanning of the answer sheet can be effectively reduced. By further logically correcting the recognition result, the OCR recognition effect can be improved, and thus the accuracy of the consistency data can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 It is a flowchart of a method for correcting the OCR recognition result in an answer sheet consistency check provided by an embodiment of the present invention; Figure 2 It is a flowchart of determining the OCR recognition area provided by an embodiment of the present invention; Figure 3 It is a detailed flowchart of a method for correcting the OCR recognition result in an answer sheet consistency check provided by an embodiment of the present invention; Figure 4 It is a schematic structural diagram of a system for correcting the OCR recognition result in an answer sheet consistency check provided by an embodiment of the present invention; Figure 5 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] In the following detailed description, various embodiments of the present disclosure will be more fully described. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but the present disclosure should be understood to cover all adjustments, equivalents, and / or alternative solutions that fall within the spirit and scope of the various embodiments of the present disclosure.
[0019] Hereinafter, the term "comprising" or "may comprise" that may be used in various embodiments of the present disclosure indicates the presence of the disclosed function or operation, and does not limit the addition of one or more functions or operations. Further, as used in various embodiments of the present disclosure, the terms "comprising", "having" and their cognates are only intended to indicate a specific feature, number, step, operation, or combination of the foregoing items, and should not be construed as precluding the existence or addition of one or more other features, numbers, steps, operations, or combinations of the foregoing items.
[0020] In various embodiments of the present disclosure, the expression "or" or "at least one of A or / and B" includes any combination or all combinations of the listed words. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
[0021] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0022] Refer to Figure 1 Shown is a flowchart of a method for correcting the OCR recognition result in the answer sheet consistency check in a specific embodiment, including the following execution steps: Step 100: During the answer sheet scanning process, determine the OCR recognition area according to the relative position of the pre-set reference area in the answer sheet, and split the OCR recognition area into multiple single-character images.
[0023] It should be understood that the position of the reference area and the area to be recognized is set before the answer sheet is scanned. During the scanning, the OCR recognition area is calculated and determined according to the relative position of the reference area, and the area is split into multiple individual character images according to the number of recognized digits, and image preprocessing operations are performed.
[0024] Specifically, refer to Figure 2 Shown, when performing step 100, the following steps may be specifically performed: S1000: Use the area that expands the preset multiple of the reference area of the sample card from the position of the reference area of the sample card on the answer sheet towards the edge of the answer sheet as the OCR recognition area.
[0025] S1001: Search for and locate the alternative points that meet the shape characteristics of the reference area of the sample card within the OCR recognition area, determine the position of the alternative point closest to the position of the reference area of the sample card as the position of the reference area of the answer sheet, and calculate the OCR recognition area on the answer sheet based on the relative position between the reference area of the answer sheet and the recognition area.
[0026] S1002: If the reference area is not detected, determine the position of the reference area of the sample card as the position of the reference area of the answer sheet, and calculate the OCR recognition area on the answer sheet based on the relative position between the reference area on the sample card and the recognition area.
[0027] S1003: If the answer sheet is stretched during the answer sheet scanning, determine the stretching direction according to the answer sheet scanning direction, search for two reference areas as positioning points in the stretching direction with the OCR recognition area, calculate the stretching ratio of the answer sheet by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet, and obtain the OCR recognition area after conversion according to the stretching ratio.
[0028] In a specific embodiment, the specific method for positioning and detecting the reference area is as follows: Obtain the image of the answer sheet sample card, set the OCR recognition area, and define this area as {(xOcr1, yOcr1), (xOcr2, yOcr2)}, where they are the coordinate values of the upper left corner and the lower right corner respectively, and select the reference area with the closest distance as the relative position reference point based on the position of the recognition area, and define this reference area as {(xAnchor1, yAnchor1), (xAnchor2, yAnchor2)}. When scanning the answer sheet, expand the reference area of the sample card by 2 times in all directions as the detection area. If the size of the answer sheet is h * w, to ensure that it does not exceed the answer sheet area, the position of this detection area is {(max(0, xAnchor1 - 2 * (xAnchor2 - xAnchor1)), max(0, yAnchor1 - 2 * (yAnchor2 - yAnchor1))), (min(w, xAnchor2 + 2 * (xAnchor2 - xAnchor1)), min(h, yAnchor2 + 2 * (yAnchor2 - yAnchor1)) )}. After binarizing the image of the detection area, perform contour detection and record the positions of all areas similar in shape to the reference area of the sample card. To prevent the answer sheet from stretching and deforming, the retrieval conditions can be appropriately relaxed. After finding and positioning all alternative areas that meet the shape characteristics of the reference area within this area, determine the position of the reference area closest to the reference area of the sample card as the position of the reference area of the answer sheet. If no reference area is detected, determine the position of the reference area of the sample card as the position of the reference area of the answer sheet. Define the upper left corner coordinates of the reference area detected on the answer sheet as (xRealAnchor1, yRealAnchor1), then the position of the OCR recognition area of the answer sheet is {(xRealAnchor1 + xOcr1 - xAnchor1, yRealAnchor1 + yOcr1 - yAnchor1), (xRealAnchor1 + xOcr2 - xAnchor1, yRealAnchor1 + yOcr2 - yAnchor1)}.
[0029] It should be noted that due to differences in the paper feeding speed or paper feeding orientation of the scanner during batch scanning of answer sheets, the scanned answer sheet images may be stretched and deformed in the paper feeding direction. Therefore, to accurately locate the recognition area, two different reference area positioning points should be selected for auxiliary positioning in the stretching direction, and the detection method for each positioning point is the same as the above method. Define the upper left corner coordinates of the reference area A on the sample card as (xAnchorA1, yAnchorA1), the upper left corner coordinates of the reference area B as (xAnchorB1, yAnchorB1), the upper left corner coordinates of the reference area A on the detected answer sheet as (xRealAnchorA1, yRealAnchorA1), and the upper left corner coordinates of the reference area B as (xRealAnchorB1, yRealAnchorB1). If the answer sheet is horizontally stretched, the horizontal distance between the two reference areas on the sample card is deltaX = xAnchorB1 - xAnchorA1, and the horizontal distance on the answer sheet is deltaRealX = xRealAnchorB1 - xRealAnchorA1. Then, the upper left corner coordinates of the OCR recognition area of the answer sheet are ((xAnchorA1 + int((xOcr1 - xAnchorA1) * deltaRealX / deltaX)), (yAnchorA1 + yOcr1 - yAnchorA1)). Similarly, the position of the recognition area can be calculated when the answer sheet is vertically stretched.
[0030] Step 101: Perform image preprocessing operations on each single-character image, and use a multi-recognition model to perform aggregated recognition on the preprocessed character image, and output the recognition result and the confidence level. Among them, the multi-recognition model includes a first network model for recognizing simple characters and a second network model for recognizing complex characters aggregated based on the parallel integrated learning method.
[0031] Exemplarily, performing image preprocessing operations on each single-character image includes: intercepting the OCR recognition area from the answer sheet and separating the candidate's handwriting from the background color of the answer sheet through binary processing and other methods; clearing the interference factors in the OCR recognition area through contour detection and area determination, and evenly dividing the OCR recognition area according to the number of recognized digits; for each single-character detection area after even division, using the connected component analysis algorithm to detect the outer contour of the handwritten character and obtain the minimum bounding rectangle of each character, and uniformly scaling the handwritten character image to the standard size.
[0032] Exemplarily, the interference factors are, for example, stain points. The recognition area is evenly divided according to the number of recognized digits n, that is, the width of each part is w / n.
[0033] Specifically, the steps of using a multi-recognition model to perform aggregated recognition on the preprocessed character image and output the recognition result and the confidence level are as follows: S1: Before performing answer sheet OCR recognition, train multiple independent recognition models according to the OCR content to be recognized. Among them, if recognizing simple characters including but not limited to numbers or English letters, select the LeNet network model; if recognizing complex characters including but not limited to Chinese characters, select the AlexNet network model.
[0034] S2: Based on the parallel ensemble learning method, aggregate the LeNet network model or the AlexNet network model to output multiple sets of recognition result sets during answer sheet recognition. Each set of recognition result sets contains doubtful characters and their corresponding confidence levels, and the recognized character with the highest confidence level in each set is used as the recognition result of that set.
[0035] Specifically, use multiple batches of independent data sets to train the models respectively. Select the neural network model with the highest recognition rate in each batch as the aggregation component, and aggregate each component based on the parallel ensemble learning method to construct an OCR recognition model group. During answer sheet recognition, the OCR recognition model group can output multiple sets of recognition result sets for the recognized character images.
[0036] Exemplarily, if an OCR recognition model group is aggregated and constructed from m recognition models, where the recognition result output by the i-th model is output_i, and the corresponding confidence level is p_i, where p_i is the highest confidence value among the doubtful characters recognized in this set. Therefore, the recognition result set of the recognition model group is {output_1:p_1, output_2:p_2, …, output_m:p_m}. Select a set of recognition results output_i:p_i with the highest confidence level among the m recognition results as the initial result, and determine whether result correction is required according to the conditions.
[0037] Step 102: If it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level, extract the shape features of each single-character image, and make a logical judgment on the doubtful characters and their alternative characters according to the shape features. If the alternative character features conform to the target character and the value of the target character in the output confidence meets the preset conditions, then correct the doubtful character to the alternative character.
[0038] Specifically, based on the recognition result and the confidence level, it is determined whether it is necessary to correct the OCR recognition result, including: presetting a first threshold and a second threshold according to OCR recognition experience, where the first threshold is less than the second threshold; when the confidence level is lower than the first threshold and multiple groups of recognition results are inconsistent, the recognition result is considered an invalid character; when the confidence level is higher than the first threshold and lower than the second threshold and multiple groups of recognition results are inconsistent, the recognition result is considered a doubtful character that needs to be corrected; when multiple groups of recognition results are consistent or the confidence level is higher than the second threshold, the recognition result is considered a valid character.
[0039] Exemplarily, a low threshold a and a medium threshold b are set. When the confidence p_i is lower than the threshold a and multiple groups of recognition results are inconsistent, the character is considered an invalid character (due to factors such as scratching or stain interference); when the confidence p_i is higher than the threshold a and lower than the threshold b and multiple groups of recognition results are inconsistent, the recognition result is considered a doubtful character; when multiple groups of recognition results are consistent or the confidence p_i is higher than the threshold b, the character is considered a valid character. The invalid characters and the valid characters are both subjected to answer sheet consistency verification, and the doubtful characters are corrected for the recognition result.
[0040] In a specific embodiment, when the result correction condition is met, the output with the maximum confidence corresponding to the OCR recognition model group is the doubtful character output_a, and the alternative character groups {output_b, output_c...} that are inconsistent with the doubtful character in the remaining groups of recognition results. Shape feature detection is performed on the image of the doubtful character. When the image of the doubtful character contains the shape feature of an alternative character output_i that the character should not have, the alternative character is listed as the key attention object, and the difference between the confidence p_i of the alternative character in the recognition result and the confidence p_a of the doubtful character is calculated. A correction threshold c is set according to the accuracy of the trained recognition model. When |p_i - p_a| < c, it is considered that the doubtful character output_a should be corrected to the alternative character output_i, and output_i is set as the valid character for subsequent answer sheet consistency verification. At this time, the recognition correction ends and the feature detection of the remaining alternative characters is no longer performed. When the doubtful character does not contain the shape features of all other alternative characters, it is considered that the recognition is correct and output_a is set as the valid character for subsequent answer sheet consistency verification.
[0041] Exemplarily, the shape features of each single-character image extracted include, but are not limited to, the number of inner contours in the character, whether the character edge is a convex hull, the area difference at different positions of the character, and the overall or local area threshold of the character. When correcting the results, multiple feature types can be freely combined for detection according to the image conditions of the suspected characters and alternative characters. In this embodiment, handwritten digits are taken as an example for illustration. When recognizing English letters or handwritten Chinese characters, corresponding feature information can be extracted from the character image and corresponding logical judgment rules can be constructed, and the detection and correction processes are similar to those in this embodiment. For example, the number of inner contours of the handwritten digit "8" is generally 1 or 2, and the left side of the character is non-convex; the number of inner contours of the handwritten digit "6" is generally 0 or 1, and the left side of the character is generally convex. When the upper side of the "6" written by the candidate has a high degree of curvature, there is a risk of misidentifying it as "8". The shape feature detection according to the result correction logic can achieve the correction of the result.
[0042] In some embodiments, the method for correcting the OCR recognition result in the answer sheet consistency verification further includes: verifying the recognized valid characters with the barcode information pasted on the candidate's answer sheet or the OMR information filled in. When the verification is inconsistent or the characters are invalid, the answer sheet information is submitted to the quality inspection personnel for verification and then processed.
[0043] In this embodiment, the OCR recognition area is located according to the position of the reference area of the answer sheet; the characters in the recognition area are split and preprocessed into standard character images; the single-character images are sequentially input into the aggregation model for OCR recognition and the recognition confidence is obtained; when the recognition result correction condition is met, the recognition result is corrected according to the shape features and confidence of the characters; the candidate's handwritten information is verified to determine whether it is consistent with the database information. During the verification process of the answer sheet consistency information, multi-reference area positioning can effectively reduce the problem of inaccurate positioning caused by stretching and deformation during the scanning of the answer sheet, and further logical correction of the recognition result can improve the OCR recognition effect, thereby improving the accuracy of the consistency data.
[0044] In one embodiment, Figure 3 FIG. is a detailed flowchart of a method for correcting the OCR recognition result in the answer sheet consistency verification provided according to an embodiment of the present invention. This embodiment is further optimized and extended on the basis of the above embodiments.
[0045] S300: The area obtained by expanding the reference area of the sample card by a preset multiple size from the position of the reference area of the sample card on the answer sheet to the edge of the answer sheet is used as the reference area detection space.
[0046] S301: Search for and locate the alternative points in the detection space that meet the shape features of the reference area of the sample card, determine the position of the alternative point closest to the position of the reference area of the sample card as the position of the reference area of the answer sheet, and calculate the OCR recognition area on the answer sheet according to the relative position between the reference area of the answer sheet and the recognition area.
[0047] S302: If the reference area is not detected, determine the position of the reference area of the answer sheet as the position of the reference area of the sample card, and calculate the OCR recognition area on the answer sheet according to the relative positions of the reference area and the recognition area on the sample card.
[0048] S303: If the answer sheet is stretched during the answer sheet scanning, determine the stretching direction according to the scanning direction of the answer sheet, find two reference areas as positioning points in the stretching direction based on the OCR recognition area, calculate the stretching ratio of the answer sheet by combining the distances between the two reference areas on the sample card and the reference areas on the answer sheet, and obtain the OCR recognition area after conversion according to the stretching ratio.
[0049] S304: Split the OCR recognition area into multiple single-character images, and perform image preprocessing operations on each single-character image.
[0050] S305: Before performing the answer sheet OCR recognition, train and generate multiple independent recognition models according to the OCR content to be recognized. Among them, if recognizing simple characters including but not limited to numbers or English letters, select the LeNet network model; if recognizing complex characters including but not limited to Chinese characters, select the AlexNet network model.
[0051] S306: Based on the parallel integrated learning method, aggregate the LeNet network model or the AlexNet network model to output multiple sets of recognition result sets during the answer sheet recognition. Each set of recognition result sets contains doubtful characters and their corresponding confidence levels, and take the recognition character with the highest confidence level in each set as the recognition result of this set.
[0052] S307: If it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level, extract the shape features of each single-character image, and perform logical judgment on the doubtful characters and their alternative characters according to the shape features. If the features of the alternative characters match the target character and the value of the target character in the output confidence meets the preset conditions, correct the doubtful characters to the alternative characters.
[0053] S308: Verify the recognized valid characters with the barcode information or the filled OMR information pasted on the candidate's answer sheet. When the verification is inconsistent or the characters are invalid, submit to the quality inspection personnel to check the answer sheet information and then process it.
[0054] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0055] Such as Figure 4As shown below, the following is an embodiment of a system for correcting OCR recognition results in answer sheet consistency verification provided by an embodiment of the present disclosure. It belongs to the same inventive concept as the method for correcting OCR recognition results in answer sheet consistency verification in each of the above embodiments. For details not described in detail in the embodiment of the system for correcting OCR recognition results in answer sheet consistency verification, reference may be made to the embodiment of the method for correcting OCR recognition results in answer sheet consistency verification above.
[0056] The system for correcting OCR recognition results in answer sheet consistency verification includes: A positioning module, configured to determine an OCR recognition area according to the relative position of a preset reference area in the answer sheet during the answer sheet scanning process, and split the OCR recognition area into multiple single-character images; An identification module, configured to perform image preprocessing operations on each single-character image, and perform aggregated recognition on the preprocessed character images using multiple recognition models, and output recognition results and confidence levels. Among them, the multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters aggregated based on a parallel integrated learning method; A correction module, configured to, if it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level, extract the shape features of each single-character image, and perform a logical judgment on the doubtful character and its alternative characters according to the shape features. If the alternative character features conform to the target character and the value of the target character in the output confidence meets a preset condition, the doubtful character is corrected to the alternative character.
[0057] Figure 5 It is a schematic hardware structure diagram of an electronic device for implementing various embodiments of the present invention.
[0058] The method for correcting OCR recognition results in answer sheet consistency verification provided by an embodiment of the present application can be applied to an electronic device. Those skilled in the art can understand that the structure of the electronic device involved in the embodiments of the present invention does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. In the embodiments of the present invention, the electronic device includes, but is not limited to, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or claimed herein.
[0059] An electronic device may include a processor, an external memory interface, an internal memory, a Universal Serial Bus (USB) interface, a charging management module, a power management module, a battery, a wireless communication module, an audio module, a speaker, a microphone, a sensor module, keys, a camera, a display screen, and a Subscriber Identity Module (SIM) card interface, etc.
[0060] It can be understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0061] The processor may include one or more processing units. For example, the processor may include a Central Processing Unit (CPU), an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and / or a Neural-Network Processing Unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0062] Among them, the processor may be the nerve center and command center of the electronic device. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0063] A memory may also be provided in the processor for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory may save the instructions or data that the processor has just used or recycled. If the processor needs to use the instruction or data again, it can directly call it from this memory. This avoids repeated accesses, reduces the waiting time of the processor, and thus improves the system efficiency.
[0064] The external memory interface may be used to connect an external memory card, such as a MicroSD card, to implement the storage capacity expansion of the electronic device. The external memory card communicates with the processor through the external memory interface to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0065] The internal memory can be used to store computer-executable program code, and the computer-executable program code includes instructions. The processor executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory. The internal memory can include a program storage area and a data storage area. The internal memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0066] The wireless communication function of the electronic device can be implemented by an antenna, a wireless communication module, a modulation and demodulation processor, a baseband processor, etc.
[0067] The wireless communication module can provide wireless communication solutions applied to the electronic device, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0068] The electronic device can implement audio functions, etc. through an audio module, a speaker, a receiver, a microphone, a headphone jack, an application processor, etc.
[0069] The electronic device can implement a shooting function through an ISP, a camera, a video codec, a GPU, a display screen, an application processor, etc.
[0070] The electronic device can implement a display function through a GPU, a display screen, an application processor, etc.
[0071] The GPU is a microprocessor for image processing, connecting the display screen and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor can include one or more GPUs, which execute program instructions to generate or change display information.
[0072] The display screen is used to display images, videos, etc. The display screen includes a display panel.
[0073] In the storage medium provided in this application, there is a program product that can implement the method for correcting the OCR recognition result in the answer sheet consistency check.
[0074] The method for correcting the OCR recognition result in the answer sheet consistency check includes: during the answer sheet scanning process, determine the OCR recognition area according to the relative position of the preset reference area in the answer sheet, and split the OCR recognition area into multiple single-character images; perform image preprocessing operations on each single-character image, and use multiple recognition models to perform aggregated recognition on the preprocessed character images, and output the recognition result and the confidence level. Among them, the multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters aggregated based on the parallel integrated learning method; if it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level, then extract the shape features of each single-character image, and perform logical judgment on the doubtful character and its alternative characters according to the shape features. If the alternative character features conform to the target character and the value of the target character in the output confidence meets the preset conditions, then correct the doubtful character to the alternative character.
[0075] In some possible implementation manners, the subject matter of the present disclosure, the method, system, device, and medium for correcting the OCR recognition result in the answer sheet consistency check, can be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0076] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0077] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for correcting OCR recognition results in answer sheet consistency verification, characterized in that, Including: During the process of scanning the answer sheet, determine the OCR recognition area according to the relative position of the pre-set reference area in the answer sheet, and split the OCR recognition area into multiple single-character images; Perform image preprocessing operations on each single-character image, and use multiple recognition models to perform aggregated recognition on the preprocessed character images, and output the recognition results and confidence levels. Among them, the multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters aggregated based on the parallel ensemble learning method; If it is determined that the OCR recognition result needs to be corrected based on the recognition result and confidence level, extract the shape features of each single-character image, and perform logical judgment on the doubtful character and its alternative characters according to the shape features. If the alternative character features match the target character and the value of the target character in the output confidence meets the preset conditions, then correct the doubtful character to the alternative character.
2. The method for correcting the OCR recognition result in the answer sheet consistency check according to claim 1, characterized in that, During the process of scanning the answer sheet, determine the OCR recognition area according to the relative position of the pre-set reference area in the answer sheet, including: Take the area that expands the sample card reference area by a preset multiple from the position of the sample card reference area on the answer sheet to the edge of the answer sheet as the reference area detection space; Search for and locate the alternative points that meet the shape features of the sample card reference area within the OCR recognition area, determine the position of the alternative point closest to the position of the sample card reference area as the answer sheet reference area position, and calculate the OCR recognition area on the answer sheet according to the relative position between the answer sheet reference area position and the recognition area; If the reference area is not detected, determine the position of the sample card reference area as the answer sheet reference area position, and calculate the OCR recognition area on the answer sheet according to the relative position between the reference area on the sample card and the recognition area; If the answer sheet is stretched during the answer sheet scanning, determine the stretching direction according to the answer sheet scanning direction, find two reference areas as positioning points in the stretching direction of the OCR recognition area, and calculate the stretching ratio of the answer sheet by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet, and obtain the OCR recognition area after conversion according to the stretching ratio.
3. The method for correcting the OCR recognition result in the answer sheet consistency check according to claim 1, wherein Perform image preprocessing operations on each single-character image, including: Intercept the OCR recognition area from the answer sheet and separate the candidate's handwriting and the background color of the answer sheet; Clear the interference factors in the OCR recognition area through contour detection and area determination, and evenly divide the OCR recognition area according to the number of recognition digits; For each single-character detection area after equal division, use the connected component analysis algorithm to detect the outer contour of the handwritten character and obtain the minimum bounding rectangle of each character, and uniformly scale the handwritten character image to the standard size.
4. The method for correcting the OCR recognition result in the answer sheet consistency check according to claim 1, wherein, Use multiple recognition models to perform aggregated recognition on the preprocessed character images, and output the recognition results and confidence levels, including: Before performing answer sheet OCR recognition, train and generate multiple independent recognition models according to the OCR content to be recognized. Among them, if recognizing simple characters including but not limited to numbers or English letters, select the LeNet network model; if recognizing complex characters including but not limited to Chinese characters, select the AlexNet network model; Based on the parallel integrated learning method, aggregate the LeNet network model or the AlexNet network model to output multiple sets of recognition result sets during answer sheet recognition. Each set of recognition result sets includes doubtful characters and their corresponding confidence levels, and the recognition character with the highest confidence level in each set is used as the recognition result of that set.
5. The method for correcting the OCR recognition result in the answer sheet consistency check according to claim 1, characterized in that, Based on the recognition result and the confidence level, determine whether it is necessary to correct the OCR recognition result, including: Pre-set a first threshold and a second threshold according to OCR recognition experience, where the first threshold is less than the second threshold; When the confidence level is lower than the first threshold and the multiple sets of recognition results are inconsistent, the recognition result is considered an invalid character; When the confidence level is higher than the first threshold and lower than the second threshold and the multiple sets of recognition results are inconsistent, the recognition result is considered a doubtful character that needs to be corrected; When the multiple sets of recognition results are consistent or the confidence level is higher than the second threshold, the recognition result is considered a valid character.
6. The method for correcting the OCR recognition result in the answer sheet consistency check according to claim 5, wherein The method for correcting the OCR recognition result in the answer sheet consistency check further includes: verifying the recognized valid characters with the barcode information pasted on the candidate's answer sheet or the OMR information filled in. When the verification is inconsistent or it is an invalid character, submit it to the quality inspection personnel to check the answer sheet information and then process it.
7. The method for correcting the OCR recognition result in the answer sheet consistency check according to claim 1, characterized in that, The shape features of each single-character image extracted include, but are not limited to, the number of inner contours in the character, whether the character edge is a convex hull, the area difference at different positions of the character, and the overall or local area threshold of the character.
8. A correction system for OCR recognition results in answer sheet consistency verification, characterized in that, Include: A positioning module, used during the answer sheet scanning process to determine the OCR recognition area according to the relative position of the pre-set reference area in the answer sheet, and split the OCR recognition area into multiple single-character images; A recognition module, used to perform image preprocessing operations on each single-character image, and aggregate and recognize the preprocessed character images using multiple recognition models, and output the recognition result and the confidence level. The multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters aggregated based on the parallel integrated learning method; A correction module, used to, if it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level, extract the shape features of each single-character image, and perform logical judgment on the doubtful characters and their alternative characters according to the shape features. If the features of the alternative characters match the target character and the value of the target character in the output confidence meets the preset conditions, then correct the doubtful character to the alternative character.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method for correcting the OCR recognition result in the answer sheet consistency check according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for correcting the OCR recognition result in the answer sheet consistency check according to any one of claims 1 to 7.
Citation Information
Patent Citations
OCR model training method and device, computer equipment and storage medium
CN113537184A
Text recognition method and device, equipment and medium
CN114973247A
Document electronization method and device based on layout correction and storage medium
CN116416624A
Answer sheet consistency verification method and system based on OCR (Optical Character Recognition)
CN117894033A
Intelligent correction method and device for answer sheet image from global to local
CN119478955A