AI-based homework correction mark leaving method and system

Through the OCR model based on the cross attention mechanism and the improved discrete laying hen algorithm, the identification accuracy and interpretability of the OCR model in complex scenarios is solved, efficient homework correction and teaching adaptability are achieved, and the identification accuracy and interpretability of the model are improved.

CN120496099APending Publication Date: 2025-08-15SHANGHAI KEXINHUA TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510710747.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing OCR model has low recognition accuracy in dealing with complex scenarios, lacks contextual correlation mechanism, and is difficult to generate training tags close to real teaching scenarios. Traditional metaheuristic algorithms have problems with local optimization and slow convergence speed.

Method used

Using an OCR model based on the cross attention mechanism, combining fine-grained substring encoding with multi-head cross attention matching, an improved discrete laying hen algorithm and context perception technology are introduced, and the recognition accuracy and interpretability are improved by reconstructing text recognition, error attribution and feedback generation.

Benefits of technology

It significantly improves the identification accuracy, interpretability and teaching adaptability of homework correction, improves the global search ability and convergence speed of the model, and enhances the expression ability of the training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120496099A_ABST
    Figure CN120496099A_ABST
Patent Text Reader

Abstract

The invention provides a homework correction mark leaving method based on AI. The method is applied to the technical field of teaching and artificial intelligence, and comprises the following steps: S1, obtaining an original input image of a paper job; s2, adopting an OCR model based on a cross attention mechanism to perform accurate text recognition and structured cleaning and preprocessing of text data on the writing content in the original input image to obtain high-dimensional text features; s3, constructing an answer judgment and error recognition model, introducing an improved discrete laying hen algorithm to perform feature selection and model training, and outputting an error classification result; s4, generating a simulation correction trace and a traceable scoring log according to the error classification result and the original homework image; and S5, mapping the error type with a standard knowledge structure in the knowledge point library to generate a customized lecture. According to the invention, the accuracy, interpretability and teaching suitability of homework correction are obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of teaching and artificial intelligence technology, and in particular to an AI-based homework grading and trace-keeping method and system. Background Art

[0002] With the development of artificial intelligence technology, particularly in the field of optical character recognition (OCR), an increasing number of teaching scenarios are beginning to utilize OCR models to implement automatic homework grading and intelligent tracking. However, the recognition accuracy of existing OCR models in complex scenarios still needs to be improved. This is especially true when dealing with handwritten, altered, or structurally complex homework content, where traditional OCR models are prone to recognition errors or matching failures. Traditional OCR models lack contextual association mechanisms, presenting limitations in complex homework scenarios. Furthermore, existing models generally lack good interpretability, making it difficult to accurately determine the basis for the model's decisions when processing specific substrings.

[0003] On the other hand, generating training labels that are more realistic for real-world teaching scenarios and incorporating contextual information into the model learning process have become key issues in the current development of AI education systems. Furthermore, traditional metaheuristic algorithms currently suffer from limitations in feature optimization and global search capabilities, such as local optimality and slow convergence. New optimization strategies are urgently needed to improve overall performance.

[0004] Therefore, there is an urgent need to build a homework grading and traceability method that can improve recognition accuracy and enhance the system's interpretability and practical application capabilities. Summary of the Invention

[0005] In order to overcome the shortcomings of the existing technology, the present invention proposes an AI-based homework grading traceability method and system, and specifically proposes an OCR model that combines fine-grained code matching, attention visualization, intelligent optimization algorithm and context-aware technology. By reconstructing the entire process of text recognition, error attribution and feedback generation, the accuracy, interpretability and teaching adaptability of homework grading are significantly improved, and the problems existing in the existing automatic homework grading system in terms of recognition accuracy, label generation authenticity, model interpretability and optimization efficiency are solved.

[0006] To achieve the above objectives, the following technical solutions are adopted: In a first aspect, the present invention provides an AI-based homework grading and trace-keeping method, comprising the following steps: Step S1: Scan the paper work using a high-precision image acquisition device to obtain the original input image; Step S2: Using an OCR model based on a cross-attention mechanism to accurately recognize the written content in the original input image to obtain text data, and performing structured cleaning and preprocessing on the text data to obtain high-dimensional text features; Step S3: constructing an answer judgment and error recognition model, introducing an improved discrete laying hen algorithm for feature selection and model training, performing semantic understanding, automatic scoring and error analysis on the high-dimensional text features, and outputting error classification results; Step S4: generating simulated correction traces and a traceable scoring log based on the error classification results and the original homework image; Step S5: By performing a horizontal cluster analysis on the answers of all students in the class, the frequently occurring error types are extracted, and the error types are mapped to the standard knowledge structure in the knowledge point library, matched with the corresponding teaching content, and customized handouts are generated.

[0007] Furthermore, the step S2, wherein the OCR model based on the cross-attention mechanism is used to accurately recognize the written content in the work image to obtain text data, includes: Performing region detection on the original input image to generate target substring features, and performing feature extraction to obtain a global or local embedded feature representation of the image; Mapping the target substring features obtained by the original input image recognition into a continuous embedding vector through a substring encoder, and feeding the target substring features and the embedding vector into a multi-head cross attention module to capture the correlation between the target substring features and the image context, and adding the output of the multi-head cross attention module to the original target substring features through a residual connection to obtain a contextual representation of the substring; The substring matcher uses the context representation as a query vector to perform cross-attention matching with the image embedding features, predicts the preceding and following characters corresponding to the substring, and optimizes the OCR model through cross-entropy loss; A variable importance scoring method based on the attention mechanism quantifies the impact of input features on the final recognition results.

[0008] Furthermore, the OCR model is optimized by using a cross entropy loss, including: optimizing the OCR model by comparing the difference between the predicted next and previous characters and the label, and calculating the cross entropy loss, including: For each training sample, the cross entropy loss between the predicted next character and the previous character is calculated simultaneously, and the invalid positions labeled [P] are ignored through the mask mechanism; The total loss L is the mean loss of all valid samples, and the normalization factor is the total number of valid samples after excluding the [P] label; The cross entropy loss ce(ỹ, y) is defined as: when the true label y≠[P], the negative log-likelihood loss is calculated ,in, is the true label value of the c-th category; is the predicted probability value of the cth class; when y=[P], the loss value is 0; The total loss function drives the model to learn the contextual relevance of character sequences by jointly optimizing the previous and next character prediction tasks.

[0009] Furthermore, the variable importance scoring method based on the attention mechanism quantifies the impact of input features on the final recognition results, including: An interpretability unit is constructed to generate variable importance scores and visualize feature influence areas using an attention matrix. The interpretability unit satisfies the following requirements: directly deriving the importance of input features through attention scores satisfies the universality assumption; a statically stable attention distribution is used instead of a dynamic gradient score; and importance calculation is insensitive to the type of activation function.

[0010] Furthermore, the improved discrete laying hen algorithm is introduced to perform feature selection and model training, including: An improved discrete laying hen algorithm was used for feature selection, including initial population construction, local development, global exploration, and fitness evaluation, to screen for highly discriminative features. Input parameters included: the original feature space: high-dimensional text features, including word frequency, syntactic features, and semantic vectors; training data: student answer texts containing handwritten OCR recognition results and standard answer labels; The natural language answers given by students are dynamically processed with OOV vocabulary through a context-aware word segmenter to generate real labels, combining character-level encoding with open vocabulary processing mechanism.

[0011] Furthermore, the improved discrete laying hen algorithm comprises: Construct an initial population and generate candidate solutions through the minimum redundancy maximum correlation, ReliefF algorithm and correlation-based feature selection algorithm; In the local development phase, a sliding window mechanism is used to select G fragments from the starting position of the solution vector, and the values of α feature bits are randomly changed in each fragment; In the global exploration phase, the last G feature bits of the current optimal solution are disturbed and randomly reversed. The value of the feature bit is used to expand the search space; The termination condition is that the difference in accuracy of the optimal solution of two consecutive iterations is less than the threshold ε, and the fitness evaluation uses support vector machine combined with five-fold cross validation.

[0012] Furthermore, the context-aware word segmenter includes: When encoding at the character level, assign special tokens to unregistered words <ooc>, and dynamically update the character-token mapping dictionary D; The decoding stage will <ooc>The token is replaced with a placeholder *, and the display style of the placeholder is consistent with the original text font; The output tag sequence of the word segmenter and the feature subset screened by the improved discrete laying hen algorithm are jointly input into the classification model for error type attribution.

[0013] Furthermore, in step S4, generating simulation correction traces includes: Marking rules: Grammatical errors, vocabulary misuse, and logical problems are marked with red visual markers, including strikethroughs, circles, or highlights. Improvement suggestions are marked with blue annotations, including word replacements, sentence optimization, and logical connection tips. Content that requires emphasis is marked with wavy lines or underlines, and linked to the knowledge point database to generate explanatory text. The rendering effect of the correction traces is dynamically adjusted according to the terminal type, including vector graphics for PDF, CSS styles for web pages, and adaptive layout for mobile terminals; the annotation position is bound to the coordinates of the original text, supporting scaling and cross-platform display consistency; The input is the error type, location coordinates, and modification suggestion text; the output is a text image or structured data that integrates multiple types of annotations, including the annotation type, coordinate range, and associated suggestion content.

[0014] Furthermore, the method further comprises: Step S6: Conduct personalized learning analysis based on student answer data and AI grading results, generate student ability profiles, and provide personalized homework suggestions.

[0015] In a second aspect, the present invention further provides an AI-based homework grading and traceability system, comprising: Image acquisition equipment, used to scan paper work and obtain original input images; An image recognition module is used to accurately recognize the written content in the original input image using an OCR model based on a cross-attention mechanism to obtain text data, and to perform structured cleaning and preprocessing on the text data to obtain high-dimensional text features; The answer judgment module is used to build an answer judgment and error recognition model, introduce an improved discrete laying hen algorithm for feature selection and model training, perform semantic understanding, automatic scoring and error analysis on the high-dimensional text features, and output error classification results; A trace generation module is used to generate simulated correction traces and a traceable scoring log based on the error classification results and the original homework image; The handout generation module is used to perform horizontal cluster analysis on the answers of all students in the class, extract the frequently occurring error types, map the error types with the standard knowledge structure in the knowledge point library, match the corresponding teaching content, and generate customized handouts.

[0016] Compared with the prior art, the present invention achieves the following beneficial effects: 1. This paper constructs an OCR model with a substring encoder and substring matcher, introducing a fine-grained substring representation and matching mechanism, effectively improving the model's recognition accuracy and stability when processing complex tasks. By combining fine-grained substring encoding with multi-head cross-attention matching, it overcomes the lack of contextual association mechanisms in existing OCR models in complex tasks and solves the problem of handwritten misrecognition.

[0017] 2. The variable importance scoring method based on the attention mechanism of the present invention enables the OCR model to dynamically focus on different feature dimensions during the recognition process and visually display the impact of each input feature on the output result, thereby enhancing the interpretability and trustworthiness of the model.

[0018] 3. Based on the improved discrete laying hen algorithm, the present invention introduces an adaptive step size adjustment mechanism and an elite retention strategy, which improves the global search capability and convergence speed of the optimization process and further optimizes the hyperparameters and structural design of the model.

[0019] 4. The present invention uses a context-aware word segmenter to introduce contextual semantic information during the training process to assist in generating real labels, thereby enhancing the expressiveness of training data and effectively alleviating the impact of inaccurate labels on model performance.

[0020] In summary, this invention has achieved significant breakthroughs in recognition accuracy, model interpretability, optimization efficiency, teaching adaptability and personalized learning support through technological innovation, providing a smarter and more reliable solution for AI education scenarios.

[0021] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are provided for a better understanding of the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which: Figure 1 A schematic diagram showing a flow chart of an AI-based homework grading and trace-keeping method according to a first embodiment of the present invention is shown; Figure 2 A schematic diagram showing a flow chart of an AI-based homework grading and trace-keeping method according to a second embodiment of the present invention is shown; Figure 3 A module diagram of an AI-based homework grading and trace-keeping system according to a third embodiment of the present invention is shown. DETAILED DESCRIPTION

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0024] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0025] Example 1: Figure 1 The figure shows a flow chart of an AI-based homework marking method according to the first embodiment of the present invention. Figure 1 As shown, an AI-based homework grading and leaving trace method 100 includes the following steps: Step S1: Scan the paper work using a high-precision image acquisition device to obtain the original input image; In step S1, a paper assignment or test paper is scanned by a high-precision image acquisition device (such as a scanner or a high-definition camera) to obtain a clear image input, which is a high-definition, structured image file. The high-precision image acquisition device uses, for example, a 40-megapixel CMOS sensor with an optical resolution ≥300DPI and supports parallel image acquisition of three RGB channels. The image collection supports mixed layout of multiple question types (including multiple-choice questions, fill-in-the-blank questions, essay questions, etc.) and multi-disciplinary content, and can cover the automatic recognition requirements of subjective and objective questions. The assignment is photographed using a high-precision image acquisition device to ensure that the photograph is clear and all handwritten or printed content can be clearly seen, including questions and answers of different subjects and question types.

[0026] Step S2: Using an OCR model based on a cross-attention mechanism to accurately recognize the written content in the original input image to obtain text data, and performing structured cleaning and preprocessing on the text data to obtain high-dimensional text features; In step S2, an OCR model based on a cross-attention mechanism accurately recognizes the written content in the image. Joint image-text parsing restores the logical structure and layout of the question number, question stem, options, and answer area. The final recognized text content (e.g., question, student answer) and its logical structure (question number, question stem, answer area, etc.) are then analyzed. To avoid recognition errors caused by variations in student handwriting (such as cursive writing and italicized writing), the model incorporates multiple handwriting font styles to ensure high recognition accuracy across different font styles, thus ensuring consistent input for the subsequent grading module. This is similar to the "photo-to-read" feature on mobile phones, but even more powerful. The system understands the text in the image, whether it's neatly printed or sloppily handwritten, and can even distinguish the positional relationship between the question and the answer. For example, it can recognize a structure like "The answer to question 3 is written in the right margin."

[0027] Specifically, to achieve high-precision recognition of handwritten or printed text, the present invention adopts an OCR modeling method based on a cross-attention mechanism. By constructing a substring encoder and a substring matcher, and a multi-head attention mechanism, character-level text recognition can be achieved. Specifically, a 12-head cross-attention mechanism OCR model can be used, with each head dimension of 64, equipped with a residual connection module, the cross-attention mechanism uses LayerNorm normalization processing, and the feedforward network hidden layer dimension is 2048. Specifically, the following steps are included: S2.1: Constructing a substring encoder Perform region detection on the original input image to generate target substring features , and perform feature extraction to obtain the local embedded feature representation of the image For example, local details (such as character strokes and traces of erasure) can be extracted through multi-scale convolution or region of interest network (RoI Align).

[0028] The target substring features obtained by the substring encoder are obtained by recognizing the original input image Mapped to a continuous embedding vector , and the target substring feature and embedding vector Send it to the multi-head cross attention module to capture the target substring features The output of the multi-head cross attention module is connected to the original target substring feature through residual connection to determine the relevance of the image context. Add to get the context representation of the substring The specific expressions are as follows: First, the target substring features identified in the original input image Mapped to a continuous embedding vector , and then fed into the multi-head cross attention module together with its context information. Contextual representation of substring It can be defined by the following formula:

[0029] : Contextual representation of substrings, integrating multi-head attention information and original substring features ; : The representation of the target substring identified in the input image, used as the query vector (Query) in the attention mechanism; : The local image embedding vector representation in the substring encoder is used as the key and value in the attention mechanism to capture the contextual relevance of the substring; MultiHead : represents the multi-head attention mechanism, which is used to capture the correlation in different semantic spaces. It accepts the query Q, key K and value V, and concatenates the outputs of multiple attention heads. Its specific form is:

[0030] Among them, Q is the query matrix, which represents the current substring (such as ); K is the key matrix, which usually shares the same source as the value matrix (such as ); V is the value matrix, providing the final weighted summary information; : Concatenate the outputs of each attention head to form the final multi-head attention output; is the output of the i-th attention head, representing the attention representation in this subspace, and is calculated as:

[0031] Each attention head has independent 、 、 ;in, : The trainable weight matrix used by the i-th attention head to map Q to the subspace; : The trainable weight matrix used by the i-th attention head to map K to the subspace; : Softmax function, used to normalize the attention score to satisfy the probability distribution; : The dimension of each attention head (i.e., the feature dimension of the attention subspace), which is used to scale the attention score and alleviate gradient explosion; : Index variable, representing the substring target task, n is the next character to be predicted, and p is the previous character to be predicted. HW is the total spatial dimension (height × width) of the image feature map, indicating the spatial range of the attention output.

[0032] In step S2.1, a substring encoder is constructed to break text into smaller "substrings" (such as words or phrases) and understand their meaning based on context. For example, the meaning of "apple" in "red apple" and "Apple phone" is different, and the encoder adjusts its understanding based on the context.

[0033] S2.2: Building a substring matcher Substring matchers are used to represent context As query vector and image embedding features Perform cross-attention matching to predict the preceding and following characters of the substring, and optimize the OCR model through cross-entropy loss; the variable importance scoring method based on the attention mechanism quantifies the impact of input features on the final recognition result. Specifically, the context of the substring is represented As the query vector, and the image embedding representation The key-value pairs are cross-attention matched to predict the next or previous character corresponding to the current substring. The formula is: Matcher in, : Image embedding representation is a global or local visual feature extracted from the OCR image. It is a global feature of the entire homework image or a feature of other substring regions. It participates in the attention mechanism as both a key and a value, and is used to match the image region related to the current substring. The OCR image is an image that has undergone basic preprocessing (such as denoising and correction) after the original image is collected by high-precision equipment. It is used as the direct input of the OCR model, rather than intermediate data that has undergone text structured processing. This ensures that the model can not only utilize high-quality visual information, but also cope with complex scenarios through attention mechanisms and adaptive optimization, ultimately achieving high-precision and robust homework grading functions. Matcher : Matcher module, used to represent substrings according to their context and image embedding representation The cross attention calculation result between them predicts the previous and next characters of the substring, which is a high-level encapsulated matching function. : Multi-head attention mechanism, receiving 、 、 As input, different attention distributions are calculated in parallel through multiple attention heads, thereby improving the model's ability to model the complex associations between substrings and image features. Serving as both a key and a value, it enables the model to dynamically select key areas in the image based on the current substring, thereby achieving more accurate character-level recognition and significantly improving OCR performance in complex scenarios (such as handwriting, erasures, and mixed question types).

[0034] By comparing the difference between the predicted next and previous characters and the label, the cross entropy loss is calculated to optimize the OCR model. The formula is:

[0035] : The total loss function is used to measure the prediction error of the model for all training samples as the optimization target; : The number of samples participating in the effective loss calculation (excluding the positions ignored by the label [P]), used to normalize the loss; N: The total number of training samples; : The probability distribution of the next character predicted by the model for the j-th sample (logits before Softmax output); : The probability distribution of the previous character predicted by the model for the j-th sample (logits before Softmax output); : The true label of the next character in the j-th sample, in the form of one-hot encoding or category index; : The true label of the previous character in the j-th sample; : Softmax function, which converts logits into probability distribution so that the sum of the probabilities of each category is 1; : Masked cross entropy loss function, used to measure the difference between the predicted distribution and the true distribution. The mask condition is: if Y≠[P], the loss is calculated. If the label is , then the position does not participate in the loss calculation, ensuring that invalid positions do not participate in optimization. Its specific definition is:

[0036] : The total number of character categories, that is, the total number of all possible characters in the prediction task; : The true label value of the cth class (usually 0 or 1 in one-hot encoding); : The predicted probability value of the cth class, that is, the output after Softmax; [P]: A placeholder label used to mark the situation where no loss needs to be calculated in certain positions (such as blank characters, padding characters, or non-valid characters).

[0037] In substep S2.2, we construct a substring matcher to "guess the preceding and following characters" to verify the correctness of the recognition. For example, after recognizing "Today's weather is very __," the matcher will predict the next character as "good" or "hot" and compare it with the actual answer to ensure accurate recognition.

[0038] S2.3: Improve the interpretability of OCR models To improve the interpretability of the system, a variable importance scoring method based on the attention mechanism is proposed to quantify the influence degree of input features (such as character positions, image regions) on the final recognition result. This step S2.3 includes: constructing an interpretability unit, generating variable importance scores using the attention matrix and visualizing the feature influence regions; the interpretability unit satisfies: the importance of input features can be directly derived through attention scores to meet the generality assumption; using a static and stable attention distribution to replace the dynamic gradient scoring; the importance calculation is insensitive to the type of activation function. That is, the constructed interpretability unit has the following three properties: Property 1 (generality assumption): The variable importance can be directly derived from the scores in the attention matrix, reflecting the influence degree of each input on the output of the OCR model; Property 2 (static stability): Compared with the dynamic gradient scoring during the training process of the OCR model, the variable importance scores generated by the attention mechanism are more stable and do not fluctuate with iterations; Property 3 (activation function insensitivity): The calculation of variable importance mainly depends on the attention distribution, is not significantly interfered by the form of the activation function or its parameters, and has good generalization ability.

[0039] Through the enhanced interpretability of this step S2.3, the system will "mark" which parts have the greatest impact on the recognition result. For example, when recognizing the character "晴", the parts of "日" and "青" in the image will be highlighted, indicating that these two strokes are the key to the judgment, so that teachers and students can know how the system "thinks".

[0040] S2.4: Text data preprocessing To improve the subsequent step S3's ability to understand and classify text, it is necessary to perform structured cleaning and preprocessing on the previously recognized text data. The preprocessing process includes the following steps: Character unification processing: Convert all characters to lowercase uniformly to reduce the interference of synonymous expressions on model training; Word segmentation and stemming: Use language processing tools (such as SpaCy or NLTK) for language word segmentation and perform stemming processing; Stop word and special character removal: Remove stop words, punctuation marks, special symbols, and pure numbers that do not affect semantics; Space and format standardization: Remove redundant spaces and non-standard interval characters to make the text corpus format standard and unified; Data annotation: Use the method of named entity recognition for sequence annotation. Without a prior term dictionary, use the BIO coding scheme to label each word token in the text as B (beginning of a term), I (inside a term), or O (non-term part).

[0041] This process provides rich structural information for step S3, which helps to extract key information in subsequent matching or scoring tasks.

[0042] Step S2.4, text data preprocessing, processes the recognized raw text (which may contain typos, poor formatting, and other issues) into cleaned, structured text (with standardized formatting, invalid characters removed, and key terms annotated). Much like sorting through a pile of toys, the text is cleaned of "stuff" (such as extra spaces and meaningless symbols), capitalized (e.g., "Hello" and "hello" become "hello"), and key terms (such as "photosynthesis") are marked to facilitate subsequent analysis.

[0043] Step S3: constructing an answer judgment and error recognition model, introducing an improved discrete laying hen algorithm for feature selection and model training, performing semantic understanding, automatic scoring and error analysis on the high-dimensional text features, and outputting error classification results; In step S3, an answer judgment and error recognition model is constructed to semantically understand, automatically score, and analyze errors in student responses. To improve the accuracy and generalization of text classification, an improved discrete layer algorithm is introduced for feature selection and model training, combined with a context-aware word segmenter to improve the accuracy of modeling natural language answers.

[0044] S3.1: Constructing an improved discrete laying hen algorithm Discrete laying chicken algorithm (Laying chicken algorithm), for example, Hosseini, E. (2017). Laying chicken algorithm: a new meta-heuristic approach to solve continuous programming problems. Journal of Computational and Applied Mathematics, 6(1), 344–351. The proposed laying chicken algorithm mainly consists of three parts: hens (Hen), roosters (Rooster) and eggs (Egg). Hens represent feasible solutions in the search space, roosters are used to guide the hen's search direction, and eggs are new solutions generated by the hen. The algorithm simulates the hen laying eggs under the guidance of the rooster and continuously updates the position of the eggs to gradually approach the optimal solution. Specifically, the hen will adjust the position of the egg based on the position of the rooster and its own experience. The newly laid egg may become a new hen and continue to participate in the search process. In this process, the algorithm updates the optimal solution by continuously evaluating the quality of the solution represented by each hen and egg. The present invention improves the discrete laying hen algorithm in the prior art. The improved discrete laying hen algorithm is a swarm intelligence optimization algorithm suitable for text feature subset selection problems in high-dimensional feature space.

[0045] An improved discrete laying hen algorithm is introduced for feature selection and model training, including: using the improved discrete laying hen algorithm for feature selection, including initial population construction, local development, global exploration and fitness evaluation to screen high-discrimination features; wherein, the input parameters include: original feature space: high-dimensional text features, including word frequency, syntactic features, and semantic vectors; training data: student answer text containing handwritten OCR recognition results, and standard answer labels; the natural language answers of students are dynamically processed by the context-aware word segmenter to generate real labels, combining character-level encoding and open vocabulary processing mechanism.

[0046] Furthermore, the improved discrete laying hen algorithm includes: constructing an initial population, generating candidate solutions through minimum redundancy maximum correlation, ReliefF algorithm and correlation-based feature selection algorithm; using a sliding window mechanism in the local development stage, selecting G fragments from the starting position of the solution vector in sequence, and randomly changing the value of α feature bits in each fragment; in the global exploration stage, perturbing the G feature bits at the end of the current optimal solution and randomly reversing them. The value of the feature bit is used to expand the search space; the termination condition is that the difference in accuracy of the optimal solution of two consecutive iterations is less than the threshold ε, and the fitness evaluation adopts support vector machine combined with five-fold cross validation. Specifically, the fitness evaluation can adopt SVM kernel function as RBF.

[0047] More specifically, the main steps are as follows: S3.1.1: Constructing the initial population The original feature space is evaluated using minimum redundancy and maximum correlation to generate a primary reference solution from the initial population. Furthermore, the ReliefF algorithm and a correlation-based feature selection algorithm are introduced to generate two candidate initialization solutions, respectively. Ultimately, the solution with the highest classification accuracy among these three algorithms is selected as the global initialization starting point.

[0048] Each solution in the population is represented by an R-dimensional binary vector:

[0049] represents the i'th solution vector; The value is 1 or 0, indicating whether the j'th feature is selected (1 is selected, 0 is ignored); R is the total number of original features.

[0050] This structure provides a clear encoding mechanism for feature selection, making it easier to perform search and evaluation.

[0051] S3.1.2: Local development stage Perform a local search near the initial solution, randomly selecting G segments from the solution vector and varying the values of α elements in each segment to generate new candidate solutions. This process slides sequentially from the starting position of the vector to fully explore potential high-quality solutions near the initial solution. Optionally, set G to 5-10 segments and α to 3-5 features.

[0052] S3.1.3 Solution Evaluation A support vector machine (SVM) is used as the classifier, combined with five-fold cross-validation to evaluate the feature subset corresponding to each solution. Model performance (i.e., classification accuracy) is defined as a fitness function. Through continuous iteration, the team seeks solutions with higher accuracy, thereby obtaining the optimal feature combination to improve the overall text classification performance.

[0053] S3.1.4 Global Exploration Phase Perform a perturbation operation on the current optimal solution, that is, randomly select the G elements at the end of the solution vector The algorithm reverses the value of each element to expand the search space and avoid falling into the local optimum. The solution with the highest accuracy is selected from all new solutions and used as the benchmark solution for the next iteration. If the difference in the accuracy of the best solution of two consecutive iterations is less than the threshold ε, the algorithm terminates. The termination criterion formula is set as:

[0054] and denote the accuracy of the best solution in the tth and t+1th iterations, respectively. It is a preset stopping threshold. For example, the termination threshold ε is set to 0.001. When the absolute value of the difference between the best solution accuracy obtained in two consecutive iterations is less than or equal to this threshold, the algorithm stops running.

[0055] This formula provides a clear quantitative standard for the convergence of the algorithm, avoiding unlimited iteration of the algorithm and ensuring that it ends after reaching a certain accuracy requirement, so that the algorithm can find a relatively satisfactory solution within a reasonable time.

[0056] Step S3.1: The improved discrete layer algorithm (feature selection) performs feature selection and model training on preprocessed text features (such as vocabulary and sentence structure), ultimately outputting the optimal feature subset (selecting the features most critical for determining the correctness of the answer). For example, if the student's answer is a pile of fruits, the algorithm, like a "fruit expert," will quickly identify which fruits (features) are key to determining "good or bad." For example, when determining the freshness of an apple, color and firmness are key features, while the size of the apple may not be important. The algorithm uses trial and error (iteration) to find the optimal combination, avoiding missing important information or being distracted by irrelevant information.

[0057] S3.2: Context-aware tokenizer assists in generating true labels During the training process of step S3.1, the true label of the answer is generated by the context-aware word segmenter to assist in text classification and error type identification. The context-aware word segmenter has the ability to model open vocabulary and supports the processing of unknown words. The context-aware word segmenter includes: assigning special tokens to unknown words during character-level encoding <ooc>, and dynamically update the character-token mapping dictionary D, such as assigning <ooc>, and retain the mapping when the same character appears later; if it is detected that 3 consecutive characters are not logged in, a new word item will be automatically created and the hash map will be updated; the decoding stage will <ooc>The token is replaced with a placeholder *, and the display style of the placeholder is consistent with the original text font; the output label sequence of the word segmenter and the feature subset selected by the improved discrete laying hen algorithm are jointly input into the classification model for error type attribution. The specific design is as follows: S3.2.1 Constructing the coding mechanism The context-aware tokenizer encodes the input text at the character level. Each character is assigned a token based on its context position and order, forming a token sequence. At the same time, the context-aware tokenizer builds a character-token mapping dictionary D, which is used to find the corresponding relationship during the encoding process. If the character does not appear in D, a special token is assigned. <ooc>(Out-of-Context).

[0058] S3.2.2 Building a decoding mechanism In the decoding phase, the context-aware tokenizer uses the dictionary D to restore the token sequence to the original text. <ooc>, replace it with a placeholder character *. The font matching method for the placeholder, such as extracting the original font style (such as regular script, font size 12pt) through OCR and applying it to the display. This design enables the model to handle open-vocabulary scenarios, effectively alleviating the OOV (Out-of-Vocabulary) problem, and can also be extended to unseen answer categories.

[0059] Step S3.2: The context-aware tokenizer (label generation) generates real semantic labels for the input student answer text by combining character-level encoding and open-vocabulary processing, that is, text with semantic labels (such as marking "noun", "verb" or error types). The system analyzes the sentence structure like a "Chinese teacher" and "labels" each word. For example, in "He runs very fast", "runs" is a verb and "very fast" is an adverb. If the student writes "He runs very happy", the system will mark "happy" as a wrong word and recommend the correct word (such as "fast") according to the context. For new words that are not recognized (such as Internet buzzwords), they will be marked with special symbols to avoid misjudgment.

[0060] By combining Step S3.1 and Step S3.2, more robust feature expressions can be provided for text classification, especially suitable for scenarios where there are many lexical variants and irregular grammatical structures in students' answers. With the feature optimization mechanism of the improved discrete laying hens algorithm, the accurate attribution of error types can be finally achieved, including grammar errors, lexical misuse, unclear expression, and logical confusion, etc.

[0061] Step S4: Generate a simulated marking trace and a traceable scoring log according to the error classification result and the original homework image; The core goal of this Step S4 is to achieve the "visual marking" and "process traceability" of students' answers, so that the AI question judgment not only gives a conclusion, but also provides clear reasons and modification suggestions, thereby enhancing the teaching transparency and students' feedback experience. It includes the following sub-links: Step S4.1 Simulate human marking and leave traces To improve students' intuitive understanding of error feedback, the system constructs the marking style of a simulated human teacher and generates text annotations with "marking traces".

[0062] Annotation rules: For grammar errors, vocabulary misuse, and logical problems, use red visual marks, including strikethrough, circles, or highlighting; for improvement suggestions, use blue annotations, including word replacement, sentence pattern optimization, and logical connection tips; for content that needs to be highlighted (such as non-standard phrases or ambiguous sentences), add wavy lines or underlines and generate explanatory text associated with the knowledge point library to guide students to reflect on their expressions; the rendering effect of the correction marks is dynamically adjusted according to the terminal type, including the vector graphics of PDF, the CSS style of the web page, and the adaptive layout of the mobile terminal; the annotation position is bound to the coordinates of the original text, supporting scaling and cross-platform display consistency; the input is the error type, position coordinates, and modified suggestion text; the output is a text image or structured data (JSON format) that integrates various types of annotations, including annotation types, coordinate ranges, and associated suggestion content.

[0063] These "handwriting marks" not only closely resemble real teacher corrections in terms of visual effects but also support multi-terminal display (such as PDF output, web page echo, mobile terminal prompts), enhancing students' perceptual experience.

[0064] In step S4.1, the simulation of human-like correction marks generates text with annotations for error types, positions, and modified suggestions (such as red strikethrough, blue modified suggestions, wavy line prompts). The system will circle or strikethrough the error like a teacher correcting homework with a red pen (such as circling and marking "paole" in red), write "Suggested to be changed to 'kuai'" in blue beside it, and add a wavy line to key content (such as "important formula"). These marks can be displayed on computers, mobile phones, or printed papers, looking exactly like a teacher's handwritten corrections.

[0065] Step S4.2 Dynamic trajectory recording To ensure the transparency of the AI scoring and error recognition process, the system introduces a "dynamic decision trajectory recording" mechanism: The triggering process, weight impact, and basis for the final score of each scoring rule will be recorded in a traceable log; each step of the model's decision-making (such as why a certain feature is judged as an error or why a certain sentence pattern is recommended for modification) is bound to information such as the model output probability and confidence level, forming a structured scoring reference; the recording format supports dual-format output of JSON and visual logs, facilitating teachers' technical review, model tuning, or quality inspection. Through this mechanism, AI is no longer a "black box scoring device" but becomes an "explainable judge", enhancing the trust and usability of the system.

[0066] Step S4.2: Dynamic Trajectory Recording: Based on the model's decision-making process (e.g., why a word was deemed incorrect), a traceable scoring log is generated (recording the rationale and basis for each judgment step). The system will "record its own thinking process," for example, "Because 'le' doesn't typically describe speed, this is considered incorrect with a confidence level of 95%." These records can be reviewed like a "diary," allowing teachers to understand the system's reasoning and students to understand the reasons for errors, thus avoiding "black box" operations.

[0067] Step S4.3 Multi-version revision evolution graph Considering that students need to revise and review repeatedly during the learning process, this module also supports the construction of an "answer evolution map" to achieve visual tracking of the entire process from the initial answer to the final suggested version: Graph structure: Nodes represent modified versions of student answers, and node attributes include timestamps, summary of correction suggestions, and confidence scores; directed edges represent the type of modification operation, and the weight of the edge is associated with the semantic difference before and after the modification, and is described in natural language (such as "Syntactic adjustment: subject-verb inconsistency → revised to third person singular").

[0068] Each suggestion or modification generated by AI grading is added to the graph as a "node." Directed edges connect nodes to represent modification operations, such as "syntactic adjustment," "lexical replacement," and "logical supplementation." The graph structure supports "time dimension" expansion, showing the gradual evolution of students' thinking paths in their answers, helping them review their learning process. Teachers can switch between different versions to quickly view the changes between the original answer, the current status, and the final optimization suggestions, verifying and optimizing grading strategies. This graph serves as both a visual representation of the AI grading process and a valuable "thinking process visualization tool" for teaching, providing data support for student self-directed learning and teachers' refined guidance.

[0069] In step S4.3, the Multi-Version Correction Evolution Chart generates a correction flow chart (showing the revision steps from the original answer to the final correct answer) based on the student's multiple revisions to the answer. For example, if a student first writes "Today the weather is very happy" and then changes it to "Today the weather is very hot," the system will record these two revisions and connect them with an arrow, showing the "vocabulary replacement" process. Teachers and students can intuitively see the path of progress, facilitating review and summary.

[0070] Step S5: By performing a horizontal cluster analysis on the answers of all students in the class, the frequently occurring error types are extracted, and the error types are mapped to the standard knowledge structure in the knowledge point library, matched with the corresponding teaching content, and customized handouts are generated.

[0071] This step S5 aims to apply the results of AI marking and error attribution to the feedback layer of the teaching process. By systematically generating teaching materials at the class level and individual level, it helps teachers prepare lessons efficiently and teach precisely.

[0072] The system conducts horizontal clustering analysis on the answering situations of all students in the class, and extracts the frequently occurring error types from them. Subsequently, the system automatically maps these error types to the standard knowledge structure in the knowledge point library and matches the corresponding teaching content modules. The generated lecture content includes: classification and explanation of error types; corresponding knowledge point explanations (accompanied by examples and exercises); tips on common misunderstandings and solution techniques; examples of real student answer fragments and their comments. The lecture is generated in a图文并茂 form and can be adapted to various teaching display formats such as PPT and PDF, facilitating teachers to directly use it for classroom lectures or assign consolidation exercises.

[0073] Step S5.1 realizes aggregating common errors in the class (such as frequent grammar errors and knowledge point loopholes), automatically matching knowledge points and generating customized lecture materials (including error analysis, knowledge point explanations, and example exercises). The system will "statistical errors in the whole class". For example, if it is found that many students cannot distinguish between "de", "di", and "de", it will automatically generate a lecture material to explain the usage of these three words, accompanied by exercise questions and student error cases. Teachers can directly use this lecture material for class without organizing data by themselves.

[0074] Example 2: Figure 2 Fig. shows a schematic flowchart of a method for leaving marks on homework correction based on AI according to the second embodiment of the present invention. On the basis of the first embodiment, the method for leaving marks on homework correction based on AI 100 further includes: Step S6: Conduct personalized learning analysis based on student answering data and AI marking results, generate a student ability portrait, and provide personalized homework suggestions.

[0075] The purpose of this step S6 is to, based on student answering data and AI marking results, combine the ability evaluation model and knowledge graph analysis, deeply explore the learning characteristics and weak links of individual students, and provide decision-making support for subsequent personalized teaching. The module includes the following core functions: S6.1 Construct a student core literacy ability portrait The system constructs a student ability portrait from the following dimensions according to the national curriculum standards and the core literacy evaluation framework: Language application ability: including mastery of grammar structures, sentence pattern diversity, vocabulary breadth and depth; Logical expression ability: focusing on students' logical construction abilities such as argumentation structure, view support, and causal relationship; Text understanding and reconstruction ability: measuring their information extraction, summarization, rewriting abilities, etc.; Innovative expression and writing style: evaluating students' writing innovation and language personality expression through natural language generation models.

[0076] Each dimension is visualized in the form of scores, star ratings, radar charts, etc., and is accompanied by corresponding suggestions and improvement paths, making it easy for teachers to quickly understand students' overall performance.

[0077] In step S6.1, the student ability profile is generated based on student response data (e.g., error types and word usage habits) to generate an ability assessment report (e.g., language application ability score, logical expression radar chart). The system will assess each student's ability, such as "Language application ability 85 points, logical expression ability 70 points," and use charts to display strengths and weaknesses. For example, if a student is found to have a "rich vocabulary but many grammatical errors," more grammar practice may be recommended.

[0078] S6.2 Analyze students’ learning blind spots and provide personalized homework suggestions By linking with the knowledge graph, the system can explore the gaps and gray areas in students' knowledge mastery: using the correspondence between wrong question labels and knowledge points to identify students' "knowledge points that are easy to make mistakes"; analyzing the type of attribution behind the errors (such as comprehension bias, memory forgetting, and concept confusion); and based on the cognitive diagnostic model, dynamically generating a "learning blind spot map" for each student.

[0079] The system then intelligently pushes personalized homework content, including: targeted consolidation exercises; links to short video explanations; and analogy transfer tasks (guiding the transfer of mastered content to unmastered areas).

[0080] According to the above-described embodiments of the present invention, by constructing an OCR model with a substring encoder and substring matcher and introducing a fine-grained substring representation and matching mechanism, the model's recognition accuracy and stability are effectively improved when handling complex assignment content (such as handwriting, erasures, and complex structured questions). A variable importance scoring method based on an attention mechanism enables the OCR model to dynamically focus on different feature dimensions and visually demonstrate the impact of input features on output results. By combining an improved discrete laying hen algorithm with a context-aware word segmenter, model performance and efficiency are optimized. Simulating correction traces, dynamic trajectory recording, and handout generation improves teaching adaptability and feedback quality.

[0081] The above is an introduction to the method embodiment. The following further illustrates the solution of the present invention through a system embodiment.

[0082] Example 3: Figure 3 FIG3 shows a module diagram of an AI-based homework correction and trace system according to the third embodiment of the present invention. Figure 3 As shown, an AI-based homework grading and traceability system 200 includes: Image acquisition device 210, used to scan paper work and obtain original input images; An image recognition module 220 is configured to perform accurate text recognition on the written content in the original input image using an OCR model based on a cross-attention mechanism to obtain text data, and to perform structured cleaning and preprocessing on the text data to obtain high-dimensional text features; The answer judgment module 230 is used to build an answer judgment and error recognition model, introduce an improved discrete laying hen algorithm for feature selection and model training, perform semantic understanding, automatic scoring and error analysis on the high-dimensional text features, and output error classification results; A trace generation module 240 is used to generate simulated correction traces and a traceable scoring log based on the error classification results and the original homework image; The handout generation module 250 is used to perform a horizontal cluster analysis on the answers of all students in the class, extract the frequently occurring error types, map the error types with the standard knowledge structure in the knowledge point library, match the corresponding teaching content, and generate customized handouts.

[0083] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0084] Furthermore, an embodiment of the present application also provides an electronic device, comprising: a processor, a memory, and a system bus; the processor and the memory are connected via the system bus; the memory is used to store one or more programs, and the one or more programs include instructions, which, when executed by the processor, enable the processor to execute any of the above methods.

[0085] Furthermore, an embodiment of the present application also provides a computer program product, which, when running on a terminal device, enables the terminal device to execute any of the above methods.

[0086] Through the description of the above embodiments, it can be seen that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in each embodiment of the present application or certain parts of the embodiments.

[0087] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the methods.

[0088] It should also be noted that, in the embodiments of the present application, relational terms such as first and second, etc., are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article, or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0089] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the embodiments of the present application may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown in the embodiments of the present application, but rather will conform to the widest scope consistent with the principles and novel features disclosed in the embodiments of the present application.< / ooc> < / ooc> < / ooc> < / ooc> < / ooc> < / ooc> < / ooc>

Claims

1. An AI-based homework marking method, characterized in that: The following steps are involved: Step S1: Scan the paper work using a high-precision image acquisition device to obtain the original input image; Step S2: Using an OCR model based on a cross-attention mechanism to accurately recognize the written content in the original input image to obtain text data, and performing structured cleaning and preprocessing on the text data to obtain high-dimensional text features; Step S3: constructing an answer judgment and error recognition model, introducing an improved discrete laying hen algorithm for feature selection and model training, performing semantic understanding, automatic scoring and error analysis on the high-dimensional text features, and outputting error classification results; Step S4: generating simulated correction traces and a traceable scoring log based on the error classification results and the original homework image; Step S5: By performing a horizontal cluster analysis on the answers of all students in the class, the frequently occurring error types are extracted, and the error types are mapped to the standard knowledge structure in the knowledge point library, matched with the corresponding teaching content, and customized handouts are generated.

2. The AI-based homework marking method according to claim 1 is characterized in that: in, The step S2, using an OCR model based on a cross-attention mechanism to accurately recognize the written content in the job image to obtain text data, includes: Performing region detection on the original input image to generate target substring features, and performing feature extraction to obtain a global or local embedded feature representation of the image; Mapping the target substring features obtained by the original input image recognition into a continuous embedding vector through a substring encoder, and feeding the target substring features and the embedding vector into a multi-head cross attention module to capture the correlation between the target substring features and the image context, and adding the output of the multi-head cross attention module to the original target substring features through a residual connection to obtain a contextual representation of the substring; The substring matcher uses the context representation as a query vector to perform cross-attention matching with the image embedding features, predicts the preceding and following characters corresponding to the substring, and optimizes the OCR model through cross-entropy loss; A variable importance scoring method based on the attention mechanism quantifies the impact of input features on the final recognition results.

3. The AI-based homework marking method according to claim 2 is characterized in that: The OCR model is optimized by using cross entropy loss, including: optimizing the OCR model by comparing the difference between the predicted next and previous characters and the label, and calculating the cross entropy loss, including: For each training sample, the cross entropy loss between the predicted next character and the previous character is calculated simultaneously, and the invalid positions labeled [P] are ignored through the mask mechanism; The total loss L is the mean loss of all valid samples, and the normalization factor is the total number of valid samples after excluding the [P] label; The cross entropy loss ce(ỹ, y) is defined as: when the true label y≠[P], the negative log-likelihood loss is calculated ,in, is the true label value of the c-th category; is the predicted probability value of the cth class; when y=[P], the loss value is 0; The total loss function drives the model to learn the contextual relevance of character sequences by jointly optimizing the previous and next character prediction tasks.

4. The AI-based homework marking method according to claim 2 or 3 is characterized in that: The variable importance scoring method based on the attention mechanism quantifies the impact of input features on the final recognition results, including: An interpretability unit is constructed to generate variable importance scores and visualize feature influence areas using an attention matrix. The interpretability unit satisfies the following requirements: directly deriving the importance of input features through attention scores satisfies the universality assumption; a statically stable attention distribution is used instead of a dynamic gradient score; and importance calculation is insensitive to the type of activation function.

5. The AI-based homework marking method according to claim 1 is characterized in that: The improved discrete laying hen algorithm is introduced to perform feature selection and model training, including: An improved discrete laying hen algorithm was used for feature selection, including initial population construction, local development, global exploration, and fitness evaluation, to screen for highly discriminative features. Input parameters included: the original feature space: high-dimensional text features, including word frequency, syntactic features, and semantic vectors; training data: student answer texts containing handwritten OCR recognition results and standard answer labels; The natural language answers given by students are dynamically processed with OOV vocabulary through a context-aware word segmenter to generate real labels, combining character-level encoding with open vocabulary processing mechanism.

6. The AI-based homework marking method according to claim 5 is characterized in that: in, The improved discrete laying hen algorithm comprises: Construct an initial population and generate candidate solutions through the minimum redundancy maximum correlation, ReliefF algorithm and correlation-based feature selection algorithm; In the local development phase, a sliding window mechanism is used to select G fragments from the starting position of the solution vector, and the values of α feature bits are randomly changed in each fragment; In the global exploration phase, the last G feature bits of the current optimal solution are disturbed and randomly reversed. The value of the feature bit is used to expand the search space; The termination condition is that the difference in accuracy of the optimal solution of two consecutive iterations is less than the threshold ε, and the fitness evaluation uses support vector machine combined with five-fold cross validation.

7. The AI-based homework marking method according to claim 6 is characterized in that: in, The context-aware word segmenter includes: When encoding at the character level, assign special tokens to unregistered words <ooc> , and dynamically update the character-token mapping dictionary D;< / ooc> The decoding stage will <ooc> The token is replaced by a placeholder *, and the display style of the placeholder is consistent with the original text font;< / ooc> The output tag sequence of the word segmenter and the feature subset screened by the improved discrete laying hen algorithm are jointly input into the classification model for error type attribution.

8. The AI-based homework marking method according to claim 1 is characterized in that: In step S4, generating simulation correction traces includes: Marking rules: Grammatical errors, vocabulary misuse, and logical problems are marked with red visual markers, including strikethroughs, circles, or highlights. Improvement suggestions are marked with blue annotations, including word replacements, sentence optimization, and logical connection tips. Content that requires emphasis is marked with wavy lines or underlines, and linked to the knowledge point database to generate explanatory text. The rendering effect of the correction traces is dynamically adjusted according to the terminal type, including vector graphics for PDF, CSS styles for web pages, and adaptive layout for mobile terminals; the annotation position is bound to the coordinates of the original text, supporting scaling and cross-platform display consistency; The input is the error type, location coordinates, and modification suggestion text; the output is a text image or structured data (JSON format) that integrates multiple types of annotations, including the annotation type, coordinate range, and associated suggestion content.

9. The AI-based homework marking method according to claim 1 is characterized in that: The method further comprises: Step S6: Conduct personalized learning analysis based on student answer data and AI grading results, generate student ability profiles, and provide personalized homework suggestions.

10. An AI-based homework grading and marking system, characterized by: include: Image acquisition equipment, used to scan paper work and obtain original input images; An image recognition module is used to accurately recognize the written content in the original input image using an OCR model based on a cross-attention mechanism to obtain text data, and to perform structured cleaning and preprocessing on the text data to obtain high-dimensional text features; The answer judgment module is used to build an answer judgment and error recognition model, introduce an improved discrete laying hen algorithm for feature selection and model training, perform semantic understanding, automatic scoring and error analysis on the high-dimensional text features, and output error classification results; A trace generation module is used to generate simulated correction traces and a traceable scoring log based on the error classification results and the original homework image; The handout generation module is used to perform horizontal cluster analysis on the answers of all students in the class, extract the frequently occurring error types, map the error types with the standard knowledge structure in the knowledge point library, match the corresponding teaching content, and generate customized handouts.

Citation Information

Cited By

  • Text analysis method for intelligent paper marking based on artificial intelligence

    CN121747123A