Method, system and device for correcting ocr recognition result in answer consistency verification and medium
By splitting the OCR recognition area into single-character images and combining multiple recognition models and shape feature correction, the problems of inaccurate OCR recognition area positioning and poor result interpretability are solved, thus improving the accuracy of questionnaire consistency verification.
Patent Information
- Application Number
- CN202510219468.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-02-26
AI Technical Summary
In existing questionnaire consistency verification, the OCR recognition area is not accurately located and the recognition results are poorly interpretable, making it impossible to effectively correct questionable results.
By splitting the OCR recognition region into multiple single-character images, multiple recognition models are used for aggregated recognition, and logical judgment corrections are made based on shape features and confidence levels. LeNet and AlexNet network models are combined with parallel ensemble learning methods, along with baseline region localization and stretching correction.
It improves the positioning accuracy of the OCR recognition area and the reliability of the recognition results, and enhances the accuracy of answer sheet consistency verification.
Smart Images

Figure CN120260060B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of answer sheet consistency verification technology, and specifically relates to a method, system, device and medium for correcting OCR recognition results in answer sheet consistency verification. Background Technology
[0002] To ensure that the answer sheet information corresponds correctly with the candidate information during the answer sheet scanning process, the information filled in by the candidate must be recognized by OCR and the answer sheets with abnormal keyword consistency must be manually checked to prevent answer sheet scanning errors.
[0003] Current answer sheet consistency verification processes primarily involve cropping the recognition area according to coordinates and then inputting it into the OCR recognition model to obtain the examinee's information. This ignores common issues during scanning, such as answer sheet stretching and deformation, which can lead to inaccurate recognition area positioning. Furthermore, commonly used OCR recognition technologies employ single-box neural network models, resulting in poor interpretability of the recognition results. During the recognition process, it is generally impossible to further analyze and process the model's output, or effectively correct questionable recognition results. Summary of the Invention
[0004] The purpose of this invention is to provide a method, system, device, and medium for correcting OCR recognition results in answer sheet consistency verification, so as to improve the OCR recognition area positioning effect and the recognition rate of doubtful results, and better perform answer sheet consistency verification.
[0005] In a first aspect, embodiments of this application provide a method for correcting OCR recognition results in answer sheet consistency verification, comprising:
[0006] During the answer sheet scanning process, the OCR recognition area is determined based on the relative position of the pre-set reference area in the answer sheet, and the OCR recognition area is split into multiple single character images;
[0007] For each single character image, image preprocessing is performed, and a multi-recognition model is used to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels. The multi-recognition model includes a first network model for recognizing simple characters and a second network model for recognizing complex characters, which are aggregated based on a parallel ensemble learning method.
[0008] If, based on the recognition results and confidence level, it is determined that the OCR recognition results need to be corrected, then the shape features of each single character image are extracted, and logical judgments are made on the questionable characters and their candidate characters according to the shape features. If the candidate character features match the target character and the target character's confidence level in the output meets the preset conditions, then the questionable character is corrected to a candidate character.
[0009] Optionally, during the questionnaire scanning process, the OCR recognition area is determined based on the relative position of a pre-set reference area within the questionnaire, including:
[0010] Select an area on the answer sheet that can be used as a positional reference as the reference area, and use the area on the answer sheet that is expanded outward from the reference area of the sample card by a preset multiple as the detection space of the reference area.
[0011] Locate and position candidate points within the detection space that satisfy the shape characteristics of the reference area of the sample card. Determine the position of the candidate point closest to the reference area as the position of the answer sheet reference area. Calculate the OCR recognition area on the answer sheet based on the relative position of the reference area on the sample card and the OCR recognition area.
[0012] If no reference area is detected, the location of the reference area on the sample card will be determined as the reference area location on the answer sheet, and the OCR recognition area on the answer sheet will be calculated based on the relative position of the reference area on the sample card and the OCR recognition area.
[0013] If the answer sheet is stretched during scanning, the stretching direction is determined according to the scanning direction of the answer sheet. Two reference areas are found in the OCR recognition area according to the stretching direction as positioning reference points. The stretching ratio of the answer sheet is calculated by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet. The position of the OCR recognition area is obtained after conversion based on the stretching ratio.
[0014] Optionally, image preprocessing operations may be performed on each single-character image, including:
[0015] Extract the OCR recognition area from the answer sheet and separate the candidate's handwriting from the background color of the answer sheet;
[0016] By eliminating interference factors within the OCR recognition area through contour detection and area determination, the OCR recognition area is divided equally according to the number of recognition bits.
[0017] For each single-character detection region after equal division, a connected component analysis algorithm is used to detect the outer contour of the handwritten character and obtain the minimum bounding rectangle of each character. The handwritten character images are then uniformly scaled to a standard size.
[0018] Optionally, a multi-recognition model is used to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels, including:
[0019] Before performing OCR recognition of the answer sheet, multiple independent recognition models are trained and generated according to the OCR content to be recognized. If simple characters including but not limited to numbers or English letters are to be recognized, the LeNet network model is selected. If complex characters including but not limited to Chinese characters are to be recognized, the AlexNet network model is selected.
[0020] Based on the parallel ensemble learning method, LeNet or AlexNet network models are aggregated to output multiple sets of recognition results during questionnaire recognition. Each set of recognition results contains questionable characters and their corresponding confidence levels, and the character with the highest confidence level in each set is taken as the recognition result of that set.
[0021] Optionally, based on the recognition result and confidence level, determine whether the OCR recognition result needs to be corrected, including:
[0022] Based on OCR recognition experience, a first threshold and a second threshold are preset, wherein the first threshold is less than the second threshold;
[0023] When the confidence level is lower than the first threshold and multiple recognition results are inconsistent, the recognition result is considered to be an invalid character.
[0024] When the confidence level is higher than the first threshold but lower than the second threshold and multiple recognition results are inconsistent, the recognition result is considered a questionable character and the result needs to be corrected.
[0025] When multiple recognition results are consistent or the confidence level is higher than the second threshold, the recognition result is considered a valid character.
[0026] Optionally, the method for correcting the OCR recognition result in the answer sheet consistency verification also includes: verifying the recognized valid characters with the barcode information or OMR information affixed to the candidate's answer sheet; if the verification is inconsistent or the characters are invalid, submitting the answer sheet information to the quality inspector for verification and processing.
[0027] Optionally, the shape features extracted for each single character image 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.
[0028] Secondly, embodiments of this application also provide a system for correcting OCR recognition results in answer sheet consistency verification, comprising:
[0029] The positioning module is used to determine the OCR recognition area based on the relative position of a pre-set reference area in the answer sheet during the answer sheet scanning process, and to split the OCR recognition area into multiple single-character images;
[0030] The recognition module is used to perform image preprocessing operations on each single character image, and to use multiple recognition models to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels. The multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters, which are aggregated based on a parallel ensemble learning method.
[0031] The correction module is used to extract the shape features of each single character image when it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level. The module then performs a logical judgment on the questionable character and its candidate characters based on the shape features. If the candidate character features match the target character and the target character's confidence level in the output meets the preset conditions, the questionable character is corrected to a candidate character.
[0032] Thirdly, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method for correcting the OCR recognition result in the questionnaire consistency verification.
[0033] Fourthly, embodiments of this application also provide a storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the steps of the above-described method for correcting the OCR recognition result in the answer sheet consistency verification.
[0034] As can be seen from the above technical solutions, the present invention has the following advantages:
[0035] The method, system, device, and medium for correcting OCR recognition results in answer sheet consistency verification provided in this application locate the OCR recognition area based on the answer sheet reference area position, split the characters within the recognition area and preprocess them into standard character images, and then sequentially input the single character images into the aggregation model for OCR recognition and obtain the recognition confidence. When the recognition result correction conditions are met, the recognition result is corrected based on the shape characteristics and confidence of the characters. By using multi-reference area positioning, the problem of inaccurate positioning caused by stretching deformation of the answer sheet during scanning can be effectively reduced. Further logical correction of the recognition result can improve the OCR recognition effect, thereby improving the accuracy of consistency data. Attached Figure Description
[0036] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating a method for correcting OCR recognition results in answer sheet consistency verification, provided by an embodiment of the present invention;
[0038] Figure 2 A flowchart for determining the OCR recognition area is provided in an embodiment of the present invention;
[0039] Figure 3A detailed flowchart of a method for correcting OCR recognition results in answer sheet consistency verification provided by an embodiment of the present invention;
[0040] Figure 4 This is a schematic diagram of the structure of an OCR recognition result correction system for answer sheet consistency verification provided in an embodiment of the present invention;
[0041] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0042] Various embodiments of this disclosure will be described more fully in the following detailed description. This 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 this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.
[0043] In the following, the terms “comprising” or “may include”, which may be used in various embodiments of this disclosure, indicate the presence of the disclosed functions or operations and do not limit the addition of one or more functions or operations. Furthermore, as used in various embodiments of this disclosure, the terms “comprising,” “having,” and their cognates are intended only to indicate a specific feature, number, step, operation, or combination of the foregoing and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, or combinations of the foregoing, or the possibility of adding one or more features, numbers, steps, operations, or combinations of the foregoing.
[0044] In various embodiments of this disclosure, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] See Figure 1 The diagram shows a flowchart of a method for correcting OCR recognition results in answer sheet consistency verification in a specific embodiment, including the following execution steps:
[0047] Step 100: During the answer sheet scanning process, the OCR recognition area is determined based on the relative position of the pre-set reference area in the answer sheet, and the OCR recognition area is split into multiple single-character images.
[0048] It should be understood that before scanning the answer sheet, the positions of the reference area and the area to be recognized are set. During the scanning, the OCR recognition area is calculated and determined based on the relative position of the reference area. The area is then split into multiple individual character images based on the number of recognition bits and image preprocessing operations are performed.
[0049] For details, please refer to Figure 2 As shown, when executing step 100, the following steps can be specifically performed:
[0050] S1000: The area on the answer sheet that is an extension of the sample card reference area to the edge of the answer sheet by a preset multiple is used as the OCR recognition area.
[0051] S1001: Locate and position candidate points within the OCR recognition area that satisfy the shape characteristics of the reference area of the sample card, determine the position of the candidate point closest to the reference area of the sample card as the reference area position of the answer sheet, and calculate the OCR recognition area on the answer sheet based on the relative position of the reference area position of the answer sheet and the recognition area.
[0052] S1002: If no reference area is detected, the reference area position of the sample card is determined as the reference area position of the answer sheet, and the OCR recognition area on the answer sheet is calculated based on the relative position of the reference area and the recognition area on the sample card.
[0053] S1003: If the answer sheet is stretched during scanning, the stretching direction is determined according to the scanning direction of the answer sheet. Two reference areas are found in the OCR recognition area according to the stretching direction as positioning points. The stretching ratio of the answer sheet is calculated by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet. The OCR recognition area is obtained after conversion based on the stretching ratio.
[0054] In one specific implementation, the method for performing reference region localization detection is as follows: acquire an image of the answer sheet sample card, set an OCR recognition area, and define the area as {(xOcr1,yOcr1), (xOcr2,yOcr2)}, where the coordinates of the upper left and lower right corners are respectively. Based on the position of the recognition area, select the nearest reference area as the relative position reference point, and define the reference area as {(xAnchor1,yAnchor1), (xAnchor2,yAnchor2)}. During answer sheet scanning, the detection area is defined as an area twice the size of the reference area on the sample card. If the answer sheet size is h * w, to ensure it does not exceed the answer sheet area, the detection area is defined as {(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 detection area image, contour detection is performed, and the positions of all areas similar in shape to the reference area on the sample card are recorded. To prevent the answer sheet from being stretched and deformed, the search criteria can be appropriately relaxed. After locating all candidate regions within the area that meet the shape characteristics of the reference region, the reference region position closest to the sample card reference region position is determined as the answer sheet reference region position. If no reference region is detected, the sample card reference region position is determined as the answer sheet reference region position. The coordinates of the upper left corner of the detected reference region on the answer sheet are defined as (xRealAnchor1, yRealAnchor1). Then the answer sheet OCR recognition region position is {(xRealAnchor1+ xOcr1- xAnchor1, yRealAnchor1+ yOcr1- yAnchor1), (xRealAnchor1+ xOcr2- xAnchor1, yRealAnchor1+ yOcr2- yAnchor1)}.
[0055] It should be noted that due to differences in scanner feed speed or feed orientation during batch scanning of answer sheets, the scanned answer sheet images may be stretched and distorted in the feed direction. Therefore, to accurately locate and identify the recognition area, two different reference area positioning points should be selected for auxiliary positioning in the stretch direction, and the detection method for each positioning point is the same as described above. Define the upper left corner coordinates of reference area A on the sample card as (xAnchorA1, yAnchorA1), and the upper left corner coordinates of reference area B as (xAnchorB1, yAnchorB1). On the answer sheet being detected, the upper left corner coordinates of reference area A are (xRealAnchorA1, yRealAnchorA1), and the upper left corner coordinates of reference area B are (xRealAnchorB1, yRealAnchorB1). If the answer sheet is stretched horizontally, 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 coordinates of the upper left corner of the OCR recognition area on the answer sheet are ((xAnchorA1 + int((xOcr1 - xAnchorA1) * deltaRealX / deltaX)), (yAnchorA1 + yOcr1 - yAnchorA1)). Similarly, the position of the recognition area when stretched vertically can be calculated.
[0056] Step 101: Perform image preprocessing for each single character image, and use a multi-recognition model to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels. The multi-recognition model includes a first network model for recognizing simple characters and a second network model for recognizing complex characters, which are aggregated based on a parallel ensemble learning method.
[0057] For example, image preprocessing operations are performed on each single character image, including: extracting the OCR recognition area from the answer sheet and separating the candidate's handwriting from the answer sheet background color through binarization and other methods; removing interference factors in the OCR recognition area through contour detection and area determination, and dividing the OCR recognition area equally according to the number of recognition bits; for each single character detection area after equal division, using a 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 a standard size.
[0058] For example, interference factors such as stains are used to divide the recognition area equally by the number of recognition bits n, that is, the width of each part is w / n.
[0059] Specifically, the steps for using multiple recognition models to aggregate and recognize preprocessed character images, and outputting recognition results and confidence levels are as follows:
[0060] S1: Before performing OCR recognition of the answer sheet, train and generate multiple independent recognition models according to the OCR content to be recognized. 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.
[0061] S2: Based on the parallel ensemble learning method, aggregate the LeNet network model or the AlexNet network model to output multiple sets of recognition results during the questionnaire recognition. Each set of recognition results contains the questionable characters and their corresponding confidence levels, and the character with the highest confidence level in each set is taken as the recognition result of that set.
[0062] Specifically, multiple batches of independent datasets are used to train the model separately. The neural network model with the highest recognition rate in each batch is selected as the aggregation component. Based on the parallel ensemble learning method, the various components are aggregated to build an OCR recognition model group. When recognizing the answer sheet, the OCR recognition model group can output multiple sets of recognition results for the recognized character images.
[0063] For example, consider an OCR recognition model group constructed by aggregating m recognition models. The output of the i-th model is denoted as output_i, and its corresponding confidence level is p_i, where p_i is the highest confidence value among the suspicious characters identified in this group. Therefore, the set of recognition results from the recognition model group is {output_1:p_1, output_2:p_2, ..., output_m:p_m}. The group of recognition results with the highest confidence level, output_i:p_i, is selected as the initial result, and a determination is made based on the conditions to determine whether result correction is needed.
[0064] Step 102: If, based on the recognition result and confidence level, it is determined that the OCR recognition result needs to be corrected, then the shape features of each single character image are extracted, and logical judgment is made on the questionable character and its candidate character according to the shape features. If the candidate character features match the target character and the target character's confidence level in the output meets the preset conditions, then the questionable character is corrected to a candidate character.
[0065] 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 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.
[0066] 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 being crossed out or stained interference, etc.); 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. Both invalid characters and valid characters are subjected to answer sheet consistency verification, and doubtful characters are corrected for recognition results.
[0067] In a specific implementation manner, when the result correction condition is met, the character output_a with the maximum confidence output by the OCR recognition model group is the doubtful character, and the alternative character group {output_b, output_c...} that is inconsistent with the doubtful character among the remaining groups of recognition results. Shape feature detection is performed on the doubtful character image. When the doubtful character image contains the shape feature of an alternative character output_i that the character should not have, the alternative character is listed as the key concern 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.
[0068] For example, the shape features extracted for each single character image 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. During result correction, multiple feature types can be freely combined for detection based on the image conditions of the suspected character and candidate characters. This embodiment uses handwritten digits as an example. 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. The detection and correction process is similar to this embodiment. For example, the number of inner contours in the handwritten digit "8" is generally 1 or 2, and the left side of the character is not a convex hull; the number of inner contours in the handwritten digit "6" is generally 0 or 1, and the left side of the character is generally a convex hull. When the upper side of the "6" written by the examinee has a high degree of curvature, there is a risk of misidentifying it as "8". Shape feature detection based on the result correction logic can correct the result.
[0069] In some implementations, 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 affixed to the candidate's answer sheet or the OMR information painted on it; if the verification is inconsistent or the characters are invalid, the answer sheet is submitted to the quality inspector for verification and processing.
[0070] In this embodiment, the OCR recognition area is located based on the answer sheet reference area; the characters within the recognition area are split and preprocessed into standard character images; the single character images are sequentially fed into the aggregation model for OCR recognition and the recognition confidence is obtained; when the recognition result correction conditions are met, the recognition result is corrected based on the shape features and confidence of the characters; the consistency between the candidate's handwritten information and the database information is verified. In the process of verifying the consistency information of the answer sheet, the multi-reference area positioning can effectively reduce the problem of inaccurate positioning caused by the stretching and deformation of the answer sheet during scanning. Further logical correction of the recognition result can improve the OCR recognition effect, thereby improving the accuracy of the consistency data.
[0071] In one embodiment, Figure 3 This is a detailed flowchart of a method for correcting OCR recognition results in answer sheet consistency verification according to an embodiment of the present invention. This embodiment is further optimized and expanded based on the above embodiments.
[0072] S300: The area on the answer sheet that is an extension of the sample card reference area to the edge of the answer sheet by a preset multiple is used as the reference area detection space.
[0073] S301: Locate and position candidate points within the detection space that satisfy the shape characteristics of the reference area of the sample card, determine the position of the candidate point closest to the reference area of the sample card as the reference area position of the answer sheet, and calculate the OCR recognition area on the answer sheet based on the relative position of the reference area position of the answer sheet and the recognition area.
[0074] S302: If no reference area is detected, the reference area position of the sample card is determined as the reference area position of the answer sheet, and the OCR recognition area on the answer sheet is calculated based on the relative position of the reference area and the recognition area on the sample card.
[0075] S303: If the answer sheet is stretched during scanning, the stretching direction is determined according to the scanning direction of the answer sheet. Two reference areas are found in the OCR recognition area according to the stretching direction as positioning points. The stretching ratio of the answer sheet is calculated by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet. The OCR recognition area is obtained after conversion based on the stretching ratio.
[0076] S304: Divide the OCR recognition area into multiple single-character images, and perform image preprocessing operations on each single-character image.
[0077] S305: Before performing OCR recognition of the answer sheet, train and generate multiple independent recognition models according to the OCR content to be recognized. 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.
[0078] S306: Based on the parallel ensemble learning method, the LeNet network model or the AlexNet network model is aggregated to output multiple sets of recognition results during the questionnaire recognition. Each set of recognition results contains the questionable characters and their corresponding confidence levels, and the character with the highest confidence level in each set is taken as the recognition result of that set.
[0079] S307: If, based on the recognition result and confidence level, it is determined that the OCR recognition result needs to be corrected, then the shape features of each single character image are extracted, and logical judgment is made on the questionable character and its candidate character according to the shape features. If the candidate character features match the target character and the target character's confidence level in the output meets the preset conditions, then the questionable character is corrected to a candidate character.
[0080] S308: Verify the identified valid characters against the barcode information or OMR information affixed to the candidate's answer sheet. If the verification is inconsistent or the characters are invalid, submit the answer sheet to the quality inspector for verification and processing.
[0081] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0082] like Figure 4As shown, the following is an embodiment of the OCR recognition result correction system in the questionnaire consistency verification provided by this disclosure. It belongs to the same inventive concept as the OCR recognition result correction method in the questionnaire consistency verification of the above embodiments. For details not described in detail in the embodiment of the OCR recognition result correction system in the questionnaire consistency verification, please refer to the embodiment of the OCR recognition result correction method in the questionnaire consistency verification described above.
[0083] The system for correcting OCR recognition results in answer sheet consistency verification includes:
[0084] The positioning module is used to determine the OCR recognition area based on the relative position of a pre-set reference area in the answer sheet during the answer sheet scanning process, and to split the OCR recognition area into multiple single-character images;
[0085] The recognition module is used to perform image preprocessing operations on each single character image, and to use multiple recognition models to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels. The multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters, which are aggregated based on a parallel ensemble learning method.
[0086] The correction module is used to extract the shape features of each single character image when it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level. The module then performs a logical judgment on the questionable character and its candidate characters based on the shape features. If the candidate character features match the target character and the target character's confidence level in the output meets the preset conditions, the questionable character is corrected to a candidate character.
[0087] Figure 5 This is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of the present invention.
[0088] The method for correcting OCR recognition results in questionnaire consistency verification provided in this application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, 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 this application described and / or claimed herein.
[0089] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.
[0090] It is understood that the structures illustrated in the embodiments of this application do 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 illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0091] A processor may include one or more processing units, such as a central processing unit (CPU), application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0092] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0093] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.
[0094] An external storage interface (ESI) can be used to connect external memory cards, such as microSD cards, to expand the storage capacity of electronic devices. The external memory card communicates with the processor through the ESI to perform data storage functions, such as saving music and video files on the external memory card.
[0095] Internal memory can be used to store computer executable program code, which includes instructions. The processor executes various functional applications and data processing of electronic devices by running the instructions stored in internal memory. Internal memory can include a program storage area and a data storage area. Internal memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0096] Wireless communication functionality in electronic devices can be achieved through antennas, wireless communication modules, modem processors, and baseband processors.
[0097] Wireless communication modules can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0098] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.
[0099] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.
[0100] Electronic devices can achieve display functions through GPUs, displays, and application processors.
[0101] A GPU is a microprocessor for image processing, connected to the display screen and application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information.
[0102] A display screen is used to display images, videos, etc. A display screen includes a display panel.
[0103] The storage medium provided in this application stores a program product capable of implementing a method for correcting OCR recognition results in answer sheet consistency verification.
[0104] The method for correcting OCR recognition results in answer sheet consistency verification includes: during the answer sheet scanning process, determining the OCR recognition area based on the relative position of a pre-set reference area in the answer sheet, and splitting the OCR recognition area into multiple single-character images; performing image preprocessing operations on each single-character image, and using a multi-recognition model to aggregate and recognize the preprocessed character images, outputting the recognition result and confidence level, wherein 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 a 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, then the shape features of each single-character image are extracted, and logical judgment is performed on the questionable character and its candidate characters based on the shape features. If the candidate character features match the target character and the target character's confidence level in the output meets the preset conditions, then the questionable character is corrected to a candidate character.
[0105] In some possible implementations, the subject matter of this disclosure, namely, the method, system, device, and medium for correcting OCR recognition results in questionnaire consistency verification, can be implemented as a program product comprising program code. When the program product is run on a terminal device, the program code is used to cause the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0106] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0107] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to 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, include: During the answer sheet scanning process, the OCR recognition area is determined based on the relative position of the pre-set reference area in the answer sheet, and the OCR recognition area is split into multiple single character images; For each single character image, image preprocessing is performed, and a multi-recognition model is used to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels. The multi-recognition model includes a first network model for recognizing simple characters and a second network model for recognizing complex characters, which are aggregated based on a parallel ensemble learning method. If, based on the recognition results and confidence level, it is determined that the OCR recognition results need to be corrected, then the shape features of each single character image are extracted, and logical judgments are made on the questionable characters and their candidate characters according to the shape features. If the features of the candidate character match the target character and the target character's confidence level in the output meets the preset conditions, then the questionable character is corrected to a candidate character. During the answer sheet scanning process, the OCR recognition area is determined based on the relative position of the pre-set reference area within the answer sheet, including: The area on the answer sheet that is an expansion of the sample card's reference area outwards from the edge of the answer sheet by a preset multiple is used as the reference area detection space. Find and locate candidate points within the OCR recognition area that satisfy the shape characteristics of the reference area of the sample card. Determine the position of the candidate point closest to the reference area of the sample card as the reference area position of the answer sheet. Calculate the OCR recognition area on the answer sheet based on the relative position of the reference area position and the recognition area. If no reference area is detected, the reference area position on the sample card is determined as the reference area position on the answer sheet, and the OCR recognition area on the answer sheet is calculated based on the relative position of the reference area and the recognition area on the sample card. If the answer sheet is stretched during scanning, the stretching direction is determined according to the scanning direction of the answer sheet. Two reference areas are found in the OCR recognition area according to the stretching direction as positioning points. The stretching ratio of the answer sheet is calculated by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet. The OCR recognition area is obtained after conversion based on the stretching ratio.
2. The method for correcting OCR recognition results in answer sheet consistency verification according to claim 1, characterized in that, For each single-character image, perform image preprocessing operations, including: Extract the OCR recognition area from the answer sheet and separate the candidate's handwriting from the background color of the answer sheet; Interference factors within the OCR recognition area are eliminated through contour detection and area determination, and the OCR recognition area is divided equally according to the number of recognition bits. For each single-character detection region after equal division, a connected component analysis algorithm is used to detect the outer contour of the handwritten character and obtain the minimum bounding rectangle of each character. The handwritten character images are then uniformly scaled to a standard size.
3. The method for correcting OCR recognition results in answer sheet consistency verification according to claim 1, characterized in that, A multi-recognition model is used to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels, including: Before performing OCR recognition of the answer sheet, multiple independent recognition models are trained and generated according to the OCR content to be recognized. If simple characters including but not limited to numbers or English letters are to be recognized, the LeNet network model is selected. If complex characters including but not limited to Chinese characters are to be recognized, the AlexNet network model is selected. Based on the parallel ensemble learning method, LeNet or AlexNet network models are aggregated to output multiple sets of recognition results during questionnaire recognition. Each set of recognition results contains questionable characters and their corresponding confidence levels, and the character with the highest confidence level in each set is taken as the recognition result of that set.
4. The method for correcting OCR recognition results in answer sheet consistency verification according to claim 1, characterized in that, Based on the recognition results and confidence levels, determine whether the OCR recognition results need to be corrected, including: Based on OCR recognition experience, a first threshold and a second threshold are preset, wherein the first threshold is less than the second threshold; When the confidence level is lower than the first threshold and multiple recognition results are inconsistent, the recognition result is considered to be an invalid character. When the confidence level is higher than the first threshold but lower than the second threshold and multiple recognition results are inconsistent, the recognition result is considered a questionable character and the result needs to be corrected. When multiple recognition results are consistent or the confidence level is higher than the second threshold, the recognition result is considered a valid character.
5. The method for correcting OCR recognition results in answer sheet consistency verification according to claim 4, characterized in that, The method for correcting the OCR recognition results in the consistency verification of the answer sheet also includes: verifying the recognized valid characters with the barcode information or OMR information affixed to the candidate's answer sheet; when the verification is inconsistent or the characters are invalid, the answer sheet is submitted to the quality inspector for verification and processing.
6. The method for correcting OCR recognition results in answer sheet consistency verification according to claim 1, characterized in that, The shape features extracted for each single character image 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.
7. A system for correcting OCR recognition results in answer sheet consistency verification, characterized in that, include: The positioning module is used to determine the OCR recognition area based on the relative position of a pre-set reference area in the answer sheet during the answer sheet scanning process, and to split the OCR recognition area into multiple single-character images; The recognition module is used to perform image preprocessing operations on each single character image, and to use multiple recognition models to aggregate and recognize the preprocessed character images, outputting the recognition results and confidence levels. The multiple recognition models include a first network model for recognizing simple characters and a second network model for recognizing complex characters, which are aggregated based on a parallel ensemble learning method. The correction module is used to extract the shape features of each single character image if it is determined that the OCR recognition result needs to be corrected based on the recognition result and the confidence level, and to make logical judgments on the questionable character and its candidate characters according to the shape features. If the candidate character features match the target character and the target character's confidence level in the output meets the preset conditions, then the questionable character is corrected to a candidate character. The positioning module is also used to use the area on the answer sheet that is an expansion of the sample card reference area to the edge of the answer sheet by a preset multiple as the reference area detection space; Find and locate candidate points within the OCR recognition area that satisfy the shape characteristics of the reference area of the sample card. Determine the position of the candidate point closest to the reference area of the sample card as the reference area position of the answer sheet. Calculate the OCR recognition area on the answer sheet based on the relative position of the reference area position and the recognition area. If no reference area is detected, the reference area position on the sample card is determined as the reference area position on the answer sheet, and the OCR recognition area on the answer sheet is calculated based on the relative position of the reference area and the recognition area on the sample card. If the answer sheet is stretched during scanning, the stretching direction is determined according to the scanning direction of the answer sheet. Two reference areas are found in the OCR recognition area according to the stretching direction as positioning points. The stretching ratio of the answer sheet is calculated by combining the distance between the two reference areas on the sample card and the distance between the reference areas on the answer sheet. The OCR recognition area is obtained after conversion based on the stretching ratio.
8. An electronic device comprising a memory, a processor, and a computer program stored in 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 questionnaire consistency verification as described in any one of claims 1 to 6.
9. 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 questionnaire consistency verification as described in any one of claims 1 to 6.
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
Answer sheet consistency verification method and system based on OCR (Optical Character Recognition)
CN117894033A