Test question correction method and device, electronic equipment and storage medium
By using custom annotation rules and predictive model training, the problem of low image recognition accuracy caused by tampering marks was solved, achieving efficient handwritten answer recognition in tampering mark scenarios and improving recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING CENTURY TAL EDUCATION TECH CO LTD
- Filing Date
- 2022-09-08
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies have low accuracy in recognizing handwritten answers in image recognition scenarios with alterations, cannot effectively handle the problem of inconsistent text length caused by alterations, and are easily interfered with by alterations.
The sample images are labeled using customized and standardized annotation rules, a prediction model is trained, and convolutional neural networks and recurrent neural networks are used to recognize handwritten answers in the images, output predicted characters, determine target characters according to preset rules, and finally compare them with the standard answers to complete the grading.
It can efficiently and accurately identify handwritten answers in images with alteration marks, reduce the interference of alteration marks on the model, and improve the accuracy of recognition.
Smart Images

Figure CN115761780B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image recognition technology, and in particular to a test paper grading method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the continuous development of image recognition technology and educational informatization, using image recognition technology to identify handwritten answers on exam papers and automatically grade them has become a key application area. Currently, image classification methods, text classification methods, or attention mechanisms are commonly used. However, image classification methods are suitable for single, unaltered characters and cannot effectively address the problem of alterations in the image, which can lead to text of varying lengths. Text classification methods identify exam paper content by detecting text content, which can solve the problem of varying text lengths to some extent, but the recognition accuracy is relatively low and cannot guarantee the accuracy of the identified content. Attention mechanisms only focus on the features to be recognized and cannot eliminate interference from parts of the image with minor alterations. Therefore, in recognition scenarios with alterations, existing technologies are easily affected by these alterations, resulting in relatively low recognition accuracy. Summary of the Invention
[0003] To address the aforementioned technical issues, this disclosure provides a test paper grading method, apparatus, electronic device, and storage medium that can be applied in recognition scenarios with traces of alteration, and can efficiently and accurately recognize handwritten answers in images.
[0004] According to one aspect of this disclosure, a method for grading test questions is provided, including:
[0005] Obtain the image to be graded, wherein the image to be graded includes the handwritten answers to the target test questions;
[0006] The handwritten answer is predicted using a pre-trained prediction model, and the predicted character is output.
[0007] The target character is determined from the predicted characters according to preset rules;
[0008] The target character is compared with the standard answer to the target question to complete the grading of the target question.
[0009] According to another aspect of this disclosure, a test paper grading device is provided, comprising:
[0010] The acquisition module is used to acquire the image to be graded, wherein the image to be graded includes the handwritten answers to the target test questions;
[0011] The prediction module is used to predict the handwritten answer using a pre-trained prediction model and output the predicted character.
[0012] The determination module is used to determine the target character from the predicted characters according to preset rules;
[0013] The grading module is used to compare the target character with the standard answer of the target question to complete the grading of the target question.
[0014] According to another aspect of this disclosure, an electronic device is provided, the electronic device comprising: a processor; and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform a method for grading test questions.
[0015] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to execute a test grading method.
[0016] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described test grading method.
[0017] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0018] The test paper grading method disclosed herein involves acquiring an image to be graded, wherein the image includes a handwritten answer to a target test paper; predicting the handwritten answer using a pre-trained prediction model and outputting predicted characters; determining a target character from the predicted characters according to preset rules; and comparing the target character with the standard answer to the target test paper to complete the grading of the target test paper. This disclosure can be applied to recognition scenarios with traces of alteration and can efficiently and accurately identify handwritten answers in images. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0020] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A schematic diagram illustrating an application scenario provided by an embodiment of this disclosure;
[0022] Figure 2 A flowchart of the prediction model training method provided in the embodiments of this disclosure;
[0023] Figure 3 A schematic diagram of a sample image set provided for embodiments of this disclosure;
[0024] Figure 4 A schematic diagram of the structure of the prediction model provided in the embodiments of this disclosure;
[0025] Figure 5 A flowchart of the test item grading method provided in this embodiment of the disclosure;
[0026] Figure 6 A schematic diagram of the image to be corrected provided in an embodiment of this disclosure;
[0027] Figure 7 This is a schematic diagram of the test paper grading device provided in an embodiment of the present disclosure;
[0028] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0029] To better understand the above-described objects, features, and advantages of this disclosure, embodiments of the disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of the disclosure are shown in the drawings, it should be understood that the disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0031] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0033] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0034] Before providing a detailed explanation of the test paper grading method provided in this disclosure, the relevant terms will be explained first, wherein:
[0035] Convolutional Neural Networks (CNNs) are a type of feedforward neural network that includes convolutional computations and has a deep structure.
[0036] Convolutional Recurrent Neural Network (CRNN): Primarily used for end-to-end recognition of text sequences of variable length.
[0037] K-Nearest Neighbor (KNN) algorithm: used for data mining classification.
[0038] Support Vector Machine (SVM): A type of generalized linear classifier that uses supervised learning to perform binary classification of data.
[0039] Back propagation (BP) neural networks are networks trained using an error backpropagation algorithm and are one of the most important algorithms in deep learning neural networks.
[0040] Anchor: A regression-based bounding box method used for object detection.
[0041] Text detection algorithm (Connectionist Text Proposal Network, CTPN): used for text recognition in complex scenes.
[0042] Text detection algorithm (Segment Link, SegLink): capable of detecting text of any length and orientation.
[0043] CTC (Connectionist Temporal Classification): A loss function.
[0044] Residual Net (ResNet): An algorithm for object detection.
[0045] Lightweight Convolutional Neural Network (MobileNet): A lightweight convolutional network model for image feature extraction.
[0046] Transfer learning (Visual Geometry Group, VGG) is a convolutional network model for image feature extraction.
[0047] Recurrent Neural Network (RNN): A type of recursive neural network that takes sequence data as input, recurses in the direction of sequence evolution, and connects all nodes (recurrent units) in a chain-like manner.
[0048] Long Short-Term Memory (LSTM) network is a type of time-recurrent neural network.
[0049] Sequence to Sequence (Sequence2Sequence): A natural language processing model based on RNN / LSTM.
[0050] HSV (Hue, Saturation, Value): A color model.
[0051] RGB (Red, Green, Blue): A color model.
[0052] Currently, for applications involving automatic test grading, traditional image classification methods (KNN, SVM, BP, CNN, etc.) can only handle single, unaltered characters, such as A, B, C, and D. They cannot address situations where alterations result in text of varying lengths, or where multiple-choice questions contain diverse character combinations. While methods using text detection models with anchor regression bounding boxes, employing CTPN, SegLink, etc., to detect text, and then classifying it using CTC and Sequence2Sequence algorithms, can to some extent solve the problem of text classification with varying lengths caused by alterations, these methods suffer from certain recall limitations. The text recognition accuracy is relatively low due to the loss. Although attention mechanisms such as channelAttention and spatialAttention can filter out some interference noise features irrelevant to recognition during the image feature extraction stage, these methods only focus on the features that need to be recognized. When the tampering marks in the image are light, it is difficult to eliminate the interference of the tampered characters on the recognition content. In addition, in recognition scenarios with tampering marks, there are non-standard labeling rules. For example, letters such as A, B, C, and D are all marked as the same special symbol after being tampered with. If the tampered characters and the original characters have similar features, it is easy to interfere with the model, resulting in a decrease in the model's recognition accuracy, thus failing to meet the usage standards.
[0053] To address the aforementioned technical problems, this disclosure provides a test paper grading method. It specifies standardized annotation rules for handwritten multiple-choice questions (single and multiple selection) with alterations. A prediction model is trained using sample images and annotation results obtained based on the standardized annotation rules to identify handwritten answers in the images to be graded. Based on preset sub-rules generated from the standardized annotation rules, target characters are determined from the predicted characters. These target characters are the unaltered answers within the handwritten answers with alterations, representing the student's final written answer. Finally, the target characters are compared with the standard answers to complete the automatic grading of the test paper. The method provided by this disclosure specifies standardized annotation rules, enabling the identification of the final written answer in images with alterations. The model is less susceptible to interference and can accurately identify altered characters, preset characters, and unaltered characters with high accuracy. Detailed descriptions are provided through one or more of the following embodiments.
[0054] Specifically, the test grading method can be executed by a terminal or a server. Specifically, the terminal or server can predict the written answers in the image to be graded using a prediction model. The entity executing the prediction model training method and the entity executing the test grading method can be the same or different.
[0055] For example, in one application scenario, such as Figure 1 As shown, server 12 trains the prediction model. Terminal 11 obtains the trained prediction model from server 12 and uses this model to predict the written answer in the image to be graded. The image to be graded can be a photograph taken by terminal 11. Alternatively, the image to be graded can be obtained by terminal 11 from another device. Or, the image to be graded can be an image obtained by terminal 11 after image processing of a preset image, which can be a photograph taken by terminal 11 or obtained by terminal 11 from another device. Here, no specific limitation is made to the other devices.
[0056] In another application scenario, server 12 trains a prediction model. Further, server 12 uses the trained prediction model to predict the written answers in the image to be graded. The way server 12 obtains the image to be graded can be similar to the way terminal 11 obtains the image to be graded as described above, and will not be repeated here.
[0057] In another application scenario, terminal 11 trains a prediction model. Further, terminal 11 uses the trained prediction model to predict the written answers in the image to be graded.
[0058] It is understood that the prediction model training method and test item grading method provided in this disclosure are not limited to the possible scenarios described above. Since the trained prediction model can be applied to the test item grading method, the prediction model training method can be introduced below before introducing the test item grading method.
[0059] The following example, using server 12 to train a prediction model, illustrates a prediction model training method, specifically the training process. It should be understood that this method is also applicable to the scenario where terminal 11 trains a prediction model.
[0060] Figure 2 A flowchart of the prediction model training method provided in this embodiment of the disclosure, applied to server 12, specifically includes as follows: Figure 2 The following steps S210 to S230 are shown:
[0061] S210. Acquire multiple sample images and annotate the unaltered handwritten characters in each of the multiple sample images.
[0062] Understandably, a large number of sample images used as training data are labeled using customized, standardized labeling rules. These sample images include both those with and without alterations. For example, images containing handwritten answers to multiple-choice questions are used as illustrations. The handwritten answers in the sample images can be for single-choice or multiple-choice questions. Specifically, sample images containing only the answer area of a question can be directly obtained. The answer area includes all handwritten answers from the user for a single question. Then, these sample images can be directly labeled according to standardized labeling rules. Alternatively, during the test paper assembly process, the coordinates of the answer area in each test paper sample are associated with the question information and stored in a database. The test paper samples are scanned using a high-resolution scanner, and the scanned results are stored as images in the database. Based on the question information and the coordinates of the answer area, the answer area is cropped, and the question information and the cropped single image are associated and stored in the database. The cropped single image is the sample image containing only the answer area. After obtaining a sample image of the answer area, the unaltered handwritten characters in the sample image are marked, and the unaltered handwritten characters are the final answer.
[0063] S220. Among the plurality of sample images, a target sample image with tampering marks is determined, and a first preset character is added before the untampered handwritten character in the target sample image, a second preset character is added at the position adjacent to the first preset character, an identifiable tampered character in the target sample image is added at the position adjacent to the second preset character, and a third preset character is added at the position adjacent to the identifiable tampered character, so as to obtain the annotation result of the target sample image.
[0064] Understandably, based on the above S210, target sample images with alteration marks are identified from the acquired sample images. In step S210, sample images without alteration marks have already been labeled. For sample images with alteration marks, after labeling the final answer, the alteration marks also need to be labeled. Specifically, the standardized labeling rules for images with alteration marks are as follows: Rule 1: Label the first preset character before the labeled unaltered handwritten characters. The first preset character is "&". The first preset character indicates that the sample image has alteration marks. That is, the first preset character is used to mark the altered content. The second preset character is labeled in the adjacent position after the first preset character. The first preset character is "{". The second preset character is "{". Adjacent to the second preset character, the identifiable altered character in the target sample image is marked. The third preset character is "}". This means that regardless of the alteration marks, if the altered character is still recognizable, it is marked with "&{}". "&" indicates alteration, and the curly braces {} contain the altered character. This marking method preserves the features of still identifiable altered characters, further improving recognition accuracy and reducing the impact of similar features but large label differences between altered and unaltered characters on the model. The interference is categorized into three types: 1. **Correction Marks:** Marks can be horizontal lines, crosses, or curves; specific markings are not limited. 2. **Rule 2:** Regardless of the marking, if the marked character is unrecognizable or not a single character, it is directly labeled with the first preset character '&'. In this case, the marked character has few or no features of the original character, thus avoiding the problem of highly similar features between unmarked and marked characters. Therefore, the marked character can be treated as a completely new special character, reducing the difference between sample labels. 3. **Rule 3:** If multiple marked characters exist in the sample image, each marked character needs to be individually labeled using either Rule 1 or Rule 2 above. A single first label cannot be used. Rule 4: For direct modifications to existing characters, without erasure, directly mark the modified character; that is, do not mark the first preset character indicating the existence of modification marks. Rule 5: If an erasure mark covers multiple characters, a first preset character can be used for marking. Rule 6: Characters written in bold are considered as unerased characters. Rule 7: Spaces do not need to be marked. Rule 8: Invalid data does not need to be marked. Invalid data refers to small points of erasure marks, such as the marks of pen nib pauses. Rule 9: For characters that are not fully written but have obvious character characteristics, mark them as that character. Rule 10: If the erasure mark is misaligned, ignore the misaligned erasure mark.Understandably, when labeling sample images according to the above standardized labeling rules, multiple labels can be made based on the same sample image, and a voting mechanism is used to determine the final labeling result among multiple labels.
[0065] For example, see Figure 3 , Figure 3 This is a schematic diagram of a sample image set provided in an embodiment of this disclosure. Figure 3 The sample image set 300 includes multiple sample images. Sample image 310 represents a case where the altered characters are still recognizable. According to rule 1 above, sample image 310 is labeled &{D}A, where & indicates that sample image 310 has been altered, {D} represents a recognizable altered character, and A represents an unaltered character (the final answer). &{D}A is the final labeling result for sample image 310. In sample image 320, the altered characters are not recognizable. According to rule 2 above, it is labeled &A, where & represents alteration. Trace; the altered character in sample image 330 is unrecognizable. According to rule 2 above, it is labeled as V&. It is understood that when labeling according to the standardized labeling rules, the characters are labeled in the order from left to right in the image. The specific labeling order is not limited. As shown in the labeling result of sample image 330, the first preset character & is located adjacent to the unaltered character V. The specific preset character and the labeling order of the unaltered character can be determined by the user according to their needs and are not limited here. Sample image 340 contains... Multiple altered characters are labeled as &{A}&{B}C according to rule 3 above, where &{A} represents the altered character A and &{B} represents the altered character B; Sample image 350 is a direct modification based on the original characters without any alteration, so the altered characters are directly labeled, and the labeling result is B; In sample image 360, one alteration mark covers multiple unrecognizable characters, and according to rule 5 above, a first preset character is used for labeling, and the labeling result is &X; Sample image 370 is based on the original characters... The writing on the basis is emphasized, not considered as an alteration, and according to rule 6 above, it is labeled as T; Sample image 380 has traces of alteration and also includes multiple invalid data. According to rule 8 above, invalid data does not need to be labeled or transcribed, and its labeling result is &; Sample image 390 is not completely written, but has obvious character features. According to rule 9 above, it is labeled as &{D}C; The alteration symbol in sample image 391 is misaligned. Ignore the last alteration line in sample image 391, and according to rule 10, its labeling result is &{C}&{A}B.
[0066] Understandably, preserving the original features of the identifiable altered characters during the annotation process helps the prediction model avoid learning the original character's features by labeling all alterations with the same special character, thus preventing low accuracy due to completely different labels. In other words, marking the identifiable altered characters reduces interference from the presence of similar features between unaltered and altered characters with completely different labels, effectively minimizing label differences and further improving model accuracy.
[0067] S230. The pre-built prediction model is trained using the multiple sample images and the annotation results of the multiple sample images.
[0068] The annotation results of the plurality of sample images include the annotation results of the target sample image and the annotation results of the sample images in which no tampering marks are found.
[0069] The prediction model includes convolutional layers, recurrent layers, and transcriptional layers. The prediction model, which has been pre-trained, predicts the handwritten answer and outputs the predicted character.
[0070] Understandably, based on the above S220, before using sample images for model training, the sample images can be preprocessed to increase the diversity of sample images and further improve the accuracy of model training. Specifically, the sample images are randomly sorted by generating random numbers and then processed as follows: 1) Brightness adjustment: Randomly sample from a set of uniform distributions [0.7, 1.3), and assign this sampling result as a brightness enhancement value to the sample image; 2) Contrast adjustment: Randomly sample from a set of uniform distributions [0.7, 1.3), and assign this sampling result as a contrast enhancement value to the sample image; 3) Saturation adjustment: Randomly sample from a set of uniform distributions [0.7, 1.3), and assign this sampling result as a contrast enhancement value to the sample image; 7) Random sampling from a uniformly distributed [-48, 48) and assigning the sampling result as a saturation enhancement value to the sample image; 4) Hue adjustment: Random sampling from a uniformly distributed [-48, 48) and assigning the sampling result as a hue enhancement value to the sample image, then converting the sample image from HSV mode to RGB mode; 5) Random image cropping: Generating a [0, 5) image and randomly cropping the sampled values from its length and width to generate a new sample image; 6) Unifying image height: Unifying the height of the sample image to 32 to ensure image uniformity; 7) Image normalization: Normalizing the array generated from the sample image by dividing all values in the array by 255. It is understood that any one of the preprocessing methods 1) or 7) above can be selected, or multiple preprocessing methods can be combined. The specific combination of preprocessing methods is not limited.
[0071] For example, see Figure 4 , Figure 4 This is a schematic diagram of the structure of the prediction model provided in the embodiments of this disclosure. Figure 4It includes an input image 410, a convolutional layer 420, a recurrent layer 430, and a transcription layer 440. The convolutional layer 420 can be constructed using the most typical algorithm of CTC, CRNN (Convolutional Recurrent Neural Network). The feature extraction part of CRNN uses mainstream convolutional structures, such as ResNet, MobileNet, and VGG. The recurrent layer 430 introduces bidirectional LSTM (Long Short-Term Memory) to enhance context modeling, which can effectively extract contextual information from the image. The transcription layer 440 is constructed based on the CTC module and can be used to decode sequence results. During the model training phase, input image 410 serves as a sample image. Convolutional layer 420 performs feature convolution on input image 410, automatically extracting feature sequences from each input image 410. For example, if input image 410 has a size of (32, W, 3) and is in (Height, Width, Channel) dimension form, after CNN convolution, it will generate a (1, W / 4, 512) feature sequence (feature map). Here, W / 4 is the maximum time length feature required by the RNN, which is also the number of frames included in the feature sequence, and 512 indicates that each input column vector has 512-dimensional features. Recurrent layer 430 predicts the label distribution of each frame in the feature sequence. Traditional Softmax cross-entropyloss requires each column vector to have a corresponding character element, but in the annotation method of this disclosure, the character and label are not in a one-to-one correspondence, therefore, CTC is required. The loss mechanism employs LSTM to address the vanishing gradient problem. The bidirectional LSTM model can learn not only past but also future information, achieving contextual complementarity. By stacking bidirectional LSTM models, a deeper level of abstraction is achieved, outputting the numerical sequence corresponding to the label for each frame. The transcription layer 440 transforms the numerical sequence corresponding to the predicted label for each frame into the final label sequence. This involves summarizing all labeled characters from the annotation results of all sample images, removing duplicate characters, and generating a unique set of labeled characters (i.e., a dictionary). The final label sequence is compared with the dictionary to calculate the path probability sum for each character, and the character corresponding to the highest path probability sum is taken as the output predicted sample character. Finally, the loss function is calculated based on the predicted sample characters and the annotation results, and the network parameters of the prediction model are updated based on the loss function to complete the training of the prediction model, i.e., joint training using a CTC loss function. The prediction model constructed in this disclosure can effectively predict not only single-choice questions without alterations but also complex situations that may occur in multiple-choice questions.
[0072] The prediction model training method provided in this embodiment defines standardized labeling rules and uses multiple preset characters to mark both the altered and unaltered characters together. This preserves the original features of the altered characters and reduces the differences in labels between characters. As a result, the model solves the problem of inaccuracy caused by labeling all alteration marks with the same character, which leads to the model learning the features of the original characters but also because the labels of the alteration marks and the original characters are completely different. This improves the prediction accuracy of the model.
[0073] Based on the above embodiments, Figure 5 The flowchart of the test paper grading method provided in this embodiment is applied to server 12. After the prediction model is trained, the handwritten answers in the image to be graded are predicted based on the prediction model, specifically including, as follows: Figure 5 The following steps S510 to S540 are shown:
[0074] S510. Obtain the image to be graded, wherein the image to be graded includes the handwritten answer to the target test question.
[0075] Unlike online answer recognition and grading, offline automated grading scenarios require scanning and uploading the completed test papers before recognition and grading. If whole-paper recognition is used, the printed text, handwritten text, and problem-solving process mixed in the test paper can easily interfere with the prediction model, resulting in low model prediction recall and leading to problems such as missed or incorrect judgments.
[0076] Understandably, one can directly obtain the image to be graded, including the question and answer area, or scan the exam paper and crop the question and answer area from the scanned paper to obtain a single image of the question and answer area, which is the image to be graded. Simultaneously, the image to be graded needs to be preprocessed, unifying its width to a preset width, which can be 32, the same width used to unify the sample image mentioned above. The height of the image to be graded is also proportionally adjusted according to the preset width. The image to be graded includes the handwritten answers to the target questions. Handwritten answers can have correction marks, including correction marks, corrected characters, and uncorrected characters. Handwritten answers can also be answers without correction marks. The following embodiment uses an image with correction marks as an example.
[0077] For example, see Figure 6 , Figure 6 This is a schematic diagram of the image to be modified provided in an embodiment of this disclosure. Figure 6The test paper 600 is scanned, which includes a question area 610 and a question answering area 620. The question answering area 620 is cropped and further divided into multiple answering area single images 630, each of which is an image to be graded.
[0078] S520. Predict the handwritten answer using a pre-trained prediction model and output the predicted character.
[0079] The predicted character includes a first predicted character and a second predicted character, wherein the second predicted character is at least one of a first preset character, a second preset character, and a third preset character.
[0080] Understandably, based on the above S510, the preprocessed image to be corrected is input into the pre-trained prediction model to recognize the handwritten answers in the image to be corrected and output the predicted characters. The predicted characters are the recognition results. For example, the predicted characters can be in the form of &{B}D. The predicted characters include a first predicted character and a second predicted character. The first predicted character can be understood as a character that the model can recognize or distinguish. The first predicted character may include the altered character and / or the unaltered character. For example, the curly braces in the above example represent the altered character B and the unaltered character D. The second predicted character refers to the preset characters used to mark the alteration marks. For example, the preset characters &, { and} in the above example. The second predicted character may only include one of the three preset characters, or it may be a combination of multiple preset characters.
[0081] Optionally, the handwritten answer is predicted by the pre-trained prediction model, and the predicted character is output. This is achieved through the following steps:
[0082] The height of the image to be corrected is uniformly set to a preset height, and the target width of the image to be corrected is determined accordingly to obtain the processed image to be corrected. The features of the processed image to be corrected are extracted using the convolutional layer to obtain feature data, wherein the feature data includes multiple frames of data, and the number of frames of the feature data is determined according to the target width. The label distribution of each frame of data in the feature data is predicted using the recurrent layer to generate the numerical sequence corresponding to the label of each frame of data. The numerical sequence corresponding to the label of each frame of data is converted into a label sequence using the transcription layer to output the predicted character.
[0083] Understandably, the process by which the prediction model predicts the written answer in the image to be corrected to obtain the predicted character is the same as the process of predicting the sample character in the output sample image during the training of the prediction model, and will not be elaborated here.
[0084] S530. Determine the target character from the predicted characters according to the preset rules.
[0085] The preset rules include a first preset sub-rule corresponding to the first type of question and a second preset sub-rule corresponding to the second type of question.
[0086] Optionally, the target character can be determined from the predicted characters, which can be achieved through the following steps:
[0087] Based on the question type of the target question, a target preset sub-rule is determined in the preset rules.
[0088] Based on the second predicted character, the target character is determined from the first predicted character according to the target preset sub-rule.
[0089] Understandably, based on the above S520, the question type of the target question is determined. The question type can be either a first question type or a second question type. The first question type can be a single-choice question, and the second question type can be a multiple-choice question. Each question type corresponds to a different preset sub-rule, and each preset sub-rule uses a different method to determine the target character in the predicted characters. Specifically, the first question type corresponds to the first preset sub-rule, and the second question type corresponds to the second preset sub-rule. There may be some overlap between the first and second preset sub-rules. After determining the target preset sub-rule, based on the second preset character, the target character is determined in the first predicted character according to the target preset sub-rule. The target character is the final answer to the target question written by the user. For example, in the example above, among the altered character B and the unaltered character D included in the first predicted character, D is determined as the target character.
[0090] Optionally, the target character can be determined from the first predicted character, which can be achieved through the following steps:
[0091] The entirety consisting of the first preset character, the second preset character, the third preset character, and the characters included between the second preset character and the third preset character in the first predicted character is deleted, and the length of the remaining first residual character in the predicted character output by the prediction model is calculated.
[0092] If the length of the first remaining character is equal to the preset value of the target question, then the first remaining character is determined as the target character.
[0093] Understandably, regular expression matching is used to delete the &{} and the characters inside {} from the predicted characters output by the model. In other words, the &{} and the characters inside {} are treated as a whole. If the regular expression matches this whole, it is deleted. Then, the length of the remaining characters in the predicted characters output by the model, excluding the deleted whole, is calculated. The remaining characters are denoted as the first remaining character. The length of the first remaining character is calculated and matched or compared with the preset value of the target question. The preset value can be obtained from the question information stored in the database in advance. The preset value is the number of standard answers for each question or the number of standard answers directly determined according to the question type. For example, if the question type is a multiple choice question, the preset value can be directly determined to be 1. Specifically, for single-choice questions, the process involves checking if only one character remains. For example, if the model outputs predicted characters as &{D}&{B}D, after regular expression matching, &{D} is treated as a single unit and &{B} is deleted as a single unit, resulting in the first remaining character being D. The length of the first remaining character is 1, which is the same as the preset value for single-choice questions. Therefore, the first remaining character D is directly used as the target character, and it is matched against the standard answer. If the standard answer is also D, the match is successful, indicating that the user's final answer is correct, thus completing the automatic grading of the target question. For multiple-choice questions, the number of standard answers for each multiple-choice question is not fixed. Similarly, the length of the first remaining character needs to be calculated and compared with the number of options in the target question (preset value). For example, if the model outputs predicted characters as A&{B}D, &{B} is treated as a single unit and deleted, resulting in the first remaining character being AD. The length of the first remaining character is compared with the number of options in the target question (e.g., 2 out of 4) to complete the automatic grading of multiple-choice questions.
[0094] Optionally, if the length of the first remaining character is greater than the preset value, then the first preset character in the first remaining character is deleted, and the length of the second remaining character in the first remaining character is calculated.
[0095] Understandably, if the length of the first remaining character is greater than the preset value, meaning that after the first regular expression match, the number of remaining characters is greater than the number of standard answers, for multiple-choice questions, if the number of the first remaining characters is greater than the preset value of 1, then the first remaining characters include at least one preset character, at least one altered character, and / or at least one unaltered character. In this case, the first preset character '&' is matched using regular expressions within the first remaining characters, meaning a single preset character is matched, and the matched first preset character (the matching result) is deleted. The length of the remaining characters after deleting the single first preset character is calculated. This remaining character is denoted as the second remaining character. If the length of the second remaining character is equal to the preset value, then the second remaining character is directly used as the target character. For example, if the first remaining character is '&D', and the first regular expression match does not match the entire '&{}' form, then no characters need to be deleted. A second regular expression match is performed according to the preset sub-rule, matching and deleting the first preset character, resulting in the second remaining character 'D', which is only one character, the same as the preset value for multiple-choice questions. The target character is then matched with the standard answer to complete the grading operation. Understandably, if the predicted characters output by the model do not match the entirety of &{} and the characters inside {}, and the length of the predicted characters output by the model is greater than the preset value, that is, the first regular expression match did not match the entirety specified above, in this case, it is not necessary to delete any characters in the predicted characters output by the model. Instead, a second regular expression match is performed to match a single character (the first preset character). For example, if the predicted characters output by the model are &A, the first match did not match the entirety, and the length of the remaining characters is greater than the preset value, a second regular expression match is performed to match &, and & is deleted, leaving A as the remaining character.
[0096] Understandably, in the process of determining the target character, multiple regular expression matches are performed sequentially according to the matching order set by the preset sub-rules. If no character in the current matching rule is matched during the matching process, the next regular expression match is performed according to the matching order set by the preset sub-rules. Regardless of whether a match is found, the length of the remaining characters is calculated after each regular expression match is completed, until the length of the remaining characters is equal to the preset value, at which point the matching process ends and the target character is determined.
[0097] Optionally, if the length of the second remaining character is greater than the preset value, then delete the characters included in the second remaining character, including the first character after the second preset character, the first character before the third preset character, the second preset character, and the third preset character, and calculate the length of the remaining third remaining character in the second remaining character.
[0098] If the length of the third remaining character is equal to the preset value, then the third remaining character is determined as the target character.
[0099] Understandably, if the length of the second remaining character is greater than the preset value, it means that the number of remaining characters is greater than the number of characters in the standard answer. Therefore, a third regular expression match is performed. Within the second remaining character, the regular expression matches the second preset character { and the first character after it, the third preset character} and the first character before it, and the characters within the curly braces {}. The matched results are then deleted. In this case, the second preset character { and the first character after it are considered as a whole, the third preset character} and the first character before it are considered as a whole, and the characters within the curly braces {} are considered as a whole. That is, in the third regular expression match, three wholes are matched and deleted respectively, and the resulting remaining characters are recorded as the third remaining character. The length of the third remaining character is then calculated. Calculating the character length mainly involves calculating the length of the string. If the length of the third remaining character is equal to the preset value, then the third remaining character is determined as the target character. For example, if the target question is a multiple-choice question, the predicted character output by the prediction model is &{A}B}D. After the first and second regular expression matches, the second remaining character is B}D. In the third regular expression match, B} is treated as a whole and matched and deleted. The third remaining character is D, which is also the target character.
[0100] Optionally, if the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is greater than the preset value, then the last character of the third remaining character is taken as the target character; or,
[0101] If the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is less than the preset value or the length of the second remaining character is less than the preset value, then the last character in the predicted characters output by the prediction model is determined as the target character.
[0102] Understandably, before performing the fourth regular expression matching, it is necessary to determine the corresponding preset sub-rules based on the type of the target question to determine the rules for the fourth regular expression matching. The preset rules include multiple preset sub-rules, and the first three regular expression matching rules for each preset sub-rule are the same. The target preset sub-rule can be determined after the first three regular expression matchings for the fourth regular expression matching, or it can be determined before the matching begins. If the target question type is a multiple-choice question, meaning the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is greater than the preset value (the preset value for multiple-choice questions is 1), then the last character of the third remaining character is taken as the target character. For example, after the above three regular expression matchings, if the length of the third remaining character is still not 1, such as the predicted character (recognition result) output by the model being &{T&TF, the result obtained after three regular expression matching deletions (the third remaining character) being TF, then the last character F is selected as the target character for comparison with the standard answer. Alternatively, if the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is less than the preset value or the length of the second remaining character is less than the preset value... The numerical value indicates that after three regular expression matching deletions, the length of the remaining characters is 0 less than 1, meaning all characters have been matched and deleted. Alternatively, after two regular expression matching deletions, all characters have been matched and deleted. In this case, the last character in the predicted characters output by the prediction model is determined as the target character. For example, if the recognition result is &{D}&{D}&{A, the first regular expression matching deletes &{D} and &{D}, the second regular expression matching deletes &, and the third regular expression matching deletes &{A. The length of the remaining characters in the third regular expression matching is 0. At this point, a character from A to Z is matched using regular expressions in the recognition result, and the last matched character A is taken as the target character. The target character A is then compared with the standard answer.
[0103] Optionally, if the target preset sub-rule is the second preset sub-rule, and the length of the third remaining character is greater than the preset value, then a single preset character in the predicted characters output by the prediction model is deleted, and the length of the remaining fourth remaining character in the predicted characters output by the prediction model is calculated, wherein the single preset character is the first preset character, the second preset character, and the third preset character.
[0104] If the length of the fourth remaining character is equal to the preset value, then the fourth remaining character is determined as the target character.
[0105] Understandably, if the target question is a multiple-choice question, meaning the target preset sub-rule is the second preset sub-rule, and the length of the third remaining character is greater than the preset value (meaning the length of the remaining character does not match the preset length of the question answer), then a single preset character will be directly deleted from the predicted characters output by the prediction model. This means no combined deletion, i.e., not deleting the second preset character and its adjacent first character, the third preset character and its adjacent first character, or the character between the second and third preset characters simultaneously. Only a single preset character will be deleted, and the length of the fourth remaining character in the predicted characters output by the prediction model will be calculated. Here, a single preset character is the first preset character, the second preset character, and the third preset character. For example, if the recognition result is AB&}, after the above three regular expression matching deletions, the third remaining character is A. The first regular expression matching does not delete any characters. The second regular expression matching deletes the single character &, resulting in the second remaining character AB}. The third regular expression matching deletes the combination B} in the second remaining character. If the target question is 4-choose-2, that is, the preset value is 2, then the matching deletes the three single characters &, {,} in the recognition result, resulting in the fourth remaining character AB. This is compared with the length of the answer set in the question. If the length of the fourth remaining character 2 is equal to the preset value 2, then the fourth remaining character AB is determined as the target character.
[0106] S540. Compare the target character with the standard answer of the target question to complete the grading of the target question.
[0107] Understandably, based on the above S530, after determining the final answer (target character) written in the question answering area, the target character is matched and compared with the pre-stored standard answer of the target question, and the grading result is output to complete the automatic grading of the target question. If the target character and the standard answer are the same, the target question is graded correctly.
[0108] This disclosure provides a test paper grading method. The method involves extracting the answer area of each question from a scanned test paper as the image to be graded. A prediction model is used to predict the handwritten answers in the image to be graded. This effectively avoids interference from printed text, handwritten text, and the solution process mixed in with the test paper, reducing missed or incorrect judgments and improving the accuracy of the model's predictions to some extent. After obtaining the predicted characters, a target preset sub-rule is determined based on the test paper type. The preset sub-rule is a matching and deletion rule based on a custom standardized annotation rule. The predicted characters include altered characters, unaltered characters, and preset characters. According to the matching rule specified by the target preset sub-rule, the target character is determined among the unaltered characters. By using the preset character to annotate the altered characters, the interference of similar features between the unaltered and altered characters on the model's accuracy is reduced, further ensuring the accuracy of the prediction. This method is suitable for recognition scenarios with alteration marks, solves the problem of different lengths of text recognition in images with alteration marks affecting prediction accuracy, and has good feasibility.
[0109] Based on the above embodiments, Figure 7 This is a schematic diagram of a test paper grading device provided in an embodiment of the present disclosure. The test paper grading device 700 includes an acquisition module 710, a prediction module 720, a determination module 730, and a grading module 740, wherein:
[0110] The acquisition module 710 is used to acquire the image to be graded, wherein the image to be graded includes the handwritten answers to the target test questions;
[0111] The prediction module 720 is used to predict the handwritten answer using a pre-trained prediction model and output the predicted character.
[0112] The determination module 730 is used to determine the target character from the predicted characters according to preset rules;
[0113] The grading module 740 is used to compare the target character with the standard answer of the target test question to complete the grading of the target test question.
[0114] Optionally, the predicted character in device 700 includes a first predicted character and a second predicted character, wherein the second predicted character is at least one of a first preset character, a second preset character, and a third preset character, and the preset rule includes a first preset sub-rule corresponding to a first type of question and a second preset sub-rule corresponding to a second type of question.
[0115] Optionally, module 730 is specifically used for:
[0116] Based on the question type of the target test question, a target preset sub-rule is determined in the preset rules;
[0117] Based on the second predicted character, the target character is determined from the first predicted character according to the target preset sub-rule.
[0118] Optionally, module 730 is specifically used for:
[0119] The entirety consisting of the first preset character, the second preset character, the third preset character, and the characters included between the second preset character and the third preset character in the first predicted character is deleted, and the length of the remaining first residual character in the predicted character output by the prediction model is calculated.
[0120] If the length of the first remaining character is equal to the preset value of the target question, then the first remaining character is determined as the target character.
[0121] If the length of the first remaining character is greater than the preset value, then the first preset character in the first remaining character is deleted, and the length of the second remaining character in the first remaining character is calculated.
[0122] If the length of the second remaining character is greater than the preset value, then delete the characters included in the second remaining character, including the first character after the second preset character, the first character before the third preset character, the second preset character, and the third preset character, and calculate the length of the remaining third remaining character in the second remaining character.
[0123] If the length of the third remaining character is equal to the preset value, then the third remaining character is determined as the target character.
[0124] If the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is greater than the preset value, then the last character of the third remaining character is taken as the target character; or,
[0125] If the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is less than the preset value or the length of the second remaining character is less than the preset value, then the last character in the predicted characters output by the prediction model is determined as the target character.
[0126] If the target preset sub-rule is the second preset sub-rule, and the length of the third remaining character is greater than the preset value, then a single preset character in the predicted characters output by the prediction model is deleted, and the length of the remaining fourth remaining character in the predicted characters output by the prediction model is calculated, wherein the single preset character is the first preset character, the second preset character, and the third preset character.
[0127] If the length of the fourth remaining character is equal to the preset value, then the fourth remaining character is determined as the target character.
[0128] Optionally, the prediction model in device 700 includes convolutional layers, recurrent layers, and transcriptional layers.
[0129] Optionally, the prediction module 720 is specifically used for:
[0130] The height of the image to be corrected is uniformly set to a preset height, and the target width of the image to be corrected is determined accordingly to obtain the processed image to be corrected.
[0131] The convolutional layer is used to extract features from the processed image to be corrected to obtain feature data, wherein the feature data includes multiple frames of data, and the number of frames of the feature data is determined according to the target width;
[0132] The recurrent layer is used to predict the label distribution of each frame of the feature data, and a numerical sequence corresponding to the label of each frame of data is generated.
[0133] The transcription layer is used to convert the numerical sequence corresponding to the label of each frame of data into a label sequence in order to output the predicted character.
[0134] Optionally, device 700 is also used for:
[0135] Acquire multiple sample images and annotate the unaltered handwritten characters in each of the multiple sample images;
[0136] Among the multiple sample images, a target sample image with tampering marks is identified. A first preset character is added before the untampered handwritten character in the target sample image. A second preset character is added adjacent to the first preset character. A recognizable tampered character in the target sample image is added adjacent to the second preset character. A third preset character is added adjacent to the recognizable tampered character to obtain the annotation result of the target sample image.
[0137] The pre-built prediction model is trained using the multiple sample images and their annotation results. The annotation results of the multiple sample images include the annotation results of the target sample image and the annotation results of the sample images in which no tampering marks are found.
[0138] The device provided in this embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0139] Exemplary embodiments of this disclosure also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the electronic device to perform a method according to an embodiment of this disclosure.
[0140] Exemplary embodiments of this disclosure also provide a computer program product, including a computer program, wherein, when executed by a processor of a computer, the computer program is used to cause the computer to perform a method according to an embodiment of this disclosure.
[0141] refer to Figure 8 The present invention describes a structural block diagram of an electronic device 800 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can 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 illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0142] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0143] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, output unit 807, storage unit 808, and communication unit 809. Input unit 806 can be any type of device capable of inputting information to electronic device 800. Input unit 806 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 807 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 808 may include, but is not limited to, disks and optical discs. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0144] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above. For example, in some embodiments, the test item grading method or the training method for the recognition network can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. In some embodiments, the computing unit 801 can be configured by any other suitable means (e.g., by means of firmware) to perform the test item grading method or the training method for the recognition network.
[0145] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0146] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, 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 devices, magnetic storage devices, or any suitable combination of the foregoing.
[0147] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0148] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0149] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0150] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.
[0151] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. 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 this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A test paper grading method, characterized in that, include: Obtain the image to be graded, wherein the image to be graded includes the handwritten answers to the target test questions; The handwritten answer is predicted by a pre-trained prediction model, and the predicted characters are output. The predicted characters include a first predicted character and a second predicted character. The first predicted character includes the altered character and / or the unaltered character. The second predicted character refers to a preset character used to mark the alteration marks. The second predicted character is at least one of the first preset character, the second preset character, and the third preset character. Determining the target character from the predicted characters according to preset rules includes: determining the target character based on regular expression matching and the length of the remaining characters in the predicted characters after each regular expression matching; The target character is compared with the standard answer to the target question to complete the grading of the target question; The preset rules include a first preset sub-rule corresponding to the first question type and a second preset sub-rule corresponding to the second question type. The step of determining the target character from the predicted characters according to preset rules includes: Based on the question type of the target test question, a target preset sub-rule is determined in the preset rules; The entirety consisting of the first preset character, the second preset character, the third preset character, and the first predicted character included between the second preset character and the third preset character is deleted, and the length of the remaining first residual character in the predicted characters output by the prediction model is calculated. If the length of the first remaining character is equal to the preset value of the target question, then the first remaining character is determined as the target character; If the length of the first remaining character is greater than the preset value, then the first preset character in the first remaining character is deleted, and the length of the second remaining character in the first remaining character is calculated. If the length of the second remaining character is greater than the preset value, then delete the characters included between the second preset character and the first character after it, the third preset character and the first character before it, and the second preset character and the third preset character, and calculate the length of the remaining third remaining character in the second remaining character; If the length of the third remaining character is equal to the preset value, then the third remaining character is determined as the target character.
2. The method according to claim 1, characterized in that, The method further includes: If the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is greater than the preset value, then the last character of the third remaining character is taken as the target character; or, If the target preset sub-rule is the first preset sub-rule, and the length of the third remaining character is less than the preset value or the length of the second remaining character is less than the preset value, then the last character in the predicted characters output by the prediction model is determined as the target character.
3. The method according to claim 1, characterized in that, The method further includes: If the target preset sub-rule is the second preset sub-rule, and the length of the third remaining character is greater than the preset value, then a single preset character in the predicted characters output by the prediction model is deleted, and the length of the remaining fourth remaining character in the predicted characters output by the prediction model is calculated, wherein the single preset character is the first preset character, the second preset character, and the third preset character; If the length of the fourth remaining character is equal to the preset value, then the fourth remaining character is determined as the target character.
4. The method according to claim 1, characterized in that, The prediction model includes convolutional layers, recurrent layers, and transcription layers. The pre-trained prediction model predicts the handwritten answer and outputs predicted characters, including: The height of the image to be corrected is uniformly set to a preset height, and the target width of the image to be corrected is determined accordingly to obtain the processed image to be corrected. The convolutional layer is used to extract features from the processed image to be corrected to obtain feature data, wherein the feature data includes multiple frames of data, and the number of frames of the feature data is determined according to the target width; The recurrent layer is used to predict the label distribution of each frame of the feature data, and a numerical sequence corresponding to the label of each frame of data is generated. The transcription layer is used to convert the numerical sequence corresponding to the label of each frame of data into a label sequence in order to output the predicted character.
5. The method according to claim 1, characterized in that, The prediction model is obtained through the following steps: Acquire multiple sample images and annotate the unaltered handwritten characters in each of the multiple sample images; Among the multiple sample images, a target sample image with tampering marks is identified. A first preset character is added before the untampered handwritten character in the target sample image. A second preset character is added adjacent to the first preset character. A recognizable tampered character in the target sample image is added adjacent to the second preset character. A third preset character is added adjacent to the recognizable tampered character to obtain the annotation result of the target sample image. The pre-built prediction model is trained using the multiple sample images and their annotation results. The annotation results of the multiple sample images include the annotation results of the target sample image and the annotation results of the sample images in which no tampering marks are found.
6. A test paper grading device, characterized in that, The device is used to implement the test paper grading method according to any one of claims 1 to 5, including: The acquisition module is used to acquire the image to be graded, wherein the image to be graded includes the handwritten answers to the target test questions; The prediction module is used to predict the handwritten answer using a pre-trained prediction model and output the predicted character. The determination module is used to determine the target character from the predicted characters according to preset rules; The grading module is used to compare the target character with the standard answer of the target question to complete the grading of the target question.
7. An electronic device, characterized in that, The electronic device includes: Processor; and Stored program memory, The program includes instructions that, when executed by the processor, cause the processor to perform the test grading method according to any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the test paper grading method according to any one of claims 1 to 5.