Digital marking methods and devices for paper-based work
By preprocessing paper assignments and combining them with subject-specific layout feature libraries and physical boundary detection, along with a semantic similarity model fine-tuned by BERT and correction of student handwriting style features, automated grading of paper assignments has been achieved. This solves the problem of insufficient accuracy in existing automated grading technologies and improves recognition accuracy and adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI EDUCATION NETWORK PUBLISHING
- Filing Date
- 2025-09-23
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies cannot achieve effective automatic review of paper-based work, and the recognition accuracy is insufficient, especially in terms of adapting to complex layouts and compatibility with personalized scenarios.
By acquiring and preprocessing the original images of paper assignments, a two-dimensional template is generated by combining a subject-specific layout feature library and a physical boundary detection model. A semantic similarity model fine-tuned by BERT is used to divide the question area and the answer area. An appropriate detection and recognition model is called and student handwriting style features are introduced to correct the fuzzy recognition results, thereby achieving automatic grading.
It achieves fully automated grading from image input to grading result output, improving recognition accuracy and grading result accuracy, adapting to the differences and complex formats of multidisciplinary assignments, and reducing errors caused by insufficient adaptability of general models.
Smart Images

Figure CN121074933B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent operation technology, and particularly relates to a digital grading method and device for paper-based operations. Background Technology
[0002] With the current acceleration of digital transformation in education, paper-based assignments remain the mainstream form of homework due to their ease of writing.
[0003] Currently, homework and workbook correction still relies primarily on manual work by teachers. Correcting students' paper-based assignments is consistently time-consuming, requiring significant time from parents, students, and teachers alike, with less than ideal results. Parents face time conflicts and lack of knowledge when checking homework, while teachers engage in a large amount of repetitive work.
[0004] In related technologies, existing paper-based homework grading methods can achieve basic digital processing, but are limited to image acquisition of paper-based homework, facilitating teachers and parents to extract and grade homework content. However, existing technologies cannot achieve effective automatic grading, have insufficient recognition accuracy, and are still in the optimization stage in terms of adapting to complex layouts and compatibility with personalized scenarios. Summary of the Invention
[0005] The purpose of this invention is to provide a digital grading method and apparatus for paper-based work, so as to at least solve the technical problems of insufficient automatic grading and inadequate recognition accuracy in the prior art.
[0006] To achieve the above objectives, the embodiments of this application provide the following technical solutions.
[0007] According to one embodiment of this application, a method for digitally grading paper-based assignments is provided, comprising the following steps:
[0008] Step S101: Obtain the original image of the paper assignment, preprocess the original image to obtain the assignment image, the assignment image containing the question content, answer content and physical boundary information;
[0009] Step S102: Perform adaptive partitioning of the homework image containing student information to obtain the question area and the answer area; wherein, a pre-built subject layout feature library is called, which contains the contour and size features of different subject elements, and the binding line, page number and paper edge of the homework image are identified by the physical boundary detection model based on edge detection to generate a two-dimensional template of subject layout and physical boundary; the question number information of the question area and the association information of the answer area in the homework image are extracted, and the association degree between the answer area and the question area is calculated by the semantic similarity model fine-tuned by BERT, and the corresponding answer areas are divided according to the association degree. The answer area includes an objective filling area and a subjective writing area, and the subjective writing area includes a handwritten text area and a handwritten formula area.
[0010] Step S103: Based on the content characteristics of the target area, call the detection and recognition model that matches the content characteristics to obtain the recognition results of each answer area; for the fuzzy recognition results of the subjective writing area, introduce the writing style features of the current student information to correct the fuzzy recognition results, and update the recognition results of the subjective writing area based on the correction results; compare the final recognition results of each answer area with the homework answers to generate and output the grading results.
[0011] Furthermore, in step S102, the step of combining the physical boundary detection model based on edge detection to identify the binding line, page number, and paper edge of the assignment image, and generating a two-dimensional template of subject layout and physical boundary, includes:
[0012] The work image is preprocessed with physical boundary detection. The preprocessed boundary detection image is then input into the Canny operator to extract linear edges and filter out candidate binding line areas.
[0013] For the grayscale average value around the candidate area of the binding line, the grayscale value of the shadow area is compensated by calling the shadow compensation module, and the binding line position is finally determined.
[0014] Connectivity analysis is performed on the boundary detection preprocessed image to select connected components as page number candidate regions; a lightweight character recognition model is used to recognize characters in the page number candidate regions to determine the page number regions;
[0015] The outer contour of the preprocessed image is extracted using a contour detection algorithm. The gray-scale mean value of the region within the contour is calculated. Background regions outside the contour whose gray-scale values exceed the threshold are removed based on the gray-scale threshold to determine the paper edge range.
[0016] Using a pre-built subject layout feature library, extract the subject layout features corresponding to the current assignment; map the binding line position, page number area, and paper edge range to the coordinate system of the subject layout, remove invalid areas in the subject layout that exceed the paper edge, cover the binding line, or page number, and generate a two-dimensional template containing physical boundaries and subject layout.
[0017] Furthermore, in step S102, the steps of extracting the question number information of the question area and the association information of the answer area in the task image, calculating the association degree between the answer area and the question area using a BERT-tuned semantic similarity model, and dividing the corresponding answer areas according to the association degree also include:
[0018] In the input layer of the BERT model, the input data includes a concatenated sequence of question number information and answer association information, as well as regional location feature encoding. A subject adaptation layer is introduced into the pooling layer of the BERT model. The subject adaptation layer is used to call the association rules between the question area and the answer area in the corresponding subject when the BERT model processes different subject assignments. The attention weights are adjusted by configuring a regional location attention mask in the middle attention layer of the BERT model. The regional location attention mask is a binary mask, and the mask area includes a question association mask area and a handwriting association mask area.
[0019] Fine-tuning of the BERT model based on a dynamic adaptation strategy;
[0020] The question number information and association information of the image to be processed are input into the fine-tuned BERT model to obtain the semantic similarity score; at the same time, a position decay factor is introduced to correct the similarity score based on the pixel distance between the question area and the handwriting area.
[0021] Based on similarity scores, the answer area is bound to the question area and divided into corresponding answer areas.
[0022] Furthermore, the steps for fine-tuning the BERT model based on the dynamic adaptation strategy include:
[0023] A mapping sample library of regional features and correlation strength is constructed. Each sample contains basic attributes, feature data, and correlation strength annotations. The basic attributes include subject labels, correlation type labels, and regional type combinations. The feature data includes text sequences of the question area and answer area, regional location coordinates, and mask area markings of regional location attention masks. The correlation strength annotations include manually annotated correlation degree labels and historical correlation accuracy of homework grading data of the same grade.
[0024] The learning rate of the BERT model is dynamically adjusted based on the difficulty level of samples in the sample library, which is divided according to the historical association accuracy. The learning rate is directly proportional to the difficulty level.
[0025] A weighted loss function for regional features is constructed by introducing regional location weight, regional type weight, and pseudo-association suppression weight. Among them, the regional location weight is assigned by calculating the vertical distance between the question area and the answer area based on the pixel-level regional location coordinates in the sample library; the regional type weight is assigned differently for different association types based on the combination of regional types and subject labels in the sample library; and the pseudo-association suppression weight is determined by judging the overlap area ratio between the answer area and the pseudo-association area based on the mask area marking of the regional location attention mask in the sample library.
[0026] The weighted loss function is substituted into the BERT model's optimizer, and backpropagation is used to update the BERT model's attention layer and pooling layer to achieve fine-tuning of the BERT model; the weighted loss function is expressed as: In the formula, Indicates the weight of the region's location. Indicates the weight of the region type. Indicates the weight for suppressing spurious associations; This represents the binary cross-entropy loss.
[0027] Furthermore, in step S103, in the step of calling the matching detection and recognition model, the text recognition model is called to recognize the text in the handwritten text area. The text recognition model is an end-to-end handwritten optical character recognition model trained based on a convolutional recurrent neural network combined with connection temporal classification.
[0028] include:
[0029] The feature extraction layer extracts edge and texture features of handwritten text by embedding spatial attention modules between convolutional blocks and introducing residual skip connections.
[0030] The temporal feature learning layer is configured with temporal gating units at the output of the bidirectional long short-term memory network Bi-LSTM and introduces a cross-layer attention mechanism to capture the temporal dependencies of text characters. The cross-layer attention mechanism enables attention interaction between the outputs of different layers of Bi-LSTM, thereby enhancing the contextual semantic constraints.
[0031] The decoding layer dynamically adjusts the CTC whitespace filtering threshold and integrates a 3-gram language model to calculate the perplexity of the candidate sequences obtained by greedy decoding of CTC, and selects the sequence with the lowest perplexity as the final output. The CTC whitespace filtering threshold is used to determine whether to remove whitespace characters in the prediction result during the decoding process, and its value is dynamically set according to the variance of the line height of the handwritten text.
[0032] Furthermore, in step S103, in the step of calling the matching detection and recognition model, the handwritten formula area calls the formula recognition model to output the LaTeX format formula, wherein the formula recognition model is trained by iterative optimization based on the basic network parameters of the CROHME model system;
[0033] include:
[0034] The structure extraction layer is used to extract symbol features and hierarchical structure features of handwritten formulas by introducing symbol contour enhancement units and embedding a structure attention module in the convolutional block; wherein, the symbol contour enhancement unit adopts an expanded convolutional kernel to enhance the contour features of the formula symbols; the structure attention module generates a structure weight map based on preset formula hierarchical labels, increases the weight of formula hierarchical associated regions, and reduces the weight of isolated symbol regions.
[0035] The association learning layer introduces a cross-level attention mechanism in the bidirectional gated recurrent unit and configures a symbolic dependency constraint unit to capture the association and hierarchical dependency between formula symbols. The cross-level attention mechanism enables high-level structural features and low-level symbolic features to interact with each other, calculate the hierarchical association degree, and strengthen the weight of highly associated features. The symbolic dependency constraint unit is based on mathematical grammar rules and imposes penalties on symbolic associations that do not conform to the rules.
[0036] The LaTeX encoding generation layer dynamically adjusts the encoding mapping rules and integrates a formula syntax rule library to perform syntax verification on the decoded candidate LaTeX sequences, selecting the sequence with the highest verification and matching degree as the final output. The symbol-LaTeX encoding mapping rules are dynamically adjusted according to the symbol confidence. The formula syntax rule library is constructed based on mathematical formula specifications and is used to perform syntax error correction on the candidate sequences.
[0037] Furthermore, in step S103, the step of calling the matching detection and recognition model involves calling an adaptive threshold segmentation and area proportion analysis model to identify the filling result for the filled area, wherein:
[0038] Obtain the Region of Interest (ROI) image of the multiple-choice filling area in the assignment image, convert the RGB color image to a single-channel grayscale image, and use a Gaussian kernel to filter the grayscale image to make the edge transition between the filling area and the background smooth.
[0039] For the preprocessed grayscale image, the global optimal threshold is calculated using the Otsu algorithm to initially distinguish the filled area from the background; the filled area ROI is evenly divided into multiple sub-blocks, and the Otsu algorithm is executed on each sub-block individually to obtain the local optimal threshold of the sub-block; the final segmentation threshold is calculated using the fusion coefficient.
[0040] The grayscale image is converted into a binary image using the final threshold. The filled dark areas are marked as foreground and the background areas are marked as 0. Connectivity detection and filtering are then performed on the binarized image.
[0041] The total area percentage of the filled region is calculated and the effectiveness of the filling is determined by combining it with an adaptive threshold. The adaptive threshold is determined based on the filling tool type, historical sample statistics, and filling characteristics of different tools. The area percentage R is expressed as:
[0042]
[0043] In the formula, This represents the sum of the areas of all valid connected components. This represents the total area of the filled ROI.
[0044] Furthermore, in step S103, the step of correcting the fuzzy recognition result of the subjective writing area by introducing the writing style features of the current student information to the fuzzy recognition result includes:
[0045] Historical image data of the subjective writing area in current students' historical paper assignments were collected, and a student writing style feature database was constructed using the extracted temporal and spatial features. Among them, in the temporal features, a 128-dimensional temporal feature vector was formed by sampling handwriting trajectory, extracting writing speed, continuous writing rhythm and pause interval; in the spatial features, character spacing, tilt angle and pen pressure distribution were extracted through image processing to form a 2048-dimensional spatial feature matrix.
[0046] For the content in the subjective writing area that is marked as a fuzzy recognition result, the real-time writing features of the current fuzzy area are extracted, the fusion similarity with the same type of features in the feature library is calculated, and a correction process is performed based on the fusion similarity result. In the correction process, a differentiated correction strategy is applied according to the fuzzy type and subject characteristics.
[0047] Furthermore, based on the fuzzy type and subject characteristics, the steps for applying differentiated correction strategies include:
[0048] For text ambiguity, historical writing samples of characters that students easily confuse are called from the feature library. Based on the spatial features of the current ambiguity character and the matching degree between the historical correct samples, the character is corrected according to historical habits.
[0049] For formula-type fuzzy symbols, the writing rhythm in the temporal features is combined with the matching degree between the writing speed curve of the current fuzzy symbol and the rhythm features of the correct symbols in the feature library, and the correction is made according to the rhythm features.
[0050] The semantic consistency before and after the correction is verified to check the corrected result.
[0051] According to another embodiment of this application, a grading apparatus is provided for implementing the digital grading method for paper-based work provided in the above embodiments, comprising the following modules:
[0052] The homework image processing module is used to acquire the original image of the paper homework, preprocess the original image to obtain the homework image, and the homework image includes the question content, the answer content and the physical boundary information.
[0053] The region recognition module is used to perform adaptive partitioning of homework images containing student information to obtain question areas and answer areas. Specifically, it calls a pre-built subject-specific layout feature library, which contains the contour and size features of elements from different subjects. Combined with an edge-detection-based physical boundary detection model, it identifies the binding lines, page numbers, and paper edges of the homework image, generating a two-dimensional template of subject layout and physical boundaries. It extracts the question number information from the question area and the association information between the answer area and the homework image. Using a BERT-tuned semantic similarity model, it calculates the association degree between the answer area and the question area, and divides the corresponding answer areas according to the association degree. The answer area includes an objective filling area and a subjective writing area, and the subjective writing area includes a handwritten text area and a handwritten formula area.
[0054] The content recognition module is used to call a detection and recognition model that matches the content characteristics of the target area to obtain the recognition results of each answer area; for the fuzzy recognition results of the subjective writing area, the writing style characteristics of the current student information are introduced to correct the fuzzy recognition results, and the recognition results of the subjective writing area are updated based on the correction results; the final recognition results of each answer area are compared with the homework answers to generate and output the grading results.
[0055] Compared with the prior art, the technical advantages of the embodiments of this application are reflected in the following aspects:
[0056] This application preprocesses the original image to obtain an assignment image containing the question content, answer content, and physical boundary information, preserving key data for subsequent assignment grading and avoiding redundant background interference. It then uses a subject-specific layout feature library combined with a physical boundary detection model to generate a two-dimensional template, and uses a BERT-tuned semantic similarity model to divide the question area and the corresponding answer area, clarifying the relationship between the question and the answer and providing a precise positioning basis for automatic recognition. Based on the characteristics of the answer area content, it calls a matching detection and recognition model, and after correcting the fuzzy recognition results by combining student handwriting style characteristics, it compares the results with the assignment answers to output the grading results. This forms a fully automated process from image input to grading result output, requiring no manual intervention and achieving effective automatic grading.
[0057] This application embodiment identifies binding lines, page numbers, and paper edges through physical boundary detection, and eliminates invalid areas by combining subject layout feature library to avoid recognition deviations caused by incorrect area positioning; it calls the appropriate detection and recognition model for different answer areas, and at the same time introduces the writing style features of the current student information to correct the fuzzy recognition results of the subjective writing area, reducing errors caused by insufficient adaptability of the general model, and effectively improving recognition accuracy and the accuracy of the marking results;
[0058] This application's embodiments call upon a pre-built subject-specific layout feature library, which can specifically adapt to the layout differences of assignments in multiple subjects such as mathematics, Chinese, and English; at the same time, it combines a physical boundary detection model based on edge detection to identify binding lines, page numbers, and paper edges, generating a dual-dimensional template of subject-specific layout and physical boundary, which can be compatible with assignment layouts of different paper sizes and binding methods, avoiding mismatches between questions and answers caused by layout confusion, and significantly improving the adaptability of complex layouts. Attached Figure Description
[0059] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0060] In the attached diagram:
[0061] Figure 1 This is a flowchart illustrating the implementation of a digital grading method for paper-based work provided in an embodiment of the present invention.
[0062] Figure 2 This is a sub-flowchart of a digital grading method for paper-based work provided in an embodiment of the present invention;
[0063] Figure 3 This is a structural block diagram of the text recognition model provided in an embodiment of the present invention;
[0064] Figure 4 This is a structural block diagram of the formula recognition model provided in an embodiment of the present invention;
[0065] Figure 5 This is a structural block diagram of a digital marking device for paper-based work provided in an embodiment of the present invention. Detailed Implementation
[0066] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0067] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0068] According to the embodiments of this application, a method embodiment for digital grading of paper-based work is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0069] Please refer to Figure 1 In one embodiment of this application, a method for digitally grading paper-based assignments is provided, the method comprising the following steps:
[0070] Step S101: Obtain the original image of the paper assignment, preprocess the original image to obtain the assignment image, the assignment image containing the question content, answer content and physical boundary information;
[0071] This embodiment acquires the original image of the paper work using image acquisition devices, including but not limited to: document scanners and high-definition cameras; wherein, for document scanners, a scanning resolution of ≥300 DPI is set to ensure clear acquisition of the question text, answer writing traces (including handwritten text, formulas, and markings) and physical boundary information such as paper edges, binding lines, and page numbers on the paper work, avoiding deviations in subsequent boundary detection or content recognition due to insufficient resolution; the high-definition camera is used to capture the paper work under uniform lighting conditions through a fixed shooting bracket or smart terminal, with the shooting angle kept perpendicular to the work plane to ensure that the acquired original image has no geometric distortion and completely covers the entire content of a single page of work.
[0072] Furthermore, the preprocessing steps for the original image include:
[0073] Morphological filtering is used to smooth out paper wrinkles. Specifically, the Canny operator is used to extract the gray-level gradient in the image. Based on the gray-level gradient, the linear region composed of continuous pixels is marked as a wrinkle candidate region. Morphological dilation is performed on the wrinkle candidate region first, and then morphological erosion is performed to preserve the original outline of the text and graphics in the work.
[0074] Bilateral filtering enhances the contrast of blurred regions. The process involves converting the original image to grayscale, calculating the grayscale variance of each pixel block, marking blurred regions based on the grayscale variance, determining the spatial and grayscale standard deviations for each blurred region, constructing a filtering window centered on each pixel that matches the spatial standard deviation, calculating the spatial distance weights between pixels within the window and the center pixel, and updating the center pixel's grayscale value using a weighted average. Finally, the contrast of the blurred region after filtering is calculated, where the contrast is the difference between the maximum and minimum grayscale values within the region.
[0075] This application preprocesses the original image to obtain an assignment image containing the question content, answer content, and physical boundary information, thus preserving key data for subsequent assignment grading and avoiding redundant background interference.
[0076] Please continue to refer to Figure 1 The digital grading method for paper-based work in this embodiment further includes the following steps:
[0077] Step S102: Perform layout adaptive partitioning on the homework image containing student information to obtain the question area and the answer area; the answer area includes an objective filling area and a subjective writing area, and the subjective writing area includes a handwritten text area and a handwritten formula area;
[0078] Specifically, in step S102, a pre-built subject layout feature library is called. The feature library contains the outline and size features of different subject elements. Combined with the physical boundary detection model based on edge detection, the binding line, page number and paper edge of the assignment image are identified to generate a two-dimensional template of subject layout and physical boundary.
[0079] This application's embodiments call upon a pre-built subject-specific layout feature library, which can specifically adapt to the layout differences of assignments in multiple subjects such as mathematics, Chinese, and English; at the same time, it combines a physical boundary detection model based on edge detection to identify binding lines, page numbers, and paper edges, generating a dual-dimensional template of subject-specific layout and physical boundary, which can be compatible with assignment layouts of different paper sizes and binding methods, avoiding mismatches between questions and answers caused by layout chaos, and significantly improving the adaptability of complex layouts;
[0080] Furthermore, in step S102, the question number information of the question area and the association information of the answer area in the task image are extracted, and the association degree between the answer area and the question area is calculated by the semantic similarity model fine-tuned by BERT. The corresponding answer areas are divided according to the association degree.
[0081] This application embodiment generates a two-dimensional template by calling the subject layout feature library and combining it with the physical boundary detection model, and divides the question area and the corresponding answer area by using a semantic similarity model finely tuned by BERT, clarifying the relationship between the question and the answer, and providing a precise positioning basis for automatic recognition;
[0082] Furthermore, in step S102, the step of combining the physical boundary detection model based on edge detection to identify the binding line, page number, and paper edge of the assignment image, and generating a two-dimensional template of subject layout and physical boundary, includes:
[0083] The work image is preprocessed with physical boundary detection. The preprocessed boundary detection image is then input into the Canny operator to extract linear edges and filter out candidate binding line areas.
[0084] For the grayscale average value around the candidate area of the binding line, the grayscale value of the shadow area is compensated by calling the shadow compensation module, and the binding line position is finally determined.
[0085] Connectivity analysis is performed on the boundary detection preprocessed image to select connected components as page number candidate regions; a lightweight character recognition model is used to recognize characters in the page number candidate regions to determine the page number regions;
[0086] The outer contour of the preprocessed image is extracted using a contour detection algorithm. The gray-scale mean value of the region within the contour is calculated. Background regions outside the contour whose gray-scale values exceed the threshold are removed based on the gray-scale threshold to determine the paper edge range.
[0087] Using a pre-built subject layout feature library, extract the subject layout features corresponding to the current assignment; map the binding line position, page number area, and paper edge range to the coordinate system of the subject layout, remove invalid areas in the subject layout that exceed the paper edge, cover the binding line, or page number, and generate a two-dimensional template containing physical boundaries and subject layout.
[0088] This application embodiment identifies binding lines, page numbers, and paper edges through physical boundary detection, and eliminates invalid areas by combining subject layout feature library to avoid recognition deviations caused by incorrect area positioning; it calls the appropriate detection and recognition model for different answer areas, and at the same time introduces the writing style features of the current student information to correct the fuzzy recognition results of the subjective writing area, reducing errors caused by insufficient adaptability of the general model, and effectively improving recognition accuracy and the accuracy of the marking results.
[0089] Furthermore, such as Figure 2As shown, the steps of extracting the question number information from the question area and the association information between the answer area in the assignment image, calculating the association degree between the answer area and the question area using a BERT-fine-tuned semantic similarity model, and dividing the corresponding answer areas according to the association degree, also include the following steps:
[0090] Step S201: In the input layer of the BERT model, the input data includes a concatenated sequence of question number information and answer association information, and regional location feature encoding; a subject adaptation layer is introduced into the pooling layer of the BERT model. The subject adaptation layer is used to call the association rules between the question area and the answer area in the corresponding subject when the BERT model processes different subject assignments; the attention weights are adjusted by configuring a regional location attention mask in the middle attention layer of the BERT model. The regional location attention mask is a binary mask, and the mask area includes a question association mask area and a handwriting association mask area.
[0091] Step S202: Fine-tune the BERT model based on the dynamic adaptation strategy;
[0092] Step S203: Input the question number information and association information of the image to be processed into the fine-tuned BERT model to obtain the semantic similarity score; at the same time, introduce the position decay factor to correct the similarity score according to the pixel distance between the question area and the handwriting area.
[0093] Step S204: Bind the answer area to the question area based on the similarity score and divide them into corresponding answer areas.
[0094] Furthermore, the steps for fine-tuning the BERT model based on the dynamic adaptation strategy include:
[0095] A mapping sample library of regional features and correlation strength is constructed. Each sample contains basic attributes, feature data, and correlation strength annotations. The basic attributes include subject labels, correlation type labels, and regional type combinations. The feature data includes text sequences of the question area and answer area, regional location coordinates, and mask area markings of regional location attention masks. The correlation strength annotations include manually annotated correlation degree labels and historical correlation accuracy of homework grading data of the same grade.
[0096] The learning rate of the BERT model is dynamically adjusted based on the difficulty level of samples in the sample library, which is divided according to the historical association accuracy. The learning rate is directly proportional to the difficulty level.
[0097] A weighted loss function for regional features is constructed by introducing regional location weight, regional type weight, and pseudo-association suppression weight. Among them, the regional location weight is assigned by calculating the vertical distance between the question area and the answer area based on the pixel-level regional location coordinates in the sample library; the regional type weight is assigned differently for different association types based on the combination of regional types and subject labels in the sample library; and the pseudo-association suppression weight is determined by judging the overlap area ratio between the answer area and the pseudo-association area based on the mask area marking of the regional location attention mask in the sample library.
[0098] The weighted loss function is substituted into the BERT model's optimizer, and backpropagation is used to update the BERT model's attention layer and pooling layer to achieve fine-tuning of the BERT model; the weighted loss function is expressed as: In the formula, Indicates the weight of the region's location. Indicates the weight of the region type. Indicates the weight for suppressing spurious associations; This represents the binary cross-entropy loss;
[0099] Furthermore, The binary cross-entropy loss is expressed as:
[0100]
[0101] Where N represents the total number of samples, and i represents the sample index; This represents the predicted correlation of the i-th sample group; This represents the true association label of the i-th sample group.
[0102] Please continue to refer to Figure 1 The digital grading method for paper-based work in this embodiment further includes the following steps:
[0103] Step S103: Based on the content characteristics of the target area, call the detection and recognition model that matches the content characteristics to obtain the recognition results of each answer area; for the fuzzy recognition results of the subjective writing area, introduce the writing style features of the current student information to correct the fuzzy recognition results, and update the recognition results of the subjective writing area based on the correction results; compare the final recognition results of each answer area with the homework answers to generate and output the grading results.
[0104] As can be seen, the embodiments of this application call the matching detection and recognition model according to the characteristics of the answer area content, and after correcting the fuzzy recognition result by combining the student's handwriting style characteristics, compare it with the homework answer to output the grading result, forming a fully automated process from image input to grading result output, without the need for manual intervention, and realizing effective automatic grading.
[0105] In one implementation, for the recognition of the title area, this embodiment uses an improved Tesseract OCR model to recognize the printed content. The improved Tesseract OCR model structure adds a residual convolutional layer and an attention mechanism layer between the Tesseract OCR feature extraction layer and the text recognition layer. The residual convolutional layer is used to enhance the extraction of printed text edge features; the attention mechanism layer is used to focus on text region features and suppress interference from the title area background. The connectionist temporal classification (CTC) loss function is used as the model optimization objective, and the Tesseract OCR model is iteratively trained based on the printed text recognition accuracy on the validation set to obtain the improved Tesseract OCR model. Adaptive binarization processing is performed on the title area image, and the binarization threshold is determined based on the mean grayscale value of the paper background color in the title area, converting the title area image into a black and white binary image. The binarized title area image is input into the improved Tesseract OCR model, outputting the initial printed text for recognition. Error correction is performed on the initial recognized text using a preset subject-specific dictionary to correct easily confused characters, finally outputting the recognized printed title text.
[0106] Furthermore, such as Figure 3 As shown, in step S103, the step of calling the matching detection and recognition model involves calling the text recognition model to recognize the text in the handwritten text area. The text recognition model is an end-to-end handwritten optical character recognition model trained based on a convolutional recurrent neural network combined with connection-time classification; it includes:
[0107] Feature extraction layer 301 extracts edge and texture features of handwritten text by embedding spatial attention modules between convolutional blocks and introducing residual skip connections.
[0108] The temporal feature learning layer 302 is configured with a temporal gating unit at the output of the bidirectional long short-term memory network Bi-LSTM and introduces a cross-layer attention mechanism to capture the temporal dependencies of text characters; wherein, the cross-layer attention mechanism enables the outputs of different layers of Bi-LSTM to interact with each other, thereby enhancing the contextual semantic constraints.
[0109] Decoding layer 303 dynamically adjusts the CTC whitespace filtering threshold and integrates a 3-gram language model to calculate the perplexity of candidate sequences obtained by greedy decoding of CTC, and selects the sequence with the lowest perplexity as the final output; wherein, the CTC whitespace filtering threshold is used to determine whether to remove whitespace characters in the prediction result during the decoding process, and the value is dynamically set according to the variance of the line height of the handwritten text.
[0110] When using a text recognition model to recognize handwritten text areas, a wavelet transform algorithm is used to filter out paper fiber texture noise in the handwritten text area image to obtain a denoised image. An adaptive binarization threshold is determined based on the gray-scale mean of the handwritten text area, and the denoised image is converted into a black and white binary image. The binarized handwritten text area image is then input into the trained text recognition model to output the text recognition result of the handwritten text area.
[0111] Furthermore, such as Figure 4 As shown, in step S103, the step of calling the matching detection and recognition model involves calling the formula recognition model in the handwritten formula area to output LaTeX format formulas. The formula recognition model is trained through iterative optimization of the basic network parameters based on the CROHME model system; it includes:
[0112] The structure extraction layer 401 is used to extract symbol features and hierarchical structure features of handwritten formulas by introducing a symbol contour enhancement unit and embedding a structure attention module in the convolution block; wherein, the symbol contour enhancement unit adopts an expanded convolution kernel to enhance the contour features of the formula symbols; the structure attention module generates a structure weight map based on preset formula hierarchical labels, increases the weight of formula hierarchical associated regions, and reduces the weight of isolated symbol regions.
[0113] The association learning layer 402 introduces a cross-level attention mechanism in the bidirectional gated recurrent unit and configures a symbolic dependency constraint unit to capture the association relationships and hierarchical dependencies between formula symbols. The cross-level attention mechanism enables high-level structural features and low-level symbolic features to interact with each other, calculate the hierarchical association degree, and strengthen the weight of highly associated features. The symbolic dependency constraint unit applies penalties to symbolic association relationships that do not conform to mathematical grammar rules.
[0114] LaTeX encoding generation layer 403 dynamically adjusts the encoding mapping rules and integrates a formula syntax rule library to perform syntax verification on the decoded candidate LaTeX sequences, selecting the sequence with the highest verification and matching degree as the final output; wherein, the symbol-LaTeX encoding mapping rules are dynamically adjusted according to the symbol confidence; the formula syntax rule library is constructed based on mathematical formula specifications and is used to perform syntax error correction on the candidate sequences.
[0115] When using the formula recognition model to recognize the handwritten formula area, the image of the handwritten formula area is denoised using the db4 wavelet basis function; through connected component analysis based on skeleton extraction, individual symbols and structural components in the formula are segmented, and effective symbol areas are selected; the preprocessed handwritten formula area image is input into the trained formula recognition model, and the output is a LaTeX format formula for subsequent formula correctness comparison.
[0116] Furthermore, in step S103, the step of calling the matching detection and recognition model involves calling an adaptive threshold segmentation and area proportion analysis model to identify the filling result for the filled area, wherein:
[0117] Obtain the Region of Interest (ROI) image of the multiple-choice filling area in the assignment image, convert the RGB color image to a single-channel grayscale image, and use a Gaussian kernel to filter the grayscale image to make the edge transition between the filling area and the background smooth.
[0118] For the preprocessed grayscale image, the global optimal threshold is calculated using the Otsu algorithm to initially distinguish the filled area from the background; the filled area ROI is evenly divided into multiple sub-blocks, and the Otsu algorithm is executed on each sub-block individually to obtain the local optimal threshold of the sub-block; the final segmentation threshold is calculated using the fusion coefficient.
[0119] The grayscale image is converted into a binary image using the final threshold. The filled dark areas are marked as foreground and the background areas are marked as 0. Connectivity detection and filtering are then performed on the binarized image.
[0120] The total area percentage of the filled region is calculated and the effectiveness of the filling is determined by combining it with an adaptive threshold. The adaptive threshold is determined based on the filling tool type, historical sample statistics, and filling characteristics of different tools. The area percentage R is expressed as:
[0121]
[0122] In the formula, This represents the sum of the areas of all valid connected components. This represents the total area of the filled ROI.
[0123] Furthermore, in step S103, the step of correcting the fuzzy recognition result of the subjective writing area by introducing the writing style features of the current student information to the fuzzy recognition result includes:
[0124] Collect historical image data of the subjective writing area in current students' historical paper assignments, and construct a student writing style feature database using the extracted temporal and spatial features;
[0125] Among them, in the temporal features, a 128-dimensional temporal feature vector is formed by sampling handwriting trajectory, extracting writing speed, continuous writing rhythm and pause interval;
[0126] Among them, in terms of spatial features, character spacing, tilt angle, and pen pressure distribution are extracted through image processing to form a 2048-dimensional spatial feature matrix;
[0127] For the content in the subjective writing area that is marked as a fuzzy recognition result, the real-time writing features of the current fuzzy area are extracted, the fusion similarity with the same type of features in the feature library is calculated, and a correction process is performed based on the fusion similarity result. In the correction process, a differentiated correction strategy is applied according to the fuzzy type and subject characteristics.
[0128] In some embodiments of this application, the step of applying a differentiated correction strategy based on the fuzzy type and subject characteristics includes:
[0129] For text ambiguity, historical writing samples of characters that students easily confuse are called from the feature library. Based on the spatial features of the current ambiguity character and the matching degree between the historical correct samples, the character is corrected according to historical habits.
[0130] For formula-type fuzzy symbols, the writing rhythm in the temporal features is combined with the matching degree between the writing speed curve of the current fuzzy symbol and the rhythm features of the correct symbols in the feature library, and the correction is made according to the rhythm features.
[0131] The semantic consistency before and after the correction is verified to check the corrected result.
[0132] In some embodiments of this application, the digital grading method for paper-based assignments further includes the following steps:
[0133] The suspected erroneous cases in the initial review results are pushed to the teacher's visual annotation tool, and the correct annotation results and area type correction information are received from the teacher and recorded as error correction cases;
[0134] The error correction cases are clustered into corresponding format families based on the similarity of format features. Incremental learning is performed only on the subject format feature sub-library and the matching detection and recognition model of the corresponding format family. The model parameters are fine-tuned through the backpropagation algorithm. Based on the recognition accuracy of the detection and recognition model for the family format assignments, the updated feature sub-library and model parameters are saved.
[0135] Please refer to Figure 5 According to another embodiment of this application, a marking device is provided for implementing the digital marking method for paper-based operations described in the above embodiments. The marking device includes the following modules:
[0136] The homework image processing module 501 is used to acquire the original image of the paper homework, preprocess the original image to obtain the homework image, and the homework image includes the question content, the answer content and the physical boundary information of the homework image;
[0137] The region recognition module 502 is used to perform adaptive partitioning of the homework image containing student information to obtain the question area and the answer area. Specifically, it calls a pre-built subject layout feature library, which contains the contour and size features of different subject elements. Combined with a physical boundary detection model based on edge detection, it identifies the binding line, page number, and paper edges of the homework image, generating a two-dimensional template of subject layout and physical boundary. It extracts the question number information of the question area and the association information of the answer area from the homework image, calculates the association degree between the answer area and the question area using a BERT-tuned semantic similarity model, and divides the corresponding answer areas according to the association degree. The answer area includes an objective filling area and a subjective writing area, and the subjective writing area includes a handwritten text area and a handwritten formula area.
[0138] The content recognition module 503 is used to call a detection and recognition model that matches the content characteristics of the target area to obtain the recognition results of each answer area; for the fuzzy recognition results of the subjective writing area, the writing style characteristics of the current student information are introduced to correct the fuzzy recognition results, and the recognition results of the subjective writing area are updated based on the correction results; the final recognition results of each answer area are compared with the homework answers to generate and output the grading results.
[0139] Another embodiment of this application provides an electronic device, including a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program executes the above-described digitization batching method for paper-based work during runtime.
[0140] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0142] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0143] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0144] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for digitizing the review of paper-based work product, the method comprising: Includes the following steps: Step S101: Obtain the original image of the paper assignment, preprocess the original image to obtain the assignment image, the assignment image containing the question content, answer content and physical boundary information; Step S102: Perform layout adaptive partitioning on the homework image containing student information to obtain the question area and the answer area. This involves calling a pre-built subject layout feature library, which contains the contour and size features of different subject elements. A physical boundary detection model based on edge detection is used to identify the binding line, page numbers, and paper edges of the homework image, generating a two-dimensional template of subject layout and physical boundary. The question number information in the question area and the association information in the answer area are extracted from the homework image. The association degree between the answer area and the question area is calculated using a BERT-tuned semantic similarity model. Corresponding answer areas are then partitioned according to the association degree. In the input layer of the BERT model, the input data includes a concatenated sequence of question number information and answer area association information, as well as regional location feature encoding. A subject adaptation layer is introduced into the pooling layer of the BERT model. This subject adaptation layer is used to... When processing assignments across different subjects, the T-model invokes the association patterns between the question area and the answer area for the corresponding subject. It adjusts the attention weights by configuring a region-positional attention mask in the mid-level attention layer of the BERT model. This region-positional attention mask is a binary mask, and the mask area includes a question association mask area and a handwriting association mask area. The BERT model is fine-tuned based on a dynamic adaptation strategy. The question number information and association information of the assignment image to be processed are input into the fine-tuned BERT model to obtain a semantic similarity score. Simultaneously, a positional decay factor is introduced to correct the similarity score based on the pixel distance between the question area and the handwriting area. Based on the similarity score, the answer area is bound to the question area and divided into corresponding answer areas. The answer area includes an objective filling area and a subjective writing area, and the subjective writing area includes a handwritten text area and a handwritten formula area. Step S103: Based on the content characteristics of the target area, call the detection and recognition model that matches the content characteristics to obtain the recognition results of each answer area; for the fuzzy recognition results of the subjective writing area, introduce the writing style features of the current student information to correct the fuzzy recognition results, and update the recognition results of the subjective writing area based on the correction results; compare the final recognition results of each answer area with the homework answers to generate and output the grading results.
2. The method for digital review of paper-based work according to claim 1, characterized in that, In step S102, the step of combining the physical boundary detection model based on edge detection to identify the binding line, page number, and paper edge of the assignment image, and generating a two-dimensional template of subject layout and physical boundary, includes: The image of the work is preprocessed with physical boundary detection. The preprocessed boundary detection image is then input into the Canny operator to extract linear edges and filter out candidate areas for binding lines. For the grayscale mean around the candidate area of the binding line, the shadow compensation module is called to compensate the grayscale value of the shadow area, and finally the binding line position is determined. Connectivity analysis is performed on the boundary detection preprocessed image to select connected components as page number candidate regions; a lightweight character recognition model is used to recognize characters in the page number candidate regions to determine the page number regions; The outer contour of the preprocessed image is extracted using a contour detection algorithm. The gray-scale mean value of the region within the contour is calculated. Background regions outside the contour whose gray-scale values exceed the threshold are removed based on the gray-scale threshold to determine the paper edge range. Using a pre-built subject layout feature library, extract the subject layout features corresponding to the current assignment; map the binding line position, page number area, and paper edge range to the coordinate system of the subject layout, remove invalid areas in the subject layout that exceed the paper edge, cover the binding line, or page number, and generate a two-dimensional template containing physical boundaries and subject layout.
3. The method for digitizing review of paper-based work according to claim 1, wherein, The steps for fine-tuning the BERT model based on a dynamic adaptation strategy include: A mapping sample library of regional features and correlation strength is constructed. Each sample contains basic attributes, feature data, and correlation strength annotations. The basic attributes include subject labels, correlation type labels, and regional type combinations. The feature data includes text sequences of the question area and answer area, regional location coordinates, and mask area markings of regional location attention masks. The correlation strength annotations include manually annotated correlation degree labels and historical correlation accuracy of homework grading data of the same grade. The learning rate of the BERT model is dynamically adjusted based on the difficulty level of samples in the sample library, which is divided according to the historical association accuracy. The learning rate is directly proportional to the difficulty level. A weighted loss function for regional features is constructed by introducing regional location weight, regional type weight, and pseudo-association suppression weight. Among them, the regional location weight is assigned by calculating the vertical distance between the question area and the answer area based on the pixel-level regional location coordinates in the sample library; the regional type weight is assigned differently for different association types based on the combination of regional types and subject labels in the sample library; and the pseudo-association suppression weight is determined by judging the overlap area ratio between the answer area and the pseudo-association area based on the mask area marking of the regional location attention mask in the sample library. The weighted loss function is substituted into an optimizer of the BERT model, and attention layers and pooling layers of the BERT model are updated by back propagation, so as to realize fine tuning of the BERT model; wherein the weighted loss function is represented as: , wherein, represents a region position weight, represents a region type weight, represents a pseudo association inhibition weight; and represents a binary cross entropy loss.
4. The method for digital review of paper-based work according to claim 3, wherein, In step S103, the step of calling the matching detection and recognition model involves calling the text recognition model to recognize the text in the handwritten text area. The text recognition model is an end-to-end handwritten optical character recognition model trained based on a convolutional recurrent neural network combined with connection-time classification. include: The feature extraction layer extracts edge and texture features of handwritten text by embedding spatial attention modules between convolutional blocks and introducing residual skip connections. The temporal feature learning layer is configured with temporal gating units at the output of the bidirectional long short-term memory network Bi-LSTM and introduces a cross-layer attention mechanism to capture the temporal dependencies of text characters. The cross-layer attention mechanism enables attention interaction between the outputs of different layers of Bi-LSTM, thereby enhancing the contextual semantic constraints. The decoding layer dynamically adjusts the CTC whitespace filtering threshold and integrates a 3-gram language model to calculate the perplexity of the candidate sequences obtained by greedy decoding of CTC, and selects the sequence with the lowest perplexity as the final output. The CTC whitespace filtering threshold is used to determine whether to remove whitespace characters in the prediction result during the decoding process, and its value is dynamically set according to the variance of the line height of the handwritten text.
5. The method for digital review of paper-based work according to claim 4, characterized in that, In step S103, the step of calling the matching detection and recognition model involves calling the formula recognition model in the handwritten formula area to output the LaTeX format formula. The formula recognition model is trained by iterative optimization based on the basic network parameters of the CROHME model system. include: The structure extraction layer is used to extract symbol features and hierarchical structure features of handwritten formulas by introducing symbol contour enhancement units and embedding a structure attention module in the convolutional block; wherein, the symbol contour enhancement unit adopts an expanded convolutional kernel to enhance the contour features of the formula symbols; the structure attention module generates a structure weight map based on preset formula hierarchical labels, increases the weight of formula hierarchical associated regions, and reduces the weight of isolated symbol regions. The association learning layer introduces a cross-level attention mechanism in the bidirectional gated recurrent unit and configures a symbolic dependency constraint unit to capture the association and hierarchical dependency between formula symbols. The cross-level attention mechanism enables high-level structural features and low-level symbolic features to interact with each other, calculate the hierarchical association degree, and strengthen the weight of highly associated features. The symbolic dependency constraint unit is based on mathematical grammar rules and imposes penalties on symbolic associations that do not conform to the rules. The LaTeX encoding generation layer dynamically adjusts the encoding mapping rules and integrates a formula syntax rule library to perform syntax verification on the decoded candidate LaTeX sequences, selecting the sequence with the highest verification and matching degree as the final output. The symbol-LaTeX encoding mapping rules are dynamically adjusted according to the symbol confidence. The formula syntax rule library is constructed based on mathematical formula specifications and is used to perform syntax error correction on the candidate sequences.
6. The method for digital review of paper-based work according to claim 5, wherein, In step S103, the step of calling the matching detection and recognition model involves calling an adaptive threshold segmentation and area proportion analysis model to identify the filling result for the filled area, wherein: Obtain the Region of Interest (ROI) image of the multiple-choice filling area in the assignment image, convert the RGB color image to a single-channel grayscale image, and use a Gaussian kernel to filter the grayscale image to make the edge transition between the filling area and the background smooth. For the preprocessed grayscale image, the global optimal threshold is calculated using the Otsu algorithm to initially distinguish the filled area from the background; the filled area ROI is evenly divided into multiple sub-blocks, and the Otsu algorithm is executed on each sub-block individually to obtain the local optimal threshold of the sub-block; the final segmentation threshold is calculated using the fusion coefficient. The grayscale image is converted into a binary image using the final threshold. The filled dark areas are marked as foreground and the background areas are marked as 0. Connectivity detection and filtering are then performed on the binarized image. The total area percentage of the filled region is calculated and the effectiveness of the filling is determined by combining it with an adaptive threshold. The adaptive threshold is determined based on the filling tool type, historical sample statistics, and filling characteristics of different tools. The area percentage R is expressed as: ; In the formula, denotes the sum of the areas of all valid connected regions, denotes the total area of the filled region ROI.
7. The method for digital review of paper-based work according to claim 6, characterized in that, In step S103, the step of correcting the fuzzy recognition result of the subjective writing area by introducing the writing style features of the current student information to correct the fuzzy recognition result includes: Historical image data of the subjective writing area in current students' historical paper assignments were collected, and a student writing style feature database was constructed using the extracted temporal and spatial features. Among them, in the temporal features, a 128-dimensional temporal feature vector was formed by sampling handwriting trajectory, extracting writing speed, continuous writing rhythm and pause interval; in the spatial features, character spacing, tilt angle and pen pressure distribution were extracted through image processing to form a 2048-dimensional spatial feature matrix. For the content in the subjective writing area that is marked as a fuzzy recognition result, the real-time writing features of the current fuzzy area are extracted, the fusion similarity with the same type of features in the feature library is calculated, and a correction process is performed based on the fusion similarity result. In the correction process, a differentiated correction strategy is applied according to the fuzzy type and subject characteristics.
8. The digital marking method for paper-based work according to claim 7, characterized in that, The steps for applying differentiated correction strategies based on fuzzy type and subject characteristics include: For text ambiguity, historical writing samples of characters that students easily confuse are called from the feature library. Based on the spatial features of the current ambiguity character and the matching degree between the historical correct samples, the character is corrected according to historical habits. For formula-type fuzzy symbols, the writing rhythm in the temporal features is combined with the matching degree between the writing speed curve of the current fuzzy symbol and the rhythm features of the correct symbols in the feature library, and the correction is made according to the rhythm features. The semantic consistency before and after the correction is verified to check the corrected result.
9. A marking apparatus for implementing the digital marking method for paper-based work as described in any one of claims 1 to 8, characterized in that, Includes the following modules: The homework image processing module is used to acquire the original image of the paper homework, preprocess the original image to obtain the homework image, and the homework image includes the question content, the answer content and the physical boundary information. The region recognition module performs layout-adaptive partitioning on assignment images containing student information, resulting in question and answer areas. It utilizes a pre-built subject-specific layout feature library containing contour and size features of different subject elements. This library, combined with an edge-detection-based physical boundary detection model, identifies binding lines, page numbers, and paper edges in the assignment image, generating a two-dimensional template of subject layout and physical boundaries. The module extracts the association information between the question number area and the answer area in the assignment image. A BERT-tuned semantic similarity model is used to calculate the association degree between the question and answer areas, dividing the corresponding answer areas according to the association degree. In the input layer of the BERT model, the input data includes a concatenated sequence of question number information and answer area association information, along with region location feature encoding. A subject adaptation layer is introduced into the pooling layer of the BERT model. This subject adaptation layer is used to perform layout-adaptive partitioning on the assignment image. When processing assignments across different subjects, the RT model invokes the association patterns between the question area and the answer area for the corresponding subject. It adjusts the attention weights by configuring a region-positional attention mask in the mid-level attention layer of the BERT model. This region-positional attention mask is a binary mask, and the mask area includes a question association mask area and a handwriting association mask area. The BERT model is fine-tuned based on a dynamic adaptation strategy. The question number information and association information of the assignment image to be processed are input into the fine-tuned BERT model to obtain a semantic similarity score. Simultaneously, a positional decay factor is introduced to correct the similarity score based on the pixel distance between the question area and the handwriting area. Based on the similarity score, the answer area is bound to the question area and divided into corresponding answer areas. The answer area includes an objective filling area and a subjective writing area, and the subjective writing area includes a handwritten text area and a handwritten formula area. The content recognition module is used to call a detection and recognition model that matches the content characteristics of the target area to obtain the recognition results of each answer area; for the fuzzy recognition results of the subjective writing area, the writing style characteristics of the current student information are introduced to correct the fuzzy recognition results, and the recognition results of the subjective writing area are updated based on the correction results; the final recognition results of each answer area are compared with the homework answers to generate and output the grading results.
Citation Information
Patent Citations
Handwritten question number-based objective question marking method, apparatus and device, and storage medium
CN113159014A
Page question number identification and segmentation algorithm for paper writing homework or test paper
CN115661826A