Intelligent test paper interpretation method and device based on OCR algorithm
Through the denoising, segmentation and semantic analysis of the intelligent interpretation method of OCR test papers, combined with standard answer template alignment and twin network calculation, the problem of noise and question type alignment is solved, and efficient and accurate interpretation of the test papers is achieved, reducing labor costs and subjective impacts .
Patent Information
- Application Number
- CN202410950978.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-16
AI Technical Summary
The existing intelligent interpretation method of OCR test papers is difficult to effectively deal with noise, the order alignment of different question types and multiple question types, resulting in inaccurate identification results.
Using the intelligent interpretation method of the test paper based on the OCR algorithm, the answer rectangular boxes are obtained through denoising and segmentation processing, and the answers to large questions are aligned with standard answer templates. OCR is used to identify objective questions and subjective questions, and the score is determined through the twin network to calculate semantic similarity. .
It improves the accuracy and efficiency of the evaluation of the test paper, reduces labor costs, is compatible with multiple question types and spread questions, and realizes automated and efficient marking.
Smart Images

Figure CN118942099A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an intelligent test paper reading method and device based on an OCR algorithm. Background Art
[0002] The optical character recognition (OCR) test paper intelligent interpretation method includes OCR algorithm and image analysis algorithm. In the OCR algorithm, it is impossible to analyze the entire test paper layout and obtain the answers to all questions. Specifically, there are the following problems in the current test paper interpretation: 1. Test papers usually contain noise, such as Gaussian noise, large black block noise, and rectangular frame noise, which will affect the recognition results. 2. The order and number of different types of questions in the test paper are different. How to align the recognized questions and question types is a difficulty. 3. The test paper contains a variety of question types, including single-choice questions, multiple-choice questions, judgment questions, fill-in-the-blank questions, and question-and-answer questions. Each question type is different, and the answer method is also different. How to deal with all question types is also a difficulty.
[0003] Based on the above problems, a new test paper intelligent reading method is urgently needed to improve the accuracy of test paper reading results. Summary of the invention
[0004] The purpose of the present invention is to provide a method and device for intelligent examination paper reading based on OCR algorithm, which can improve the accuracy and efficiency of examination paper reading.
[0005] To achieve the above object, the present invention provides a test paper intelligent interpretation method based on OCR algorithm, comprising:
[0006] Obtain a scanned image of the answer sheet of the test paper to be judged and a standard answer template of the test paper to be judged; the standard answer template includes a plurality of arrays, each array corresponds to a small question, and each array includes a small question sequence number, a large question type to which the small question belongs, a small question answer, a small question option number, a small question score, and a large question number;
[0007] De-noising and segmenting the scanned image of the answer sheet in sequence to obtain a plurality of answer rectangular frames;
[0008] Align the question types and question sequences of multiple answer rectangles with the standard answer template, and use an OCR algorithm to identify the question type corresponding to each answer rectangle; the question types include objective questions and subjective questions;
[0009] For objective questions, determine the examinee's objective answer for each question according to the grayscale value of each option in the answer rectangle of each question, and compare the examinee's objective answer with the corresponding question answer in the standard answer template to determine the score of each question in the objective question;
[0010] For subjective questions, an OCR algorithm is used to identify the examinee's subjective answer to each question in the answer rectangle of the subjective question;
[0011] For any sub-question in the subjective question, a pre-trained twin network is used to determine the semantic similarity between the examinee's subjective answer to the sub-question and the corresponding sub-question answer in the standard answer template to obtain the score of the corresponding sub-question;
[0012] The total score of the scanned image of the answer sheet is determined according to the score of each question.
[0013] To achieve the above objectives, the present invention further provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.
[0014] According to the specific embodiment provided by the present invention, the present invention discloses the following technical effects: the present invention first performs denoising and segmentation processing on the scanned image of the answer sheet to better recognize characters, then aligns the scanned image of the answer sheet with the standard answer template, and finally recognizes each question in the scanned image of the answer sheet. For the recognition result, objective questions are directly scored using string comparison, and subjective questions are scored using semantic analysis and semantic similarity calculation, which greatly reduces labor costs and is not affected by human subjective marking. It can also be compatible with multiple question types and can also handle objective questions with different numbers of options and questions distributed across pages, thereby improving the accuracy and efficiency of marking. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0016] Figure 1 The present invention provides a flow chart of the method for intelligent examination paper interpretation based on the OCR algorithm.
[0017] Figure 2 Flowchart for denoising and segmentation of answer sheet scanned images.
[0018] Figure 3Schematic diagram of the scanned image of the answer sheet.
[0019] Figure 4 A flowchart for aligning the answer rectangle with the standard answer template.
[0020] Figure 5 Schematic diagram of the arrangement of the answer rectangle boxes.
[0021] Figure 6 This is a schematic diagram of the candidate information area.
[0022] Figure 7 This is a schematic diagram of the answer rectangle before correction.
[0023] Figure 8 This is a schematic diagram of the answer rectangle after correction.
[0024] Fig. 9 Schematic diagram of the basic structure of the twin network.
[0025] Fig.10 This is a diagram of the internal structure of a computer device. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The purpose of the present invention is to provide a method and device for intelligent examination paper interpretation based on OCR algorithm. On the basis of OCR algorithm, image analysis algorithm and semantic analysis algorithm, various examination paper formats and question types are fully considered, customized analysis is performed for each question type, and all recognition results can be aligned with the question number, and finally the answer and score of each question can be accurately obtained.
[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0029] like Figure 1 As shown, the test paper intelligent interpretation method based on OCR algorithm provided by the present invention includes:
[0030] S1: Obtain a scanned image of the answer sheet of the test paper to be judged and a standard answer template of the test paper to be judged. Obtain a PDF document by scanning the answer sheet, and then convert the PDF document into multiple RGB color images, namely, the scanned image of the answer sheet.
[0031] Specifically, the standard answer template includes multiple arrays, each array corresponds to a question, and each array includes the question number, the question type to which the question belongs, the question answer, the number of question options, the question score, and the question number. The standard answer template is a file in json format. The order of the questions in the standard answer template is consistent with the order of the questions in the answer sheet.
[0032] Taking each question as an example, the JSON format of the standard answer template is as follows:
[0033] {"sort": 1, "questionType": "single-choice question", "answer": ["C"], "optionNumber": 4, "questionScore": 2.0, "questionTypeSort": 1};
[0034] {"sort": 1, "questionType": "multiple choice question", "answer": ["A", "B", "C", "D"], "optionNumber": 4, "questionScore": 2.0, "questionTypeSort": 2};
[0035] {"sort": 1, "questionType": "True or False", "answer": ["0"], "optionNumber": 2, "questionScore": 1.0, "questionTypeSort": 3};
[0036] {"sort":1,"questionType":"Fill in the Blank","answer":["five years","ten years"],"optionNumber":2,"questionScore":1.0,"questionTypeSort":4};
[0037] {"sort":1,"questionType":"Question and Answer","answer":["Wireless communication devices can become secondary transmitting devices"],"optionNumber":1,"questionScore":4.0,"questionTypeSort":5}.
[0038] Among them, the field "sort" represents the sequence number of each question, the field "questionType" represents the type of question to which the question belongs, the field "answer" represents the answer to the question, the field "optionNumber" represents the number of options for the question, if it is a fill-in-the-blank question, it represents the number of blanks to fill in, if it is a short-answer question, the value is always 1, the field "questionScore" represents the score of the question, and the field "questionTypeSort" represents the question number.
[0039] S2: De-noising and segmenting the scanned image of the answer sheet in sequence to obtain a plurality of answer rectangular frames.
[0040] Specifically, this step removes noise from the test paper layout. Before intelligent interpretation of the test paper, the scanned answer sheet image needs to be denoised. Since each candidate's answer is different, the angle of the answer sheet is slightly changed when scanning the answer sheet, and the scanning effect of the scanning instrument is different, the scanned image of the answer sheet will produce certain noise, including Gaussian noise, large black block noise and rectangular frame noise. The present invention performs a series of operations such as grayscale conversion, Gaussian filtering, edge detection, rectangular frame extraction, and rectangular frame filtering on the answer sheet to remove noise. Figure 2 As shown, S2 specifically includes the following steps:
[0041] S21: Convert the scanned image of the answer sheet into a grayscale image.
[0042] S22: Gaussian filtering is performed on the grayscale image to obtain a filtered image. Specifically, a 7×7 filter kernel is used to perform a convolution operation on the grayscale image, and the filter kernel is used as a weight, multiplied with the corresponding pixels and then added. The result is the filtered image, which can effectively remove the edge noise of the grayscale image.
[0043] S23: Perform edge detection on the filtered image to determine edge information of the answer box, and use a double threshold algorithm to convert the edge information into a binary image.
[0044] In this embodiment, Canny edge detection is performed on the filtered image, the edge of the large question frame is determined by calculating the amplitude and direction of the gradient of the filtered image, and the final edge information is determined using a double threshold algorithm and saved in a binary image.
[0045] S24: extracting closed contours in the binary image using a connected domain algorithm to obtain multiple closed contours.
[0046] S25: Determine the minimum circumscribed rectangle of each closed contour to obtain multiple minimum circumscribed rectangles. Specifically, for any closed contour, calculate the convex hull of the contour point set of the closed contour. Use a rotating caliper algorithm to determine the minimum circumscribed rectangle of the convex hull to obtain the minimum circumscribed rectangle of the closed contour.
[0047] S26: According to the area, length and width of each minimum circumscribed rectangle, multiple minimum circumscribed rectangles are screened to obtain the answering rectangle. Specifically, the minimum circumscribed rectangles whose area is less than the set area threshold and whose length and width are both less than the set length and width threshold are filtered to obtain multiple candidate rectangles. The non-overlapping candidate rectangles and the candidate rectangle with the largest area among the overlapping candidate rectangles are used as the answering rectangle.
[0048] In this embodiment, by traversing all minimum bounding rectangles, the minimum bounding rectangle with an area less than 5000 and a length and width less than 40 pixels is determined as a noise rectangle, and the noise rectangle is filtered using the area method. Then, the remaining candidate rectangular boxes are traversed, and the overlapping candidate rectangular boxes are filtered out using the intersection area method, and the candidate rectangular boxes with larger areas are retained as the answer rectangle boxes.
[0049] S3: Align the question types and question order of multiple answer rectangles with the standard answer template, and use the OCR algorithm to identify the question type corresponding to each answer rectangle. The question types include objective questions and subjective questions. The objective questions include single-choice questions, multiple-choice questions and multiple-choice questions. The subjective questions include fill-in-the-blank questions and essay questions.
[0050] Specifically, after obtaining all the answer rectangular boxes, since the order of question types on different answer sheets is different, and the number of small questions in each big question is also different, each big question may be distributed in different layouts of the answer sheet, so how to align the answer rectangular boxes and the question types is also a difficult point. The present invention first designs a standard answer template, and uses the question types on the standard answer template to align with the answer rectangular boxes.
[0051] like Figure 3The example shown is an actual answer sheet. The answer sheet consists of a candidate information area and a question area. All candidate information and questions are black hollow rectangular boxes. The candidate information area is located at the top of the first page of the answer sheet. It consists of three rectangular boxes of the same height and side by side, which are the candidate's name, candidate number and notes. The remaining area is the question area of the answer sheet. This answer sheet consists of five major questions: single-choice questions, multiple-choice questions, true-or-false questions, fill-in-the-blank questions and essay questions. Each major question consists of several small questions. Among them, single-choice questions, multiple-choice questions and true-or-false questions are small rectangular boxes that need to be blackened. Blackening the rectangular box means that the candidate has selected the option. Fill-in-the-blank questions and essay questions require the candidate to fill in the answer on the horizontal line in the rectangular box. Each small question of the essay question is a rectangular box. The question type of each major question is in the upper left corner of the rectangular box. For essay questions, only the upper left corner of the first rectangular box is the question type. There is no question type in the upper left corner of the other rectangular boxes. The essay question is the last major question.
[0052] like Figure 4 As shown, S3 specifically includes the following steps:
[0053] S31: Grouping the array in the standard answer template according to the question type to which the small questions belong, so that the question types and question sequences of multiple answer rectangles are aligned with the question types and question sequences in the standard answer template.
[0054] Specifically, the small questions belonging to the same big question are grouped together. Since the order of small questions in the standard answer template is consistent with the order of small questions in the answer rectangular box, the order of the answer rectangular box can be aligned one by one with the order of big questions in the standard answer template in the order of multiple-choice questions, multiple-choice questions, true-or-false questions, fill-in-the-blank questions, and essay questions.
[0055] Furthermore, since there are multiple pages of the answer sheet, and the divided answer rectangles are sorted from top to bottom on the original answer sheet page, such as Figure 5 As shown in the figure, the answer rectangles are sorted from 1 to 5, which is the order of the questions in the standard answer template. Then, the answer rectangles in the candidate information area are taken out and sorted according to the horizontal axis of the answer sheet. The second one is the candidate number box, as shown in the figure below. Figure 6 Take all the answer rectangles from the fourth to the last and sort them in the order of the vertical axis.
[0056] S32: Use a four-point correction method to calibrate each answer rectangle.
[0057] like Figure 7 As shown, since the answer sheets are placed and scanned manually, each answer sheet will be slightly tilted, causing the answer rectangle to have a certain angle with the horizontal direction. In order to ensure the accuracy of OCR recognition, it needs to be corrected.
[0058] (1) Figure 7 As shown, edge detection is performed on the answer sheet to obtain the coordinates of the four vertices of the answer rectangle: upper left, lower left, upper right and lower right.
[0059] (2) The maximum value of the horizontal coordinate distance between the upper left vertex and the upper right vertex and the horizontal coordinate distance between the lower left vertex and the lower right vertex is selected as the width maxWidth of the corrected image, and the maximum value of the vertical coordinate distance between the upper left vertex and the lower left vertex and the vertical coordinate distance between the upper right vertex and the lower right vertex is selected as the width maxHeight of the corrected image.
[0060] (3) Use the height and width of the corrected image to construct the four coordinate points of the image, which are (0, 0), (maxWidth-1, 0), (maxWidth-1, maxHeight-1]), and (0, maxHeight-1) in clockwise order from the upper left, upper right, lower right, and lower left.
[0061] (4) Calculate the reflection transformation matrix based on the above two sets of coordinates.
[0062] (5) Use the reflection transformation matrix to perform reflection transformation on the original answer box image to obtain the corrected image, such as Figure 8 shown.
[0063] S33: Expand the upper left corner of each corrected answer rectangular box to obtain multiple expanded answer rectangular boxes; the expanded answer rectangular boxes include a question type text area and an answer area.
[0064] S34: Using an OCR algorithm to recognize the text in the question type text area in each extended answer rectangle box to determine the type of question corresponding to each answer rectangle box.
[0065] Furthermore, in order to prevent some characters that are more difficult to judge from not being recognized, separate rules are established according to different question types to determine whether it is this question type: as long as the word "single" is recognized, it is judged as a single-choice question; if the word "multiple" is recognized, it is judged as a multiple-choice question; if the word "judge" or "duan" is recognized, it is judged as a judgment question; if the word "fill in" or "blank" is recognized, it is judged as a fill-in-the-blank question; if the word "ask" or "answer" is recognized, it is judged as a question and answer question; if no character is recognized, it means that the answer rectangle box is the same type as the previous answer rectangle box, and it can be directly merged with the previous answer rectangle box.
[0066] S4: For objective questions, determine the examinee's objective answer to each question based on the grayscale value of each option in the answer rectangle of each question, and compare the examinee's objective answer with the corresponding answer in the standard answer template to determine the score of each question in the objective question.
[0067] Specifically, for any question in the answer rectangle of the objective question, the option with a gray value less than the experience value is taken as the candidate's objective answer for the corresponding question. First, mark the position of each option, obtain the average gray value of all option boxes, and then compare it with the experience value. The smaller the gray value, the option is blackened. If the gray value is less than the experience value, it means that the candidate has selected the option, otherwise it is not selected. For single-choice questions and judgment questions, candidates are only allowed to select one option.
[0068] Since the answer sheet contains multiple types of questions, the answer method for each question is also different. For single-choice questions, multiple-choice questions and true-or-false questions, the examinee needs to black out the answer options on the answer sheet. However, there are also some difficulties. For example, the number of options for each multiple-choice question is different, and there are multiple candidate answers. For fill-in-the-blank questions, it is necessary to determine the range of the blanks for each question. In order to improve the accuracy of OCR recognition, the present invention recognizes each blank separately.
[0069] S5: For the subjective questions, an OCR algorithm is used to identify the examinee's subjective answer to each question in the answer rectangle of the subjective question.
[0070] For fill-in-the-blank questions, firstly, the blank area in the answer rectangle is segmented according to the number of each question in the standard answer template, and each segmented blank area is subjected to OCR recognition, and the recognition result is the answer filled in by the examinee. For essay questions, the entire answer rectangle is directly subjected to OCR recognition, and the recognition result is the answer filled in by the examinee.
[0071] S6: For any sub-question in the subjective questions, a pre-trained twin network is used to determine the semantic similarity between the examinee's subjective answer to the sub-question and the corresponding sub-question answer in the standard answer template to obtain the score of the corresponding sub-question.
[0072] Specifically, the answers to fill-in-the-blank questions and essay questions are semantically vectorized: the character text data is converted into a numerical data vector that can be understood by the machine, called a sentence vector. By using the twin network to generate a vector with semantics, the vectors of sentences with similar semantics are also similar. The basic structure of the twin network is as follows: Fig. 9 As shown in the figure, the twin network is a network framework used to measure whether two inputs are similar. The Bert model is used as the backbone network. During the training process, each group of inputs is two sentences. If the two sentences are semantically similar, their labels are 1, otherwise they are 0. Then the Bert model is used to calculate the sentence vectors of the sentences, and the cosine distance is used to calculate the similarity of the two sentence vectors, which are then compared with the labels to calculate the loss for training.
[0073] In this embodiment, the examinee's subjective answer and the corresponding answer to the small question in the standard answer template are respectively input into the Bert model. The examinee's subjective answer and the corresponding answer to the small question in the standard answer template share a Bert model parameter to obtain the examinee's answer sentence vector and the standard answer sentence vector. Then, the cosine distance between the examinee's answer sentence vector and the standard answer sentence vector is calculated as the semantic similarity between the examinee's subjective answer and the corresponding answer to the small question in the standard answer template, thereby obtaining the score of the small question. The calculation formula is as follows:
[0074]
[0075] Among them, s1 is the candidate's answer sentence vector, s2 is the standard answer sentence vector, n is the number of words in the sentence vector, and s 1i is the i-th word in the candidate's answer sentence vector, s 2i is the i-th word in the standard answer sentence vector.
[0076] S7: Determine the total score of the scanned image of the answer sheet according to the score of each question.
[0077] The present invention processes the answer sheet in a step-by-step pipeline manner, firstly denoising the answer sheet layout to better identify characters, then aligning the answer sheet layout, and finally identifying each question in the answer sheet. For the recognition result, objective questions are scored using a string comparison method, and subjective questions are scored using a semantic analysis and semantic similarity calculation method. The PDF scanned document of the examinee's answer sheet can be received in real time, and the processing time of each PDF document is within 2 seconds. Multiple documents can also be processed in parallel, which greatly reduces labor costs and is not affected by people's subjective marking. It can also be compatible with a variety of question types including single-choice questions, multiple-choice questions, judgment questions, fill-in-the-blank questions and essay questions, and can also process objective questions with different numbers of options, as well as questions distributed across pages. Through intelligent interpretation of test papers, an efficient and fast fully automatic test paper interpretation method is provided for users, which helps to improve the accuracy and efficiency of marking.
[0078] In one embodiment, a computer device is provided. The computer device may be a database, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test paper intelligent interpretation method based on an OCR algorithm is implemented.
[0079] In one embodiment, a computer device is also provided, including a memory and a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method for intelligent examination paper interpretation based on the OCR algorithm are implemented.
[0080] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method for intelligent interpretation of test papers based on the OCR algorithm are implemented.
[0081] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in the above-mentioned method for intelligent interpretation of test papers based on the OCR algorithm.
[0082] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.
[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0084] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0085] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A test paper intelligent interpretation method based on OCR algorithm, characterized in that: The test paper intelligent interpretation method based on OCR algorithm includes: Obtain a scanned image of the answer sheet of the test paper to be judged and a standard answer template of the test paper to be judged; the standard answer template includes a plurality of arrays, each array corresponds to a small question, and each array includes a small question sequence number, a large question type to which the small question belongs, a small question answer, a small question option number, a small question score, and a large question number; De-noising and segmenting the scanned image of the answer sheet in sequence to obtain a plurality of answer rectangular frames; Align the question types and question sequences of multiple answer rectangles with the standard answer template, and use an OCR algorithm to identify the question type corresponding to each answer rectangle; the question types include objective questions and subjective questions; For objective questions, determine the examinee's objective answer for each question according to the grayscale value of each option in the answer rectangle of each question, and compare the examinee's objective answer with the corresponding question answer in the standard answer template to determine the score of each question in the objective question; For subjective questions, an OCR algorithm is used to identify the examinee's subjective answer to each question in the answer rectangle of the subjective question; For any sub-question in the subjective question, a pre-trained twin network is used to determine the semantic similarity between the examinee's subjective answer to the sub-question and the corresponding sub-question answer in the standard answer template to obtain the score of the corresponding sub-question; The total score of the scanned image of the answer sheet is determined according to the score of each question.
2. The method for intelligent examination paper interpretation based on OCR algorithm according to claim 1, characterized in that: The standard answer template is a file in json format.
3. The method for intelligent examination paper interpretation based on OCR algorithm according to claim 1, characterized in that: The scanned image of the answer sheet is subjected to denoising and segmentation processing in sequence to obtain a plurality of answer rectangular frames, specifically including: Converting the scanned image of the answer sheet into a grayscale image; Performing Gaussian filtering on the grayscale image to obtain a filtered image; Perform edge detection on the filtered image to determine edge information of the answer box, and use a double threshold algorithm to convert the edge information into a binary image; A connected domain algorithm is used to extract closed contours in the binary image to obtain multiple closed contours; Determine the minimum circumscribed rectangle of each closed contour to obtain multiple minimum circumscribed rectangles; According to the area, length and width of each minimum circumscribed rectangle, multiple minimum circumscribed rectangles are screened to obtain an answer rectangle.
4. The method for intelligently interpreting test papers based on OCR algorithm according to claim 3, characterized in that: Determine the minimum enclosing rectangle of each closed contour, including: For any closed contour, calculating the convex hull of the contour point set of the closed contour; The minimum circumscribed rectangle of the convex hull is determined by using a rotating caliper algorithm to obtain the minimum circumscribed rectangle of the closed contour.
5. The method for intelligent examination paper interpretation based on OCR algorithm according to claim 3, characterized in that: According to the area, length and width of each minimum enclosing rectangle, multiple minimum enclosing rectangles are screened to obtain the answer rectangle frame, including: Filter the minimum bounding rectangle whose area is smaller than the set area threshold and whose length and width are smaller than the set length and width threshold, and obtain multiple candidate rectangular frames; The non-overlapping candidate rectangular boxes and the candidate rectangular box with the largest area among the overlapping candidate rectangular boxes are used as the answer rectangular boxes.
6. The method for intelligent examination paper interpretation based on OCR algorithm according to claim 1, characterized in that: Align the question types and question sequences of multiple answer rectangles with the standard answer template, and use an OCR algorithm to identify the question type corresponding to each answer rectangle, specifically including: The array in the standard answer template is grouped according to the question type to which the sub-questions belong, so that the question types and question sequences of the multiple answer rectangles are aligned with the question types and question sequences in the standard answer template; Use the four-point correction method to calibrate each answer rectangle; Expand the upper left corner of each corrected answer rectangular frame to obtain multiple expanded answer rectangular frames; the expanded answer rectangular frames include a question type text area and an answer area; The OCR algorithm is used to recognize the text in the question type text area in each extended answer rectangle to determine the type of question corresponding to each answer rectangle.
7. The method for intelligent examination paper interpretation based on OCR algorithm according to claim 1, characterized in that: According to the gray value of each option in the answer rectangle of the objective question, determine the examinee's objective answer to each question, including: For any question in the answer rectangle of the objective test, the option with a gray value less than the empirical value will be taken as the candidate's objective answer to the corresponding question.
8. The method for intelligent examination paper interpretation based on OCR algorithm according to claim 1, characterized in that: The twin network is a Bert model.
9. The method for intelligent examination paper interpretation based on OCR algorithm according to claim 1, characterized in that: The objective questions include single-choice questions, multiple-choice questions and multiple-choice questions; the subjective questions include fill-in-the-blank questions and essay questions.
10. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 9.
Citation Information
Cited By
Examination paper marking answer sheet filling identification method based on artificial intelligence and GAT
CN119399786A
