Examination paper correction method based on deep learning

By using deep learning technology and Hough line detection and YOLO v3 network to automatically identify the answer area of ​​the test paper, the problems of human intervention and low accuracy in the existing technology are solved, and intelligent and efficient automation of test paper grading is realized.

CN114550176BActive Publication Date: 2026-04-24CAIQIMAO (GUANGZHOU) INTELLECTUAL PROPERTY SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CAIQIMAO (GUANGZHOU) INTELLECTUAL PROPERTY SERVICE CO LTD
Filing Date
2022-02-22
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing intelligent test paper grading methods require manual intervention to circle the area to be graded, resulting in low accuracy and slow speed, and failing to achieve complete automation and efficient grading.

Method used

Using a deep learning-based approach, the test paper image is acquired, preprocessed, and then Hough line detection is used to extract the answer area. The YOLO v3 network is then used to automatically identify and compare the answer area, enabling automatic circling of the answer area and grading.

Benefits of technology

It has achieved intelligent and automated test paper grading, improved grading speed and accuracy, reduced human intervention, is applicable to different question types and answer sheet formats, provides intuitive data display, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114550176B_ABST
    Figure CN114550176B_ABST
Patent Text Reader

Abstract

The application discloses a test paper correction method based on deep learning, which comprises the following steps: obtaining a test paper image P1 with standard answers, collecting a test paper image P2 to be corrected, and performing pretreatment; performing Hough straight line detection on P1 and P2 after pretreatment respectively to obtain the positions of horizontal straight lines for answering, and then obtain the answering areas of single questions; using a YOLO v3 network to extract the coordinate information of each verification frame in the answering area and the data in the verification frame, and then calculate the distance between two adjacent verification frames; comparing each data information in the answering areas corresponding to the same question number in the two test paper images, and counting the number of correct questions and incorrect questions in the test paper to be corrected; according to the coordinate information of the test paper to be corrected, the corresponding student number of the test paper to be corrected is extracted, and the student number and whether all the questions on the corresponding test paper are correct or not are stored in a database. The application can be applied to the selection questions and fill-in-the-blank questions of test papers or answer sheets, and is not limited by the question type and the format of the answer sheet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a deep learning-based test paper grading method, belonging to the field of deep learning technology. Background Technology

[0002] In the early 21st century, Hinton et al. proposed deep learning technology, and since then, deep learning has gradually gained attention. In recent years, with the rapid development of computer vision technology, research on automatic exam grading has sprung up like mushrooms after rain, helping teachers to quickly grade certain types of questions, reducing labor costs and improving teachers' work efficiency.

[0003] Intelligent grading of exam papers effectively utilizes computer vision technology to replace humans in grading some questions, eliminating the traditional grading process of binding, transporting, delivering, and flipping through papers. It also eliminates the need to centrally arrange all graders in specific grading classrooms, improving work efficiency and reducing the risk of loss or damage during multiple transmissions. From a cost-saving perspective, intelligent grading saves significant manpower and resources. All exam information can be stored on a computer hard drive, and all statistical work in the grading process can be done by computer, making exam paper security management more convenient. From the perspective of fairness in grading, intelligent grading improves the quality of grading by replacing manual grading, maximizing the fairness of the grading process.

[0004] In their 2019 paper, "Design and Implementation of an Intelligent Auxiliary Grading System for Exam Papers," Hu Han et al. mentioned using image preprocessing to remove noise during the acquisition of exam paper images, employing image segmentation to slice the exam paper into question types, and using image recognition to recognize handwritten information of students, non-answer sheet multiple-choice questions, and true / false questions. However, this method has limited processing power and can only grade multiple-choice and general short-answer questions. In their 2020 paper, "Design of an Automatic Exam Paper Grading System Based on Machine Vision," Cheng Jianbang et al. proposed using digital image processing to extract answer information from the exam paper and convert the answer characters into normalized binary images. The character feature extraction method finds the most distinguishable features from the normalized binary images to achieve character differentiation and recognition. An input-output model is obtained through machine learning, and this model is used for handwritten character recognition. An interactive answer box selection method is designed, allowing users to draw the recognition area for each question on the exam paper using the mouse. This system can be used on various types of exam papers. However, this system requires manual intervention to grade the papers, making it somewhat dependent on human intervention. In their 2021 paper, "Design and Implementation of an English Grading System Based on Deep Learning," Zhuo Tiantian et al. designed a grading system for the national English exam. This system mainly includes an image processing module, a character recognition module, and a word recognition module. First, edge extraction and perspective transformation are performed on the input image to obtain the main body of the answer sheet. Then, edge extraction is performed again on the main body of the answer sheet to locate the student ID area and the answer filling area. Next, the area for model recognition is cropped according to the question type, and a single-character recognition model or a word recognition model is loaded to perform end-to-end recognition to determine the correctness of the answer. However, this system is limited to multiple-choice questions and is relatively slow.

[0005] Current intelligent test paper grading methods, such as image segmentation and template matching, still require human intervention to delineate the areas to be graded, thus relying on human intervention; moreover, the accuracy is low and the speed is slow. Summary of the Invention

[0006] The technical problem to be solved by this invention is to provide a deep learning-based test paper grading method that extracts the answer lines from the answer sheet or test paper and obtains the coordinates of the lines, further extracts the answer area, and automatically circles the answer area offline for answer recognition and grading, thereby realizing intelligent grading and improving work efficiency.

[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0008] The deep learning-based test grading method includes the following steps:

[0009] Step 1: Obtain the image of the test paper with the standard answers written on it, and denote it as P1. Also, capture the image of the test paper that needs to be graded through the camera, and denote it as P2.

[0010] Step 2: Preprocess the test paper images P1 and P2 respectively. The preprocessing includes perspective transformation, grayscale conversion, binarization, and edge segmentation.

[0011] Step 3: Perform Hough line detection on the preprocessed test paper images P1 and P2 respectively to obtain the position of the horizontal line of the answer in each test paper image and the corresponding question number;

[0012] Step 4: Based on the positions of the two adjacent horizontal lines, obtain the answer area for a single question;

[0013] Step 5: Use the pre-trained YOLO v3 network to extract each data information in each answer area, including the coordinate information of the verification box and the data inside the verification box. The coordinate information of the verification box includes the position of the upper left corner X of the verification box and the width of the verification box.

[0014] Step 6: For the answer area of ​​a single question, calculate the distance between two adjacent verification boxes based on the coordinate information of the verification boxes obtained in Step 5.

[0015] Step 7: Compare each data point in the answer area corresponding to the same question number in the two test paper images, and count the number of correct and incorrect questions in the test paper images that need to be graded.

[0016] Step 8: Extract the student ID corresponding to the exam paper to be graded based on the coordinate information of the exam paper to be graded, and store the student ID and the correctness of all questions on the corresponding exam paper into the database; continue to process the next P2 until all P2s are processed.

[0017] Step 9: The design window displays the number of correct and incorrect questions corresponding to the student ID, and the total number of correct and incorrect questions for all P2 students is presented in a bar chart or line graph.

[0018] In a preferred embodiment of the present invention, in step 1, the acquisition frequency of the camera is set to 2s.

[0019] As a preferred embodiment of the present invention, the specific formula for grayscale conversion in step 2 is as follows:

[0020]

[0021] Where Gray is the grayscale value, R is the value of the red pixel component, G is the value of the green pixel component, and B is the value of the blue pixel component.

[0022] In a preferred embodiment of the present invention, in step 3, the Hough line detection process involves setting the lower left corner pixel of each exam paper image as the origin of the coordinate system. The horizontal direction to the right along the bottom edge of the exam paper image is the positive X-axis, and the vertical direction upwards along the left edge of the exam paper image is the positive Y-axis. The Hough line detection process extracts the straight lines in the exam paper image, representing the answer positions. During this extraction, several pairs of coordinates are obtained, each pair including the left endpoint (x, y) of the straight line. i1 ,y i1 ) and right endpoint (x) i2 ,y i2 (i = 1, 2, 3...n, where n is the total number of questions. Lines are sorted from highest to lowest based on their Y-coordinate on the Y-axis. The line with the largest Y-coordinate is i = 1, corresponding to the first question. The formula for the Hough line detection parameters is:)

[0023] r y = x*cosθ+y*sinθ

[0024] Where, r y Let θ be the ordinate distance from the origin to a given pixel (x, y), and r be the distance between the origin and the pixel (x, y). y The angle between r and the positive X-axis is such that θ is 90 degrees and x is 0, for all r... y When all pixels (x, y) that meet the conditions are detected, the straight line formed by the line is the desired horizontal line.

[0025] In a preferred embodiment of the present invention, in step 4, the distance between two adjacent horizontal lines is calculated based on the coordinates of the left and right endpoints of the horizontal line obtained in step 3.

[0026] H j =y (i-1)1 -y i1

[0027] Among them, H j Let H1 be the distance on the Y-axis between the horizontal line of question i and the horizontal line of question i-1, where j = i, and when j = i = 1, H1 = H2.

[0028] Therefore, the coordinates of the four vertices of the answer area for question i are calculated as follows: lower left endpoint (x... i1 ,y i1 ), lower right endpoint (x) i2 ,y i2 ), top left endpoint (x) i1 ,y i1 +H j ) and the upper right endpoint (x) i2 ,y i2 +H jThen extract the ROI of the answer area for each question.

[0029] As a preferred embodiment of the present invention, in step 5, the YOLO v3 network is pre-trained using the ORACLE character dataset and the MNIST digit dataset to obtain a trained YOLO v3 network.

[0030] In a preferred embodiment of the present invention, in step 6, the distance between two adjacent verification boxes in the answer area of ​​a single question is as follows:

[0031] S k =b x(k+1) -b w -b xk

[0032] Among them, S k b is the distance between the (k+1)th and kth validation boxes. x(k+1) b xk The positions of the top-left corner X of the (k+1)th and kth verification boxes are respectively, b w Let be the width of the k-th validation box, where k = 2, 3, ...

[0033] In a preferred embodiment of the present invention, in step 7, regular expressions are used to compare each data point in the answer area corresponding to the same question number in the two test paper images. For the same question number, the first data point in the answer area corresponding to P1 is extracted and compared with the first data point in the answer area corresponding to P2. Specifically, there are three cases:

[0034] First case: If the two are inconsistent, record F once and skip to the next question;

[0035] The second scenario: If the two are the same, compare the second data and determine whether the distance between the second data and the first data is less than or equal to 10. If it is greater than 10, record F once and skip to the next question.

[0036] The third case: If the two are consistent, and the distance between the second data and the first data is less than or equal to 10, then compare the third data information, and so on. When all the data in the answer area corresponding to P1 are consistent with all the data in the answer area corresponding to P2, and the distance between any two adjacent data is less than or equal to 10, then record it as T.

[0037] For all other questions, perform the above comparison operation and count the number of T and F.

[0038] As a preferred embodiment of the present invention, in step 8, the number of digits constituting the student ID is set to m, and a Y-axis threshold is set. For the test paper image that needs to be graded, the area with a Y value greater than the threshold is scanned, and the distance between two adjacent digits is calculated. If there are m-1 consecutive distances that are all less than 10, it is determined to be a student ID and extracted. The student ID and the corresponding question T or F information on the test paper are stored in the database.

[0039] As a preferred embodiment of the present invention, in step 9, the TKinter design window displays all the question T or F information corresponding to the student number, and the number of T and F on the test paper image to be graded is converted into bar charts and line charts using MySQL.

[0040] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:

[0041] 1. This invention utilizes Hough line detection and ROI extraction to obtain the answer area for a single question, thereby eliminating human intervention in grading exam papers and achieving intelligent grading.

[0042] 2. This invention uses YOLO v3 to train the dataset, obtains the required information, and finally compares it one by one with the standard answers to determine whether they are correct or incorrect. Compared with other techniques, this technique has a faster training speed and higher accuracy.

[0043] 3. This invention uses a host computer and visualized bar charts and line graphs to present data information, which is more intuitive and helps save teachers' time and energy, and reduce their burden.

[0044] 4. The method of the present invention improves work efficiency and solves the problems of slow speed, dependence, and difficulty in implementation in the prior art.

[0045] 5. This invention uses line detection in the answer area and can be applied to multiple-choice and fill-in-the-blank questions on test papers or answer sheets, without being limited by question type or answer sheet format. Attached Figure Description

[0046] Figure 1 This is a flowchart of the deep learning-based test paper grading method of this invention;

[0047] Figure 2 These are the original image and the perspective transformation effect used in this invention;

[0048] Figure 3 This is a diagram of the ROI extracted by this invention;

[0049] Figure 4 This is a diagram of the host computer interface of the present invention;

[0050] Figure 5This is a bar chart showing the results of this invention;

[0051] Figure 6 This is a graph showing the results of the present invention. Detailed Implementation

[0052] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0053] Most existing intelligent test paper grading methods use techniques such as image segmentation and manually locating the answer regions of individual questions. This invention extracts the answer lines from the answer sheet or test paper during image preprocessing, obtains the coordinates of the lines, further extracts the Regions of Interest (ROIs) for each question, and trains the dataset using YOLO v3 to obtain the required numerical information. Finally, it compares the numerical information to determine the correctness of each person's answers and displays the results through a host computer, bar charts, and line graphs. Figure 1 This is a flowchart of the invention, combined with... Figure 1 The main steps of this invention are as follows:

[0054] Step 1: Use a manually input image of the test paper with the standard answers written on it, and denote it as P1. Also, use a camera to capture an image of the test paper that needs to be graded, and denote it as P2.

[0055] The image processing uses OpenCV and Python. The camera capture frequency is t. Due to the placement of the test papers to be graded and the shooting speed, the capture frequency t is set to about 2 seconds.

[0056] Step 2: Preprocess P1 and P2, including perspective transformation, grayscale conversion, binarization, and edge segmentation; such as... Figure 2 The diagram shows the original image and the perspective transformation effect of this invention. The left side is the original image, and the right side is the perspective transformation image. First, the image position is corrected by using perspective transformation to reposition the coordinates of the four vertices. Then, grayscale conversion is performed to remove interference information from the color image. Next, image binarization is performed to distinguish the text from the background in the grayscale image. Finally, edge detection and edge segmentation are performed on the binarized image to obtain an image with the border removed. The main steps are as follows:

[0057] a. Perspective transformation of an image

[0058] To correct the unavoidable tilting of the target in the image during scanning or acquisition, this invention employs transparency transformation. Perspective transformation, also known as projection mapping or projection transformation, is a nonlinear transformation in three-dimensional space. It can be seen as a more general form of affine transformation. Simply put, it projects the original image onto a new viewing plane through a 3x3 transformation matrix, which visually manifests as the creation or elimination of the sense of distance.

[0059] b. Image grayscale conversion and binarization

[0060] To remove interfering information from color images, this invention employs grayscale conversion. In the RGB model, if R = G = B, then color represents a grayscale color, where the value of R = G = B is called the grayscale value. To distinguish text from the background in grayscale processed images, this invention uses binarization. The specific formula for grayscale conversion is as follows:

[0061]

[0062] Where R is the value of the red pixel component, G is the value of the green pixel component, and B is the value of the blue pixel component.

[0063] c. Image edge segmentation

[0064] To reduce the error in Hough line detection, this invention employs an edge detection-based image segmentation method. This method segments out areas where the image grayscale changes significantly within the overall image. Various edge operators are frequently used in image edge detection. Edge operators can enhance the edge effect of the image, increasing the pixel grayscale difference between the target region and the edge. The target image is then segmented based on the image boundaries.

[0065] Step 3: Perform Hough line detection on the two preprocessed images to determine the horizontal line position of the answer and obtain the answer question number;

[0066] The origin of the coordinate system is set at the bottom left corner of P1 and P2. The positive X-axis runs horizontally to the right from the bottom, and the positive Y-axis runs vertically upwards from the left. The resolution of the exam image is 1980*1080, meaning the maximum Y-axis resolution is 1980 and the maximum X-axis resolution is 1280. Hough line detection is used to extract the straight line from the exam image, which represents the answer location. During line extraction, two pairs of coordinates are obtained: the left endpoint (x, y) of the line and the right endpoint (x, y). i1 ,y i1 ) and right endpoint (x) i2 ,y i2The formula for Hough line detection is: (where i = 1, 2, 3...n, and i represents the number of answers). Lines are sorted from highest to lowest based on their Y-coordinate. When the Y-coordinate is the largest, i = 1, indicating that this line corresponds to the first question. This method determines the number of answers and avoids errors caused by repeatedly identifying the same number. The formula for the parameters of Hough line detection is:

[0067] r y = x*cosθ+y*sinθ

[0068] Where, r y Let θ be the ordinate distance between the origin and a pixel (x, y) on a given edge, where θ is the distance between the origin and the pixel (x, y). y The angle between r and the positive x-axis is such that θ is 90 degrees and x is 0 for all r. y When consistent, the detected (x,y) line of the pixel point passing through the edge is the desired horizontal line.

[0069] Step 4: Based on the positions of two adjacent horizontal lines, obtain the answer region (ROI) for each question;

[0070] Based on the coordinates of the left and right endpoints of the line obtained in step three, calculate the distance H between the upper and lower lines. j :

[0071] H j =y (i-1)1 -y i1

[0072] Where i = 1, 2, 3...n, the value of i is the question number, and the lines are sorted from highest to lowest according to their y-coordinates on the y-axis. H j Let H1 be the distance on the y-axis between the line in question i and the line in question i-1, where j = i. When j = i = 1, H1 equals H2.

[0073] From this, we can calculate the coordinates of the lower left endpoint (x) of the four vertices of the required answer area for a single question. i1 ,y i1 ), lower right endpoint (x) i2 ,y i2 ), top left endpoint (x) i1 ,y i1 +H j ) and the upper right endpoint (x) i2 ,y i2 +H j Then, extract the answer region (ROI) for each question, and assign the answer region number i. For example... Figure 3 The image shown is the extracted ROI, with the gray border representing the answer area for a single question.

[0074] Step 5: Train the dataset using YOLO v3 to obtain information about each data point (including numbers, letters, etc.) in the answer region of a single question. This ultimately yields the coordinates of the validation box containing the data and the data within the validation box. The coordinates of the validation box include the x-coordinate of the top-left corner (b). xk and the width b of the validation box w k = 1, 2, 3...n, where k is the index of each validation box in the same ROI region. It is determined by the size of the top-left corner x of each validation box, specifically from small to large. The value of k increases as x increases.

[0075] A. Three feature layers are extracted for object detection. These feature layers are located at different positions in the main feature extraction network Darknet53: the middle layer, the lower-middle layer, and the bottom layer. The sizes of the three feature layers are (52, 52, 256), (26, 26, 512), and (13, 13, 1024), respectively. These three feature layers are used to stack and concatenate with other upsampled feature layers. Darknet53 mainly uses a residual network. Each convolutional part uses a unique arknetConv2D structure. L2 regularization is performed during each convolution, and BatchNormalization and LeakyReLU activation are applied after convolution.

[0076] B. Perform five convolutions on the feature extraction of the (13,13,1024) feature layer. After processing, part of the result is used for convolutional upsampling to obtain the (26,26,256) feature layer, and the other part is used to output the corresponding prediction result (13,13,75). Use two convolutions, Conv2D 3*3 and Conv2D 1*1, to adjust the channels so that the output size meets the requirements.

[0077] C. Take the feature layer (26,26,256) obtained in B and concatenate it with the feature layer (26,26,512) in the Darknet53 network to obtain a feature layer with dimension (26,26,768). Then perform 5 convolutions. After processing, part of it is used for convolution upsampling, and the other part is used to output the corresponding prediction result (26,26,75). Conv2D 3×3 and Conv2D 1×1 are channel adjustments as above.

[0078] D. Concatenate the convolutional and upsampling feature layer from C with the (52, 52, 256) feature layer, then perform convolution to obtain a (52, 52, 128) feature layer. Finally, perform two Conv2D 3×3 and Conv2D 1×1 convolutions to obtain a (52, 52, 75) feature layer. If the prediction result does not correspond to the final predicted bounding box, a loss function needs to be used for decoding. The sum-square error loss method is used, and the calculation formula is:

[0079]

[0080] Where loss represents the loss degree, ∑ represents the accumulation, and S 2 B is the number of grid cells, σ is the probability between [0,1] of the sigmoid activation function, represents the probability of recognizing a digit, represents the probability of recognizing a digit, C represents the confidence level of the digit, and t is the probability of recognizing a digit. x t represents the displacement relative to x. y t represents the displacement relative to y. w t represents width displacement. h This indicates vertical displacement, and the ^ symbol represents the mean value.

[0081] E. The decoding process is essentially the calculation of the verification box position. Using a 13*13, 26*26, or 52*52 grid, each responsible region is detected, and the x, y coordinates, width (weight), and height (height) of the displayed verification box are calculated. Finally, the verification box position is found.

[0082] b xk =σ(p x )+c x

[0083] b y =σ(p y )+c y

[0084]

[0085]

[0086] Pr(object)*IOU(b,Object)=σ(t o )

[0087]

[0088] Among them, c x c represents the offset of the top-left corner of the grid cell containing the character relative to the x-axis. yp represents the offset of the top-left corner of the network containing the character relative to the y-axis. w p represents the width of the validation box during prediction. h p represents the height of the validation box during prediction. x p represents the offset of the grid center point relative to the top-left corner (x) of the grid cell containing that point. y b represents the y-offset of the grid center point relative to the top-left corner of the grid where that point is located. y To verify the position of the top-left corner y of the box, b w To validate the width of the box, b h Let represent the height of the validation bounding box, IOU(b,Object) be the intersection-union ratio, representing the ratio of the intersection and union of the validation bounding box and the ground truth bounding box, A and B be the selected validation bounding boxes, represent the expected value of the digit, and σ be the activation function, which is the calculated prediction function. The position b of the top-left corner of the validation bounding box is denoted by x. xk k = 1, 2, 3..., where k is the serial number of each verification box in the answer area of ​​the same single question. It is determined by the size of the upper left corner x of each verification box, specifically from small to large. The value of k increases as x increases.

[0089] Step Six: Compare the coordinate information of each data point in the answer area of ​​a single question to obtain the distance information between the data points;

[0090] Since the distance between a string of numbers is less than 10, we need to calculate the distance S between two consecutive characters based on the position x of the top-left corner of the verification box obtained in step five and the width of the verification box. k :

[0091] S k =b x(k+1) -b w -b xk

[0092] Where b xk To verify the position of the top-left corner x of the box, b w To validate the width of the box, k = 2, 3...

[0093] Step 7: Compare the data information in the answer area of ​​each question in the two images, and count the number of correct and incorrect questions;

[0094] Based on the data in the same single-question answer area of ​​P1 and P2 obtained in step five, these data are compared one by one. The algorithm used is regular expression. First, the first data in the same single-question answer area of ​​P1 is extracted and compared with the data in the same single-question answer area of ​​P2. Specifically, there are three possibilities:

[0095] 1. If no matching number is found, record an F and do not continue comparing.

[0096] 2. If the same number appears, compare the second number. The distance S1 between the first and second numbers must be less than 10. If it is greater than 10, record it as F and do not continue comparing.

[0097] 3. If S1 is not greater than 10, then compare the third character, and so on, until all data are the same and S... k If they are the same, then denote it as T.

[0098] After completing the above operations, compare the data information in the answer areas of individual questions for other groups.

[0099] Step 8: Based on the coordinate information of the test paper, obtain the student ID and count the number of correct and incorrect answers. Then start processing the next P2 sheet, following the same steps as steps 2 to 8, until all P2 sheets are processed.

[0100] Scan the region where the y-axis value of P2 is above 1780. If five or more consecutive numbers appear, the distance to S is... k If the number is less than 10, it is determined to be a student ID, which is then extracted. The number of F and T from step seven is calculated, and all question numbers T and F information corresponding to all student IDs are written into the database. The answers corresponding to each question in P1 are then stored in the database. After that, the processing of the next P2 begins, following the same steps as steps two through eight, until all P2 processes are completed.

[0101] Step 9: Design a window to display the number of F and T corresponding to the student ID, and show the number of T and F for all P2 students through a bar chart or line graph.

[0102] A window was designed using TKinter to display the information of all question numbers F and T corresponding to the student ID, such as... Figure 4 The host computer interface shows the results of the exam papers to be graded. There are a total of 10 exam papers to be graded, and each paper contains 10 questions. Clicking the "Input" button allows you to select an exam paper with standard answers from the computer folder. After clicking the "Start" button, the camera captures the image of the exam paper to be graded and automatically grades it. Finally, it displays all the T and F data information corresponding to each student ID.

[0103] After clicking the "Pie Chart" and "Line Chart" buttons respectively, the number of True and False scores for all the papers to be graded will be converted into bar charts and line charts by MySQL.

[0104] like Figure 5 The results are shown in the pie chart, which displays the ratio of the number of T questions to the total number of questions, in order to show the score of each question.

[0105] like Figure 6The result graph shows the number of questions marked as T on the horizontal axis and the number of students on the vertical axis, displaying the distribution of scores across different score ranges. The purpose is to allow teachers to more intuitively observe whether the scores conform to a normal distribution.

[0106] The above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.

Claims

1. A deep learning-based test paper grading method, characterized in that, Includes the following steps: Step 1: Obtain the image of the test paper with the standard answers written on it, and denote it as P1. Also, capture the image of the test paper that needs to be graded through the camera, and denote it as P2. Step 2: Preprocess the test paper images P1 and P2 respectively. The preprocessing includes perspective transformation, grayscale conversion, binarization, and edge segmentation. Step 3: Perform Hough line detection on the preprocessed test paper images P1 and P2 respectively to obtain the position of the horizontal line of the answer in each test paper image and the corresponding question number; In the Hough line detection, for each exam paper image, its lower left corner pixel is set as the origin of the coordinate system. The horizontal direction to the right along the bottom edge of the exam paper image is the positive X-axis, and the vertical direction upwards along the left edge of the exam paper image is the positive Y-axis. The Hough line detection extracts the straight lines in the exam paper image, i.e., the answer positions. During the line extraction process, several pairs of coordinates are obtained, each pair including the left endpoint (x, y) of the line. i1 ,y i1 ) and right endpoint (x) i2 ,y i2 ), i = 1, 2, 3... n, where n is the total number of questions. Sort the lines from highest to lowest according to their Y-coordinate values. When the Y-coordinate is the largest, i = 1, which means that the line corresponds to the first question. Step 4: Based on the positions of the two adjacent horizontal lines, determine the answer area for each question; specifically: Based on the coordinates of the left and right endpoints of the horizontal line obtained in step 3, calculate the distance between two adjacent horizontal lines: H j =y (i-1)1 -y i1 Among them, H j Let H1 be the distance on the Y-axis between the horizontal line of question i and the horizontal line of question i-1, where j = i, and when j = i = 1, H1 = H2. Therefore, the coordinates of the four vertices of the answer area for question i are calculated as follows: lower left endpoint (x... i1 ,y i1 ), lower right endpoint (x) i2 ,y i2 ), top left endpoint (x) i1 ,y i1 +H j ) and the upper right endpoint (x) i2 ,y i2 +H j Then extract the ROI of the answer area for each question; Step 5: Use the pre-trained YOLO v3 network to extract each data information in each answer area, including the coordinate information of the verification box and the data inside the verification box. The coordinate information of the verification box includes the position of the upper left corner X of the verification box and the width of the verification box. Step 6: For the answer area of ​​a single question, calculate the distance between two adjacent verification boxes based on the coordinate information of the verification boxes obtained in Step 5. Step 7: Compare each data point in the answer area corresponding to the same question number in both test paper images, and count the number of correct and incorrect questions in the test paper images that need to be graded; specifically: Regular expressions are used to compare the coordinate information of each data point in the answer area corresponding to the same question number in two test paper images. For the same question number, the first data point in the corresponding answer area of ​​P1 is extracted and compared with the first data point in the corresponding answer area of ​​P2. Specifically, three cases are considered: First case: If the two are inconsistent, record F once and skip to the next question; The second scenario: If the two are the same, compare the coordinates of the second data and determine whether the distance between the second data and the first data is less than or equal to 10. If it is greater than 10, record F once and jump to the next question. The third case: If the two are the same, and the distance between the second data and the first data is less than or equal to 10, then compare the third data, and so on. When all the data in the answer area corresponding to P1 are the same as all the data in the answer area corresponding to P2, and the distance between any two adjacent data is less than or equal to 10, then record it as T. For all other questions, perform the comparison operation described above and count the number of T and F. Step 8: Extract the student ID corresponding to the exam paper to be graded based on the coordinate information of the exam paper to be graded, and store the student ID and the correctness of all questions on the corresponding exam paper into the database; continue to process the next P2 until all P2s are processed. Step 9: The design window displays the number of correct and incorrect questions corresponding to the student ID, and the total number of correct and incorrect questions for all P2 students is presented in a bar chart or line graph.

2. The deep learning-based test paper grading method according to claim 1, characterized in that, In step 1, the camera's acquisition frequency is set to 2 seconds.

3. The deep learning-based test paper grading method according to claim 1, characterized in that, In step 2, the specific formula for grayscale conversion is: Where Gray is the grayscale value, R is the value of the red pixel component, G is the value of the green pixel component, and B is the value of the blue pixel component.

4. The deep learning-based test paper grading method according to claim 1, characterized in that, The parameter formula for the Hough line detection described in step 3 is as follows: r y =x* cosθ+y* sinθ Where, r y Let θ be the ordinate distance from the origin to a given pixel (x, y), and r be the distance between the origin and the pixel (x, y). y The angle between r and the positive X-axis is such that θ is 90 degrees and x is 0, for all r... y When all pixels (x, y) that meet the conditions are detected, the straight line formed by the line is the desired horizontal line.

5. The deep learning-based test paper grading method according to claim 1, characterized in that, In step 5, the YOLO v3 network is pre-trained using the ORACLE character dataset and the MNIST digit dataset to obtain a trained YOLO v3 network.

6. The deep learning-based test paper grading method according to claim 1, characterized in that, In step 6, the distance between two adjacent verification boxes in the answer area of ​​a single question is as follows: S k =b x(k+1) -b w -b xk Among them, S k b is the distance between the (k+1)th and kth validation boxes. x(k+1) b xk The positions of the top-left corner X of the (k+1)th and kth verification boxes are respectively, b w Let be the width of the k-th validation box, where k = 2, 3, ...

7. The deep learning-based test paper grading method according to claim 1, characterized in that, In step 8, the number of digits that make up the student ID is set to m, and a Y-axis threshold is set. For the test paper image that needs to be graded, the area with a Y value greater than the threshold is scanned, and the distance between two adjacent digits is calculated. If there are m-1 consecutive distances that are all less than 10, it is determined to be a student ID and extracted. The student ID and the corresponding T or F information of all questions on the test paper are stored in the database.

8. The deep learning-based test paper grading method according to claim 7, characterized in that, In step 9, the TKinter design window displays all the question T or F information corresponding to the student ID, and MySQL is used to convert the number of T and F on the test paper image that needs to be graded into bar charts and line charts.

Citation Information

Patent Citations

  • A method for cutting answer regions of the same batch of test papers based on a combination

    CN109409374A

  • Test paper correction method and device, electronic device and storage medium

    CN109815932A