Homework correction trace rendering method, storage medium and equipment
By using blank heatmaps and dynamic weight optimization algorithms, combined with collision detection and rendering position adjustment, the problem of overlapping correction marks was solved, improving the readability of assignment corrections and user experience, and achieving clear display and efficient rendering of correction marks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional homework grading processes suffer from messy grading marks, inconsistent comment placement, and low efficiency. Existing intelligent grading systems often suffer from overlapping grading marks and answers, unreasonable distribution of grading marks for consecutive fill-in-the-blank questions, and unscientific placement of comments for subjective questions, all of which affect the readability of the grading results and the user experience.
The algorithm uses a blank heatmap to identify the answer area, and combines dynamic weight formula and rendering position to optimize the objective function. Collision detection and adaptive adjustment mechanisms ensure the reasonable distribution of grading elements. Bezier curves and reinforcement learning are used to generate guiding lines to avoid overlap and improve the readability of grading marks.
It achieves a clear display of marking traces, reduces the overlap of marking elements, improves the usability and user experience of the intelligent marking system, reduces the workload of teachers, and improves the learning efficiency of students.
Smart Images

Figure SMS_1 
Figure SMS_2 
Figure SMS_6
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of intelligent education, in particular to a homework correction trace rendering method, a storage medium and equipment. BACKGROUND
[0002] In the traditional homework correction process, teachers usually need to manually correct and mark on paper homework. This method has problems such as messy correction traces, unfixed comment positions, and low correction efficiency. With the development of education informatization, intelligent correction systems based on AI technology have emerged. However, the existing systems still have deficiencies in correction trace rendering: correction marks are easily overlapped with answer content, correction marks of continuous fill-in-the-blank questions are distributed unreasonably, and comment positions for subjective question steps are not scientific, which affects the readability of correction effect and user experience. Especially when dealing with complex question types, how to intelligently arrange the positions of correction marks and comments to avoid overlapping with the original answer content becomes a technical difficulty. SUMMARY
[0003] In view of the deficiencies of the prior art, the present application aims to provide a homework correction trace rendering method, a storage medium and equipment.
[0004] To achieve the above-mentioned purpose, the present application adopts the following technical solutions: A homework correction trace rendering method, comprising the following steps: S1, identifying the distribution of answer areas and blank areas in the to-be-corrected document, wherein the distribution of blank areas is calculated by a blank heat map algorithm:
[0005] Wherein, (x, y) is the pixel coordinate, (x i ,y i ) is the coordinate of the i-th answer element, n is the total number of answer elements; σ is the Gaussian kernel parameter; S2, determining the correction elements and their priorities that need to be rendered according to the correction result, and the priority of each correction element is calculated by the following dynamic weight formula:
[0006] Wherein, T i is the error type weight, E i is the error severity, S i is the semantic correlation, 、 、 are the weights of T i , E i , S i , and β is an adjustable coefficient. S3, based on the blank area distribution obtained in step S1 and the priority of each correction element obtained in step S2, calculate the optimal rendering position of each correction element, and the rendering position optimization objective function is:
[0007] Wherein, d is the distance function, o is the overlap penalty term, and λ is the adjustment parameter; d(pi, qi) represents the distance between the optimal rendering position pi of the correction element i and the ideal position qi; o(pi, pj) represents the overlapping area between the optimal rendering position pi of the correction element i and the optimal rendering position pj of the correction element j; wi represents the priority weight λ of the i-th correction element; S4, render each correction element at its determined optimal rendering position, and establish the visual association between each correction element and the corresponding answer content.
[0008] Further, in step S2, for the value of Ti, the weight of conceptual error = 1.0, the weight of calculation error = 0.8, and the weight of format error = 0.3; Ei is a 0-1 standardized value; The semantic association degree represented by Si is the degree of correlation between the comment and the error point. The typical values of α, β and γ are 0.5, 0.3 and 0.2 respectively.
[0009] Further, in step S3, the determination of the weight λ is a linear mapping process based on the priority Pi: after calculating Pi through the dynamic weight formula, the specific value of λ is assigned in the range of 0.1-0.5 according to the value of Pi.
[0010] Further, in step S3, for fill-in-the-blank questions, search for a continuous blank area that meets the size requirement within the preset direction range of the fill-in-the-blank position, and the improved A* path planning algorithm is used for the search algorithm:
[0011] Wherein, g(a) is the actual path cost from the starting point to node a; h(a) is the estimated cost from node a to the target point; r(a) is the region continuity score, which is used to evaluate the appropriateness of the current region as the position of the correction element; ε is an adjustment coefficient, which is used to control the weight of the region continuity in the total score f(a); The optimal region found by the improved A* algorithm is the ideal position qi that needs to be approximated in the objective function; after calculating the ideal position qi, the actual optimal rendering position pi of the correction element is found through the rendering position optimization objective function.
[0012] Furthermore, in step S3, for subjective questions, firstly, an attention-weight-based segmentation algorithm is used to analyze the step structure of the subjective question answers and identify logical step nodes; then, the calculation is performed according to the following formula of the attention-weight-based segmentation algorithm:
[0013] Among them, A ij The attention weight of step i on step j is represented by , hi is the query vector, representing the step features of the currently analyzed step i; kj is the key vector, representing the step features to be matched; d is the dimension, used to control the magnitude of the dot product result; v is the total number of steps. The scaling factor is used to prevent the dot product result from becoming too large and causing the gradient to vanish; the normalized attention weight distribution is obtained through the above formula; Subsequently, nodes with excessively low attention weights are filtered out using a preset attention weight threshold. These nodes with excessively low attention weights correspond to missing steps. Find the largest continuous blank area near the location of the detected missing step, which is the ideal position qi that the corresponding correction element needs to approximate in the objective function; After calculating the ideal position qi, the actual best rendering position pi of the modified element is found by optimizing the rendering position objective function.
[0014] Furthermore, the above method also includes step S5: when a new annotation element is to be added to a certain area, collision detection is performed between that area and all existing annotation elements respectively. S5.1 Establish a collision detection mechanism between modified elements. Collision detection adopts the signed distance field algorithm:
[0015] Where p is the coordinate position of the current test point; q is the boundary of the grading element. The point on; The boundary of the element being reviewed; ||pq|| is the Euclidean distance between the two points. sgn(p) is the sign function, used to determine if point p is inside the element being reviewed; it returns -1 if p is inside the element and 1 if p is outside the element. min is used to calculate the minimum distance from point p to the boundary of the element being reviewed. When SDF(p) is less than a preset threshold, it indicates that the current point p has collided with the region of the element being reviewed. S5.2 When a positional conflict between two batch elements is detected, the rendering position is automatically adjusted according to the priority of the batch elements, and a suboptimal position is found for the batch element with lower priority or the collapsible display mode is enabled.
[0016] Furthermore, in step S4, for fill-in-the-blank questions, especially those with multiple consecutive blanks, guide lines are established between each grading element and each blank. The path of these guide lines is optimized using Bézier curves.
[0017] Where p k Let be the coordinates of the k-th control point (k=0,1,...,m), t∈[0,1]; t is the curve parameter, with a value range of [0,1]; m is the order of the Bézier curve; (mi) represents the binomial coefficient, equal to m! / (k!(mk)!); the above formula is used to generate a smooth guide line connecting the correction elements and multiple fill-in-the-blank positions; by adjusting control point p k Optimize the location of the connecting lines to avoid the content of the answer.
[0018] Furthermore, in step S4, for subjective questions, when the distance between the rendering position of the grading element and the position of the missing step exceeds a threshold, a guiding connection line is generated between the grading element and the position of the missing step; the guiding connection line adopts a broken line path that avoids the answer content, and the broken line path optimization adopts a reinforcement learning-based strategy:
[0019] in, Describe the action to be selected in state s The probability of; Let be the action value function, which evaluates the action to be taken in state s. The expected return; τ is used to control the exploratory nature of the strategy, the larger τ is, the more random the choice, the smaller τ is, the more certain the choice; A is the set of all possible actions in the current state.
[0020] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0021] The present invention also provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the above-described method.
[0022] The beneficial effects of this invention are as follows: (1) This invention accurately identifies the available space in a document through a blank heatmap algorithm, providing the optimal layout basis for correction marks; (2) This invention uses a dynamic weighting formula and an optimized objective function to ensure a reasonable distribution of the elements to be graded and to avoid overlap. (3) The present application designs special rendering strategies for different question types (fill-in-the-blank questions, subjective questions, etc.), improving the readability of the correction traces; (4) The present application establishes a clear correspondence between the correction elements and the answer content through visual association technology, making it easier to understand; (5) The present application introduces a collision detection and adaptive adjustment mechanism to ensure clear correction results even in complex situations; (6) The present application improves the usability and user experience of the intelligent correction system, reduces the workload of teachers, and improves the learning efficiency of students. DETAILED DESCRIPTION
[0023] The present application will be further described below. It should be noted that the present embodiment is based on the technical solution, and detailed implementation methods and specific operation processes are given, but the protection scope of the present application is not limited to the present embodiment.
[0024] The present embodiment provides a homework correction trace rendering method, comprising the following steps: S1, identifying the distribution of answer areas and blank areas in the document to be corrected, wherein the distribution of blank areas is calculated by a blank heat map algorithm:
[0025] Where (x, y) is the pixel coordinate, (x i ,y i ) is the coordinate of the i-th answer element, n is the total number of answer elements; and σ is the Gaussian kernel parameter.
[0026] The above formula calculates the distance attenuation effect of each pixel point and all answer elements through a Gaussian function, and the lower the value of the generated heat map H(x, y) indicates that the position is more "blank". Through step S1, the best display position of the correction trace can be automatically calculated, avoiding the overlap of correction elements and student answer content, making the correction result clear and easy to read, avoiding the problem of messy annotations and blocking content, and realizing intelligent correction trace layout.
[0027] S2, determining the correction elements and their priorities that need to be rendered according to the correction results, and the priority of each correction element is calculated using the following dynamic weight formula:
[0028] Where T i is the error type weight, E i is the error severity, S i is the semantic association degree, 、 、 T i , E i , and Si The weight of the concept error, the weight of the calculation error, and the weight of the format error are adjustable coefficients.
[0029] For the value of Ti, the weight of the concept error = 1.0, the weight of the calculation error = 0.8, and the weight of the format error = 0.3. Ei is a 0-1 normalized value. The semantic correlation degree represented by Si is the correlation degree between the comment and the error point. Typical values of the coefficients are a = 0.5, b = 0.3, and g = 0.2.
[0030] For example, for an error point with a key concept error (T = 1.0) and a high severity (E = 0.9), and the semantic correlation degree between the comment and the error point is S = 0.8, the priority P = 0.5 x 1.0 + 0.3 x 0.9 + 0.2 x 0.8 = 0.93.
[0031] S3. Based on the blank area distribution obtained in step S1 and the priority of each correction element obtained in step S2, the optimal rendering position of each correction element is calculated, and the rendering position optimization objective function is:
[0032] where d is a distance function, o is an overlap penalty term, and l is an adjustment parameter; d(pi, qi) represents the distance (usually in Euclidean distance) between the optimal rendering position pi of the correction element i and the ideal position qi; o(pi, pj) represents the overlapping area between the optimal rendering position pi of the correction element i and the optimal rendering position pj of the correction element j; and wi represents the priority weight l of the i-th correction element, usually taking a value of 0.1-0.5. Specifically, the determination of the weight l is a linear mapping process based on the priority Pi: after calculating Pi through the dynamic weight formula, the specific value of l is assigned in the range of 0.1-0.5 according to the value of Pi, to ensure that important correction elements obtain better display effects.
[0033] The above function is realized by minimizing the sum of two terms, including the total cost of all correction elements deviating from their ideal positions, and the overlap penalty between all correction elements. For example, when l = 0.3, the overlap is preferentially reduced rather than the perfect position.
[0034] Specifically, in this embodiment, for fill-in-the-blank questions, a continuous blank area that meets the size requirement is searched within the preset direction range of the fill-in-the-blank position, and the search algorithm uses an improved A* path planning:
[0035] where g(a) is the actual path cost from the start point to node a; h(a) is the estimated cost from node a to the target point; r(a) is the regional continuity score for evaluating the suitability of the current region as the location of the correction element; and ε is an adjustment coefficient for controlling the weight of the regional continuity in the total score f(a) (usually 0.1-0.5).
[0036] For fill-in-the-blank questions, the optimal region found by the improved A* algorithm is the ideal position qi that needs to be approximated in the objective function.
[0037] The above algorithm adds a regional continuity score item to the traditional A* path planning, so that the search process not only considers the path length, but also considers the continuity of the placement region of the correction element. For example, when ε = 0.3, a continuous blank region is preferred to an absolutely shortest path.
[0038] Specifically, in the present embodiment, for subjective questions, first, a segmentation algorithm based on attention weight is used to analyze the step structure of the answers to the subjective questions and identify the logical step nodes; then the following formula of the segmentation algorithm based on attention weight is used for calculation:
[0039] where A ij represents the attention weight of step i to step j, hi is a query vector representing the step characteristics of the current step i being analyzed; kj is a key vector representing the step characteristics to be matched; d is a dimension for controlling the magnitude of the dot product result; and v is the total number of steps. is a scaling factor to prevent the dot product result from being too large and causing gradient disappearance. The above formula is used to obtain a normalized attention weight distribution.
[0040] Subsequently, a pre-set attention weight threshold is used to screen out nodes with excessively low attention weight, and these nodes with excessively low attention weight correspond to missing step links.
[0041] The maximum continuous blank region near the position of the detected missing step link is found as the ideal position qi that needs to be approximated in the objective function for the corresponding correction element.
[0042] After the ideal position qi is calculated, the objective function is optimized by rendering the position, so that the actual best rendering position pi of the correction element can be found while taking into account the global layout and avoiding overlap.
[0043] S4, render each correction element at its determined rendering position, and establish a visual association between each correction element and the corresponding answer content.
[0044] In this embodiment, for fill-in-the-blank questions, and when there are continuous multiple blanks in the fill-in-the-blank question, a guide connection line is established between each correction element and each blank, and the path of the connection line is optimized by a Bezier curve:
[0045] where p k is the kth control point coordinate (k = 0, 1, …, m), t ∈ [0, 1]; t is a curve parameter, and the value range is [0, 1]; m is the order of the Bezier curve (the number of control points minus 1); (m-i) represents the binomial coefficient, which is equal to m! / (k!(m-k)!)). The above formula is used to generate a smooth guide line connecting the correction element and the position of multiple blanks. By adjusting the position of the control point p k , the path of the connection line can be optimized to avoid the answer content and maintain aesthetics.
[0046] In this embodiment, for subjective questions, when the rendering position of the correction element is more than a threshold distance away from the position of the missing step link, a guide connection line is generated between the correction element and the position of the missing step link; the guide connection line adopts a polyline path that avoids the answer content, and the polyline path optimization adopts a strategy based on reinforcement learning:
[0047] where, represents the probability of selecting action in state s; is the action value function, which evaluates the expected return of taking action in state s; τ is used to control the exploratory nature of the policy (the larger τ is, the more random the selection is, and the smaller τ is, the more deterministic the selection is); A is the set of all possible actions in the current state.
[0048] Through the above process, when the correction element and the position of the missing step link are far apart, a guide connection line is automatically generated to connect the two, while avoiding the answer content.
[0049] In this embodiment, the method further includes step S5: when a new annotation element is to be added in a certain area, collision detection is performed between the area and all existing annotation elements respectively: S5.1, a collision detection mechanism is established between the correction elements, and the collision detection adopts a signed distance field algorithm:
[0050] where p is the coordinate position of the current test point; q is a point on the boundary of the correction element (such as a point on the outer contour of a certain correction element); `|pq||` represents the boundary of the comment element (such as the outer edge of a comment text box); `||pq||` represents the Euclidean distance between the two points. `sgn(p)` is a sign function used to determine if point p is inside the comment element; it returns -1 if p is inside and 1 if p is outside. `min` calculates the minimum distance from point p to the boundary of the comment element. When `SDF(p)` is less than a preset threshold, it indicates that the current point p has collided with the region of the comment element.
[0051] The algorithm described above can accurately calculate the spatial relationship between the modified elements, which is more accurate than traditional rectangular collision detection and is particularly suitable for handling irregularly shaped modification marks.
[0052] S5.2 When a positional conflict between two batch elements is detected, the rendering position is automatically adjusted according to the priority of the batch elements, and a suboptimal position is found for the batch element with lower priority or the collapsible display mode is enabled.
[0053] The above steps can solve the problem of overlapping correction marks in the document. Through intelligent collision detection and automatic adjustment mechanism, it can ensure that different correction elements (such as comments, correction elements, etc.) can be clearly displayed and do not interfere with each other.
[0054] For example, when placing a new correction element in the region at coordinates (150, 300), the minimum SDF value between this region and all existing correction elements is calculated; if the SDF value is less than the safety threshold (e.g., 20 pixels), it is considered a collision; at this time, based on the priority of the two, the nearest available blank space is found for the correction element with lower priority.
[0055] For those skilled in the art, various corresponding changes and modifications can be made based on the above technical solutions and concepts, and all such changes and modifications should be included within the protection scope of the claims of this invention.
Claims
1. A method for rendering homework correction traces, characterized in that, Includes the following steps: S1. Identify the distribution of answer areas and blank areas in the document to be graded, where the distribution of blank areas is calculated using a blank heatmap algorithm: Where (x,y) are pixel coordinates, (x i ,y i ) represents the coordinates of the i-th responding element, n represents the total number of responding elements, and σ represents the Gaussian kernel parameter; S2. Based on the revision results, determine the revision elements that need to be rendered and their priorities. The priority of each revision element is calculated using the following dynamic weight formula: Among them, T i For error type weights, E i S represents the severity of the error. i For semantic relevance, , , T respectively i E i S i The weight is an adjustable coefficient; S3. Based on the blank area distribution obtained in step S1 and the priority of each batched element obtained in step S2, calculate the optimal rendering position of each batched element. The objective function for optimizing the rendering position is: Where d is the distance function, o is the overlap penalty term, and λ is the adjustment parameter; d(pi,qi) represents the distance between the best rendering position pi and the ideal position qi of the modified element i; o(pi,pj) represents the overlap area between the best rendering position pi of the modified element i and the best rendering position pj of the modified element j; wi represents the priority weight λ of the i-th modified element. S4. Render each correction element in its determined optimal rendering position and establish a visual association between each correction element and the corresponding answer content.
2. The method according to claim 1, characterized in that, In step S2, for the value of Ti, the weight of conceptual error = 1.0, the weight of computational error = 0.8, and the weight of formatting error = 0.3; Ei is a 0-1 standardized value; the semantic relevance represented by Si is the degree of correlation between the comment and the error. , , Typical values are α=0.5, β=0.3, γ=0.
2.
3. The method according to claim 1, characterized in that, In step S3, the determination of the weight λ is a linear mapping process based on the priority Pi: after calculating Pi through the dynamic weight formula, a specific value is assigned to λ in the range of 0.1-0.5 according to the value of Pi.
4. The method according to claim 1, characterized in that, In step S3, for fill-in-the-blank questions, a continuous blank area that meets the size requirements is searched within a preset directional range of the fill-in-the-blank position. The search algorithm uses an improved A* path planning method. Where g(a) is the actual path cost from the starting point to node a; h(a) is the estimated cost from node a to the target point; r(a) is the region continuity score, used to assess the suitability of the current region as a location for the correction element; ε is the adjustment coefficient, used to control the weight of region continuity in the total score f(a); The optimal region found by the improved A* algorithm is the ideal position qi that needs to be approximated in the objective function. After calculating the ideal position qi, the objective function is optimized by rendering position to find the actual best rendering position pi of the modified element.
5. The method according to claim 1, characterized in that, In step S3, for subjective questions, firstly, an attention-weight-based segmentation algorithm is used to analyze the step structure of the subjective question answers and identify logical step nodes; then, the calculation is performed according to the following formula of the attention-weight-based segmentation algorithm: Among them, A ij The attention weight of step i on step j is represented by: hi is the query vector, representing the step features of the currently analyzed step i; kj is the key vector, representing the step features to be matched; d is the dimension, used to control the magnitude of the dot product result; v is the total number of steps. The scaling factor is used to prevent the dot product result from becoming too large and causing the gradient to vanish; the normalized attention weight distribution is obtained through the above formula; Subsequently, nodes with excessively low attention weights are filtered out using a preset attention weight threshold. These nodes with excessively low attention weights correspond to missing steps. Find the largest continuous blank area near the location of the detected missing step, which is the ideal position qi that the corresponding correction element needs to approximate in the objective function; After calculating the ideal position qi, the actual best rendering position pi of the modified element is found by optimizing the rendering position objective function.
6. The method according to claim 1, characterized in that, It also includes step S5: When a new annotation element is to be added to a certain area, collision detection is performed between that area and all existing annotation elements. S5.1 Establish a collision detection mechanism between modified elements. The collision detection adopts the signed distance field algorithm: Where p is the coordinate position of the current test point; q is the boundary of the grading element. The point on; The boundary of the element being reviewed; ||pq|| is the Euclidean distance between the two points. sgn(p) is the sign function, used to determine if point p is inside the element being reviewed; it returns -1 if p is inside the element and 1 if p is outside the element. min is used to calculate the minimum distance from point p to the boundary of the element being reviewed. When SDF(p) is less than a preset threshold, it indicates that the current point p has collided with the region of the element being reviewed. S5.2 When a positional conflict between two batch elements is detected, the rendering position is automatically adjusted according to the priority of the batch elements, and a suboptimal position is found for the batch element with lower priority or the collapsible display mode is enabled.
7. The method according to claim 1, characterized in that, In step S4, for fill-in-the-blank questions, especially those with multiple consecutive blanks, guide lines are established between each grading element and each blank. The path of these guide lines is optimized using Bézier curves. Where p k Let be the coordinates of the k-th control point (k=0,1,...,m), t∈[0,1]; t is the curve parameter, with a value range of [0,1]; m is the order of the Bézier curve; (mi) represents the binomial coefficient, equal to m! / (k!(mk)!); the above formula is used to generate a smooth guide line connecting the correction elements and multiple fill-in-the-blank positions; by adjusting control point p k Optimize the location of the connecting lines to avoid the content of the answer.
8. The method according to claim 1, characterized in that, In step S4, for subjective questions, when the distance between the rendering position of the grading element and the position of the missing step exceeds a threshold, a guiding connection line is generated between the grading element and the position of the missing step. This guiding connection line uses a polygonal path that avoids the answer content, and the polygonal path optimization employs a reinforcement learning-based strategy. in, Describe the action to be selected in state s The probability of; Let be the action value function, which evaluates the action to be taken in state s. The expected return; τ is used to control the exploratory nature of the strategy, the larger τ is, the more random the choice, the smaller τ is, the more certain the choice; A is the set of all possible actions in the current state.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.
10. A computer device, characterized in that, It includes a processor and a memory, the memory being used to store a computer program; the processor being used to execute the computer program to implement the method of any one of claims 1-8.