Homework correcting method based on image recognition
By extracting the topological features of strokes and dynamic semantic compensation, the existing system's misjudgment of continuous stroke characters and cross-line rhetorical structures is solved, and lightweight rhetorical structure analysis and personalized diagnosis are achieved, which improves the accuracy and efficiency of homework correction.
Patent Information
- Application Number
- CN202510862026.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
The existing homework correction system based on image recognition can easily lead to misjudgment of rhetorical techniques and insufficient personalized diagnosis when processing students' handwriting homework, especially when writing and cross-line rhetorical structures, which are high in calculation costs and difficult to deploy on the mobile side.
By extracting the topological features of strokes, a dynamic semantic weight table is generated, semantic compensation is performed in combination with context word vectors, and rhetorical structure analysis is performed to generate visual annotations, including error interpretation animations and beautiful word and sentence markers.
It realizes accurate analysis of Lianbi characters, avoids misjudgment of rhetorical structure, improves personalized diagnostic capabilities, reduces computing costs, and makes the system more lightweight deployment on the mobile terminal.
Smart Images

Figure CN120373257A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of homework marking, and in particular to a homework marking method based on image recognition. Background Art
[0002] With the in-depth application of artificial intelligence in the field of education, the homework grading system based on image recognition has become an important auxiliary tool for English teaching; the current mainstream solutions generally adopt an end-to-end deep learning framework: extracting handwritten image features through the convolutional neural network CNN, combining with the long short-term memory network LSTM for sequence recognition, and finally connecting to the natural language processing NLP module to complete grammar checking and simple comment generation; this type of technology is effective for printed homework, but when processing students' real handwritten homework, cursive characters will cause misjudgment of rhetorical devices.
[0003] In this regard, some solutions use the attention mechanism to dynamically focus on the key structural points of cursive letters, such as distinguishing u and v through stroke endpoint detection, or using the Transformer model to perform semantic correction on the recognition results, for example, completing Ifeel so h_ppy with happy. However, these solutions only stay at the single-word recognition level in optimization, and do not establish the association between glyph features and the rhetorical function of the sentence. When students write metaphorical sentences in cursive, such as Her smile is a warm sun, the strokes of a and s are deformed. The system may misjudge the proper noun of warm sun and ignore the metaphorical structure due to excessive focus on the continuity of local strokes. The existing model processes the handwriting as a static image and cannot capture the traces of expression strategies in the writing process; for example, the tail stroke that students deliberately lengthen to emphasize the metaphor word ocean is simplified to an ordinary cursive word.
[0004] Some solutions also introduce stroke trajectory reconstruction algorithms, such as Apple Pencil's handwriting prediction technology, which reverses the writing order from scanned images, or builds a rhetoric-sensitive NLP model to add rhetorical tags such as metaphor / parallelism in syntax tree analysis; but the reconstructed handwriting sequence is difficult to accurately match with the NLP rhetorical tags, resulting in the separation of form and meaning. The connection of multiple models in series causes the computational cost to increase exponentially, making it difficult to deploy on mobile terminals; therefore, there is an urgent need for a lightweight algorithm that can achieve end-to-end parsing of rhetorical structures while retaining the original writing characteristics of cursive characters. Summary of the invention
[0005] In view of the above existing problems, the present invention is proposed.
[0006] The present invention provides a homework grading method based on image recognition to solve the problems in the prior art of rhetorical misjudgment and insufficient personalized diagnosis due to the fragmentation of the analysis of connected characters, the lack of cross-line processing and the mechanization of error feedback.
[0007] To solve the above technical problems, the present invention provides the following technical solutions: An embodiment of the present invention provides a method for correcting homework based on image recognition, which includes Step S1, collecting the original image of the student's handwritten homework and recognizing the text area and writing trajectory; Step S2, extracting stroke topological features for the cursive writing area; Step S3, generating a dynamic semantic weight table based on the stroke topological features and performing semantic compensation in combination with context word vectors; Step S4, performing rhetorical structure analysis on the compensated text and marking the start and end positions and types of metaphorical sentences and parallelism sentences; Step S5, generating visual annotations, including error explanation animations and marking of beautiful sentences.
[0008] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, wherein: the extraction of stroke topological features in step S2 includes: Decomposing cursive letters into discrete stroke segments; Calculating the curvature change sequence of each stroke segment and marking the curvature mutation points; Counting the number of closed loops formed by the stroke segments; When the deviation of the number of closed loops from the standard glyph exceeds the tolerance value, activating the adjacent stroke spatial vector analysis: Establishing a spatial position coordinate system for the stroke segments; Calculating the included angle and distance vector of adjacent stroke segments.
[0009] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, wherein: the implementation of semantic compensation in step S3 includes: Constructing a dynamic word vector weight table containing the set of adjacent high-frequency words of the target vocabulary; When the confidence level of single-character recognition is lower than the threshold, performing weight adjustment: Obtaining the three words before and after the current word as the semantic context window; Calculating the semantic correlation degree between the candidate word and the context window.
[0010] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, wherein: in step S3, during the semantic correlation degree weighted compensation process, when the confidence level of OCR for a certain word is lower than the threshold, performing dynamic compensation on the recognition result and feeding it back to the weight table, including: For the current position both sides word vectors are subjected to exponential decay aggregation: , , in, is the context window radius, is the relative position index, For location word vectors, is the indicator function, is the position weight coefficient, is the attenuation constant, is the context vector, To sum the intermediate variables; Candidate words Compute cosine similarity with context: , in is the candidate word vector, is the semantic relevance; By exponential smoothing, the candidate words are obtained at time Weight: , in, and are the old and latest dynamic weights respectively, is the memory decay factor, is the frequency of candidate words, is the frequency smoothing constant, is the current update step; The stroke topological features enhance the weight table in a multiplicative manner: , in, and To enhance the front and back weight matrices, For Hadamard, is the topological enhancement coefficient, For each The correlation vector composed of Then the dynamic weights are linearly fused with the original confidence and compressed by Sigmoid: , in, To compensate for the confidence, is the original OCR confidence, is the fusion coefficient, is the Sigmoid function, with the maximum The word form replaces the original recognition result.
[0011] As a preferred solution of the homework marking method based on image recognition described in the present invention, the processing of the cross-line rhetorical structure in step S4 includes: Locate the rhetorical keyword in the first line: Identify the page coordinates of the pre-set rhetorical keyword in the first-line sentence, denoted as the starting coordinate point ; Scan for associated keywords in the second line: Detect the continuing keywords with semantic associations within the pre-set area at the top of the second line, where the pre-set area satisfies: Horizontal deviation constraint: ; Vertical range constraint: ; wherein, is the vertical coordinate of the top of the second line, is the page height; Execute syntax tree merging: When the coordinates of the continuing keyword that meet the constraints are detected, merge the first-line and second-line texts into a single syntax tree for rhetorical structure analysis.
[0012] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, wherein: the generation of error explanation animations in step S5 includes: Tense error corresponding time-axis animation: Extract explicit / implicit time adverbs in the sentence; Overlay a two-way time pointer at the error verb; The red pointer points to the correct tense time node; Article error displays a visual model of countable nouns: Generate an isolated object 3D contour of a singular noun; Generate a population distribution dot matrix diagram of plural nouns.
[0013] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, wherein: the marking of beautiful sentences and phrases includes: Detect students' hand-drawn underlines / wavy lines: Determine as a hand-drawn line through a threshold of curvature variance > 0.8; Initiate in-depth rhetorical analysis for the sentences covered by the hand-drawn line: Identify the mapping relationship between the noumenon and the metaphor in the metaphor structure; Detect the integrity of the parallel structure of the parallel sentences; Overlay rhetorical type icons at the corresponding positions in the original image.
[0014] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, it further includes personalized error pattern analysis: Record the repetitive error roots of the same student; When a specific error type accumulates ≥ 3 times: Analyze the linguistic features of the error roots; Generate special training questions that include comparative language cases.
[0015] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, wherein: during the personalized error pattern analysis, when the same student triggers the same root error multiple times in the correction record, the propagation probability of this error type is recursively updated in three loops in sequence, including: Let the completed homework serial number be , and record the binary sequence within a sliding window of length to obtain the recent frequency: , wherein, is the current homework serial number, is the window length, is the relative position within the window, is the serial number at the error indication, is the position weight, is the decay constant, is the recent frequency; The propagation probability of the error type is exponentially recursive: , wherein, and are the propagation probabilities of serial numbers , respectively, is the memory weight factor, is the smoothing slope, is the error cumulative occurrence times, is the trigger threshold; Calculate the upper bound of the error and decide whether to generate special training questions: , wherein, is the normal 95% quantile constant, is the sample size within the window, is the semi-width of the confidence interval, is the upper confidence limit. If , immediately push the special training task with the root as the core.
[0016] As a preferred solution of the method for correcting homework based on image recognition according to the present invention, wherein: the generation of the time-axis animation further includes: For sentences that do not contain explicit time adverbials: Extract time clue words from context paragraphs; Build a logical sequence chain of events; Inferring implicit temporal reference points based on chains of events.
[0017] The beneficial effects of the present invention are as follows: the present invention breaks through the limitation of the surface processing of cursive characters by the existing homework grading technology, incorporates cursive deformation into the expression intention analysis framework through the linkage of stroke topological features and semantic compensation, and can identify metaphors deliberately strengthened by students, such as as with elongated strokes, to avoid misjudging rhetorical structures as word errors; and eliminates the fragmentation of long rhetorical sentences by physical paging through forced merging of cross-line syntax trees, ensuring complete parsing of emphasized sentences such as not only...but also.
[0018] The dynamic visualization mechanism of the present invention transforms abstract grammatical rules into perceptible scenarios: the timeline animation of tense errors intuitively presents the misalignment of actions and time nodes, and the deep rhetorical analysis triggered by hand-drawn wavy lines accurately marks the metaphor subject-metaphor mapping relationship, allowing students to understand the essence of the error at a glance; the personalized error propagation model is upgraded from mechanical error correction to learning behavior diagnosis. When it is detected that students are interfered with by their mother tongue, such as those with a French background frequently making -ant suffix errors, comparative language case training questions are automatically pushed to form a correction-diagnosis-compensation closed loop; implicit tense inference makes up for the missing time adverbials through the event logic chain, avoids misjudgment due to incomplete expression, and improves the robustness to real corpus. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0020] Figure 1 This is a flowchart of the homework grading method based on image recognition in Example 1. DETAILED DESCRIPTION
[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0022] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0023] Second, the "one embodiment" or "embodiment" referred to herein means a specific feature, structure, or characteristic that may be included in at least one implementation manner of the present invention. The "in one embodiment" that appears in different places in this specification does not all refer to the same embodiment, nor is it an individual or alternative embodiment that is mutually exclusive with other embodiments.
[0024] Embodiment 1, referring to Figure 1 , this embodiment provides a method for correcting homework based on image recognition, including the following steps: Step S1, collect the original image of the student's handwritten homework, and identify the text area and writing trajectory; Step S2, for the cursive writing area, extract the stroke topological features; The extraction of the stroke topological features in Step S2 includes: Decompose the cursive letters into discrete stroke segments; Calculate the curvature change sequence of each stroke segment and mark the curvature mutation points; Count the number of closed loops formed by the stroke segments; When the deviation of the number of closed loops from the standard glyph exceeds the tolerance value, activate the adjacent stroke spatial vector analysis: Establish a spatial position coordinate system for the stroke segments; Calculate the included angle and distance vector between adjacent stroke segments; Step S3, generate a dynamic semantic weight table based on the stroke topological features, and perform semantic compensation in combination with the context word vectors; The implementation of the semantic compensation in Step S3 includes: Construct a dynamic word vector weight table, which includes the set of adjacent high-frequency words of the target vocabulary; When the confidence level of single-character recognition is lower than the threshold, perform weight adjustment: Obtain the three words before and after the current word as the semantic context window; Calculate the semantic correlation degree between the candidate word and the context window; In Step S3, during the semantic correlation degree weighted compensation process, when the confidence level of OCR for a certain word is lower than the threshold, perform dynamic compensation on the recognition result and feedback it to the weight table, including: For the current position both sides word vectors are subjected to exponential decay aggregation: , , wherein, is the context window radius, is the relative position index, is the position word vector, is the indicator function, is the position weight coefficient, is the attenuation constant, is the context vector, is the intermediate variable for summation; For the candidate word calculate the cosine similarity with the context: , where is the candidate word vector, is the semantic association degree; Obtain the weight of the candidate word at time through exponential smoothing: , where, and are the old and latest dynamic weights respectively, is the memory decay factor, is the frequency of the candidate word appearance, is the frequency smoothing constant, is the current update step; The stroke topology feature enhances the weight table in a multiplicative manner: , where, and are the weight matrices before and after enhancement, is the Hadamard product, is the topological enhancement coefficient, is the association degree vector composed of each ; Then linearly fuse the dynamic weight and the original confidence and compress through Sigmoid: , where, is the compensated confidence, is the original OCR confidence, is the fusion coefficient, is the Sigmoid function, and replace the original recognition result with the word form with the maximum ; Specifically, this step uses position attenuation to perform weighted aggregation on the context vector, making the nearby words contribute more to the candidate ranking, while the influence of the distant words still retains the overall context after exponential suppression. The dynamic weight adopts frequency-driven exponential smoothing, which can quickly respond to novel expressions while maintaining historical stability. The connected-stroke topology enhancement matrix amplifies the true association degree through local stroke closure and suppresses noise interference; Step S4, perform rhetorical structure analysis on the compensated text, and mark the start and end positions and types of metaphorical sentences and parallelism sentences; In step S4, the processing of cross-line rhetorical structures includes: Locate the rhetorical keyword in the first line: Identify the page coordinates of the preset rhetorical keyword (such as "not only") in the first-line sentence, and record it as the starting coordinate point ; Scan for associated keywords in the second line: Detect the continuation keyword with semantic association (such as "but also") within the preset area at the top of the second line. The preset area satisfies: Horizontal deviation constraint: ; Vertical range constraint: ; Among them, is the ordinate of the top of the second line, is the page height; Execute syntax tree merging: When the coordinates of the continuation keyword that meet the constraints are detected, merge the first-line and second-line texts into a single syntax tree for rhetorical structure analysis; Step S5, generate visual annotations, including error explanation animations and marked beautiful sentences; In step S5, the generation of error explanation animations includes: Tense error corresponding time-axis animation: Extract explicit / implicit time adverbs in the sentence; Overlay two-way time pointers at the error verb; The red pointer points to the correct tense time node; Article error shows the visualization model of countable nouns: Generate the 3D outline of an isolated object for a singular noun; Generate the dot matrix diagram of the group distribution for a plural noun;
[0025] The generation of the time-axis animation also includes: For sentences that do not contain explicit time adverbs: Extract the time clue words in the context paragraph; Construct an event logic sequence chain; Infer the implicit tense reference point based on the event chain; The marking of beautiful sentences includes: Detect the student's hand-drawn underlines / wavy lines: Determine as a hand-drawn line through the threshold of curvature variance > 0.8; Start in-depth rhetorical analysis for the sentences covered by the hand-drawn line: Identify the mapping relationship between the noumenon and the metaphor in the metaphorical structure; Detect the integrity of the parallel structure of the parallel sentences; Overlay rhetorical type icons at the corresponding positions in the original image; This embodiment also includes personalized error pattern analysis: Record the repetitive error roots of the same student; When a specific error type accumulates ≥ 3 times: Analyze the linguistic features of the error roots; Generate special training questions containing comparative language cases; During the personalized error pattern analysis process, when the same student triggers the same root error multiple times in the grading record, for this error type Perform three-ring recursive updates on the propagation probability in sequence, including: Let the completed assignment number be , and record the binary sequence within a sliding window of length to obtain the recent frequency: , where is the current assignment number, is the window length, is the relative position within the window, is the error indication at sequence number , is the position weight, is the decay constant, is the recent frequency; For the propagation probability of error type , use exponential recursion: , where and are the propagation probabilities of sequence numbers , respectively, is the memory weight factor, is the smoothing slope, is the error cumulative occurrence times, is the trigger threshold; Calculate the error upper bound to determine whether to generate special training questions: , where is the normal 95% quantile constant, is the sample size within the window, is the half-width of the confidence interval, is the upper confidence limit. If , immediately push the special training task with the root as the core; Specifically, this propagation model captures the error density in the student's recent several assignments through a sliding window, suppresses long-term noise with exponential weights, and the memory factor rises Sigmoidally with the cumulative number of times, can remain sensitive in the initial stage of errors, and can delay saturation in the stage of frequent errors. The confidence interval correction gives a conservative upper limit for the sparse sample situation, avoiding mis-triggering training due to occasional errors.
[0026] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
Claims
1. A homework marking method based on image recognition, characterized in that, include, Step S1, collecting the original image of the student's handwritten homework and identifying the text area and writing trajectory; Step S2, extracting stroke topological features for the connected writing area; Step S3, generating a dynamic semantic weight table based on stroke topology features, and performing semantic compensation in combination with context word vectors; Step S4, performing rhetorical structure analysis on the compensated text, marking the starting and ending positions and types of metaphors and parallelisms; Step S5, generating visual annotations, including error explanation animations and beautiful word and sentence markings.
2. The method for correcting homework based on image recognition according to claim 1, wherein The stroke topology feature extraction in step S2 includes: Break down connected letters into discrete stroke segments; Calculate the curvature change sequence of each stroke segment and mark the curvature mutation point; Count the number of closed loops formed by the stroke segments; When the number of closed loops deviates from the standard glyph by more than the tolerance value, the adjacent stroke space vector analysis is activated: Establishing a spatial position coordinate system of the stroke segment; Calculate the angle and distance vector between adjacent stroke segments.
3. The method for marking homework based on image recognition according to claim 1, characterized in that, The implementation of semantic compensation in step S3 includes: Construct a dynamic word vector weight table, which contains a set of adjacent high-frequency words of the target vocabulary; When the confidence of single word recognition is lower than the threshold, weight adjustment is performed: Get the three words before and after the current word as the semantic context window; Calculate the semantic relevance between the candidate word and the context window.
4. The method for correcting homework based on image recognition according to claim 3, wherein In the step S3, during the weighted compensation process of semantic relevance, when the confidence of the OCR for a certain word is lower than the threshold, dynamic compensation is performed on the recognition result and fed back to the weight table, including: Current position Both sides Exponential decay aggregation is performed on the two word vectors: , , Among them, is the context window radius, is the relative position index, is the position word vector, is the indicator function, is the position weight coefficient, is the decay constant, is the context vector, is the intermediate variable for summation; For candidate words Calculate the cosine similarity with the context: , Among them is the candidate word vector, is the semantic correlation degree; Obtain the weight of the candidate word at time by exponential smoothing: , Among them, and are the old and the latest dynamic weights respectively, is the memory decay factor, is the occurrence frequency of the candidate word, is the frequency smoothing constant, is the current update step; The stroke topological features enhance the weight table in a multiplicative manner: , Among them, and are enhanced front and back weight matrices, is the Hadamard product, is the topological enhancement coefficient, is composed of each constituting the correlation degree vector; Then the dynamic weights are linearly fused with the original confidence and compressed by Sigmoid: , Among them, is the confidence after compensation, is the original OCR confidence, is the fusion coefficient, is the Sigmoid function, which replaces the original recognition result with the word form with the maximum to replace the original recognition result with the most frequent word form.
5. The method for correcting homework based on image recognition according to claim 1, characterized in that, Processing the interline rhetorical structure in step S4 includes: Locate the rhetorical keyword in the first line: Identify the page coordinates of the preset rhetorical keyword in the first-line sentence, denoted as the starting coordinate point ; Scan the associated keywords of the next row: Detect semantically associated continued keywords in the preset area at the top of the next row, and the preset area satisfies: Horizontal deviation constraint: ; Vertical range constraint: ; Among them, is the ordinate of the top of the next line, is the page height; Execute syntax tree merging: When the coordinates of the continuation keyword that meet the constraints are detected merge the text of the first line and the second line into a single syntax tree for rhetorical structure analysis.
6. The method for correcting homework based on image recognition according to claim 1, wherein The error explanation animation generation in step S5 includes: Temporal errors correspond to timeline animations: Extract explicit / implicit time adverbials in sentences; The bidirectional time pointer is superimposed at the wrong verb; The red pointer points to the correct tense time node; Article errors show countable nouns visualization model: Generate isolated object 3D outlines of singular nouns; Generate a population distribution dot plot of plural nouns.
7. The method for correcting homework based on image recognition according to claim 1, characterized in that, The beautiful word and sentence markers include: Detect students' hand-drawn underlines / wavy lines: The hand-drawn line was determined by the threshold of curvature variance > 0.8; Initiate a deep rhetorical analysis of the sentence covered with hand-drawn lines: Identify the subject-object mapping relationship in the metaphor structure; Detect the parallel structure integrity of parallel sentences; The rhetoric type icon is superimposed at the corresponding position of the original image.
8. The method for correcting homework based on image recognition according to claim 1, wherein, Also includes personalized error pattern analysis: Record repeated incorrect root words of the same student; When a specific error type occurs ≥ 3 times cumulatively: Analyze the linguistic characteristics of incorrect word roots; Generates specialized training questions containing contrasting language examples.
9. The method for marking homework based on image recognition according to claim 8, wherein During the personalized error pattern analysis process, when the same student triggers the same root word error multiple times in the marking record, the propagation probability of this error type is recursively updated in three loops in sequence, including: Let the completed job serial number be , and record the binary sequence within a sliding window of length to obtain the recent frequency: , Among them, is the current job serial number, is the window length, is the relative position within the window, is the serial number error indication at, is the position weight, is the attenuation constant, is the recent frequency; For the propagation probability of the error type exponential recursion is adopted: , Among them, and are the propagation probabilities of serial numbers and respectively, is the memory weight factor, is the smoothing slope, is the error cumulative occurrence times, is the trigger threshold; Calculate the upper bound of the error and decide whether to generate special training questions: , Among them, is the normal 95% quantile constant, is the sample size within the window, is the half-width of the confidence interval, is the upper confidence limit. If , immediately push the special training task with the root as the core.
10. A method for correcting homework based on image recognition according to claim 6, characterized in that, The timeline animation generation also includes: For sentences without explicit time adverbials: Extract time clue words from context paragraphs; Build a logical sequence chain of events; Inferring implicit temporal reference points based on chains of events.
Citation Information
Patent Citations
Automatic correction method and device for handwritten composition
CN108595410A
Automatic composition correcting and scoring method and terminal
CN111737968A
Homework correction method and system, terminal and storage medium
CN116152828A
Automatic test script dynamic generation method and system based on multi-modal AI identification
CN120011247A
Method for AI language self-improvement agent using language modeling and tree search techniques
US11948560B1
Cited By
Composition correction method and device based on large model
CN121121778A
