Intelligent homework correcting method based on geometric proof question
By constructing a directed acyclic graph (DAG) using edge detection, optical character recognition, and a large language model, the problem of custom angle annotation and logical structure alignment in geometric proof problems was solved, achieving efficient and accurate grading results and improving the understanding ability and logical rigor of the automatic grading system for geometric proof problems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING NORMAL UNIV AT ZHUHAI
- Filing Date
- 2026-01-07
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies struggle to accurately identify student-defined angle annotations and achieve semantic consistency between text and image angles in automatic grading of geometry proofs. They also lack the ability to formally align students' logical structures with teachers' standard answers, making it difficult to judge the completeness and rationality of the logical chain during the grading process.
Edge detection and optical character recognition technologies are used to extract geometric edges and letter annotation information from images to construct a graph structure data model. A large language model is used to perform structured parsing of standard answers to construct a directed acyclic graph (DAG). Custom angle annotations are converted into standard expression forms through semantic analysis and mapping techniques, and path matching is performed in the DAG to determine the logical derivation path of students' answers.
It achieves accurate recognition and semantic consistency of student-defined angle annotations, and can efficiently and accurately parse the logical reasoning path of student proof texts, improving the accuracy of grading and logical judgment ability, and reducing recognition errors caused by inconsistencies in handwriting style and reasoning order.
Smart Images

Figure CN121963240A_ABST
Abstract
Description
An intelligent homework grading method based on geometry proof problems Technical Field
[0001] This invention relates to the fields of computer vision, semantic parsing of large language models, and graph structure logic derivation, specifically to an intelligent grading method for geometric proof problems, applicable to online education platforms and automatic grading systems for geometric proof problems. Background Technology
[0002] Currently, the development of intelligent and automated education is profoundly changing traditional teaching and assessment models, especially in primary and secondary school mathematics teaching. Automated assessment technology is gradually becoming an important means to reduce teachers' workload and improve teaching efficiency. Although existing automated grading systems are relatively mature in objective question types such as multiple choice and fill-in-the-blank questions, automation is still in the initial exploration stage in the field of more subjective geometric proof questions. In the process of automated grading of geometric proof questions, students' answers often include two parts: graphical annotations and written text. In the graphical part, students often make handwritten annotations on the geometric diagrams given in the question, such as adding custom angle names like ∠1 and ∠x, and referencing these annotations in the written proof. The text part includes several reasoning statements, forming a logical causal chain that gradually derives from known conditions to the conclusion. Although this answering method is flexible, it also brings significant challenges to automated grading, especially in two aspects: the accurate interpretation and unified representation of angle information in the diagrams, and the automatic extraction and verification of the logical structure in the student's proof text.
[0003] In terms of image analysis, most current automated geometry grading systems employ image processing methods such as edge detection, template matching, and connected component analysis to attempt to extract angle symbols and names annotated by students in the images. However, due to varying handwriting styles among students, annotations may exhibit issues such as symbol distortion, positional drift, and irregularity. Traditional methods often struggle to accurately identify the position and name of angles in the image and find it difficult to associate angles in the image with angle references in textual proofs. Further complicating matters, the same angle may correspond to different names in different expressions, such as ∠A, ∠BAC, and ∠EAD. The lack of a unified semantic normalization mechanism leads to failure in image-text alignment, making it impossible to accurately establish angle reference relationships. In recent years, although large-scale visual models have made significant progress in image understanding, they still have significant limitations in geometric scenarios, mainly manifested in: easy loss of local attention, inability to accurately capture small angle symbols; lack of geometric semantic normalization ability for diverse angle names; and weak image-text alignment ability, making it difficult to accurately bind angle names to graphical targets. These problems directly affect the complete reconstruction of subsequent logical reasoning structures.
[0004] In extracting logical causal structures, traditional methods often employ keyword matching, rule templates, or shallow natural language processing techniques to identify geometric reasoning statements in student proof texts. These methods rely on predefined statement templates, and are prone to matching failures and broken reasoning chains when faced with varying student language styles, missing reasoning steps, or changes in the order of reasoning steps. Although pre-trained language models (such as BERT and T5) and large language models (such as GPT and GLM) have made breakthroughs in semantic understanding in recent years, these models are still primarily based on sequential modeling and lack the ability to structurally map and verify causal derivation paths in geometric logic. When dealing with multi-step reasoning, implicit premises, or equivalent transformations, they are prone to the illusion of "semantically correct but logically incorrect." More seriously, most current grading systems lack the ability to formally align student logical structures with teachers' standard answers. Even if some student reasoning nodes can be extracted, it is difficult to determine whether they constitute a valid path that starts from the given conditions, follows geometric theorems, and gradually derives the conclusion.
[0005] In summary, existing technologies face two major challenges in the automatic grading of geometric proofs: firstly, they lack a mechanism capable of robustly recognizing student-defined angle annotations in figures and achieving semantic normalization, making it difficult to accurately align graphic and textual angle entities; secondly, they lack the ability to model the proof process as a verifiable reasoning path structure, resulting in the inability to accurately judge the completeness and rationality of the logical chain during the grading process. These shortcomings significantly affect the reliability, interpretability, and applicability of automatic grading systems in geometric scenarios. Summary of the Invention
[0006] To address the core bottlenecks in existing technologies regarding image-text alignment and logical reasoning verification, this invention provides an intelligent grading method for geometric proof problems. This method can efficiently and accurately parse the custom angle names in students' graphic annotations, unify the semantic expression of angles, and perform structured analysis on students' written proof texts to extract logical derivation paths. This allows the method to determine whether the proof constitutes a valid reasoning chain from the given conditions to the conclusion, significantly improving the ability to understand students' custom annotations and the ability to structurally judge logical reasoning chains.
[0007] This invention achieves the above objectives through the following technical solution: an intelligent homework grading method based on geometric proof questions, comprising the following steps: Question image parsing step: preprocessing the input geometric proof question image, extracting the geometric edge features of the preprocessed image using edge detection technology, detecting letter annotation information in the image using optical character recognition technology, and simultaneously extracting line segment information in the image using a line detection algorithm, thereby constructing a graph structure data model that at least includes letter annotation positions, pixel coordinates, and collinear relationships; Reference answer structured parsing step: receiving the standard answer text provided by the teacher, performing deep parsing of the standard answer using large language model technology in natural language processing, transforming each sentence of reasoning in the standard answer into a structured proof node, and extracting the logical premises and conclusion relationships between each proof node. A directed acyclic graph (DAG) is constructed, where nodes represent propositions and edges represent logical derivation relationships. The student answer semantic normalization step involves identifying custom angle annotations in the submitted student assignment images. Through semantic analysis and mapping techniques, combined with the constructed graph structure data model, the custom angle annotations are converted and matched with the standard three-point angle representation in the DAG, achieving unified and normalized angle semantics. The proof path matching judgment step involves structured parsing of the student's answer text input using a large language model to generate a set of proof propositions. The teacher then provides a DAG containing reference answers for path searching and matching to verify whether the student's answer constitutes a valid logical derivation path from the known conditions to the final conclusion. Finally, the grading results and feedback are output.
[0008] According to the present invention, an intelligent homework grading method based on geometric proof problems is provided. The preprocessing of the input geometric proof problem image includes: defining the input geometric proof problem image as... ,image After grayscale conversion and denoising, the Canny edge detection operator is used to extract the geometric edges of the image. The Canny edge detection operator includes the following steps: Image smoothing step: using a two-dimensional Gaussian kernel... Convolutional denoising of an image yields a smoothed image, expressed by the following formula:
[0009]
[0010] in, The standard deviation of the Gaussian kernel; Image gradient calculation steps: Apply the Sobel operator to... Convolutions are performed in different directions to obtain the gradient components, as shown in the following formula:
[0011] in, This represents the preprocessed image data; based on the calculated x and y gradient components, the gradient magnitude and direction of each pixel are calculated, expressed by the following formula:
[0012] Local maxima are determined for each pixel along the gradient direction. If the gradient magnitude of the current pixel is not a local maximum, the gradient magnitude of that pixel is set to 0 to remove pixels whose gradient changes are not the most significant. The double thresholding and edge connection steps involve setting two different thresholds: a high threshold and a low threshold. and low threshold These two thresholds are used to classify edge points into three categories: strong edges, weak edges, and non-edges. Weak edge points connected to strong edges are then connected using a neighborhood search and connectivity-based method: starting from a strong edge point, weak edge points are searched within its neighborhood. If a weak edge point and a strong edge point satisfy a certain connectivity condition, they are connected, resulting in a closed, continuous edge map. Its calculation expression is:
[0013] Where I(x,y) is the original image, and σ is the standard deviation of the Gaussian kernel used in image smoothing.
[0014] According to the present invention, an intelligent grading method for geometric proof problems is provided, wherein the method for detecting letter annotation information in an image using optical character recognition technology includes: using PaddleOCR recognition technology to detect all letter annotations in the input image and outputting a set of all letter annotation points. Each letter is marked with a point. Including letter annotations Its corresponding center pixel coordinates , represented as The OpenCV module's line detection method based on probabilistic Hough transform is used to extract structure from the same image, obtaining a set of all possible line segment candidates. Each line segment Represented as a line connecting two endpoints, with the endpoint coordinates as follows: For each line segment in the candidate set L Perform nearest neighbor matching on the two endpoints, targeting The endpoints of the two line segments In the set of labeled letter points P, find the labeled point with the smallest distance to each of them. and By calculating the Euclidean distance To determine the matching relationship, it is represented as:
[0015] The marked point with the smallest distance to the line segment endpoint after the nearest neighbor matching operation. and points Connecting these lines forms geometric line segments, which involves associating the endpoints of the line segments with the nearest letter labels, thus establishing a correspondence between line segments and letter labels in the image.
[0016] According to the present invention, an intelligent grading method for geometric proof problems is provided, wherein the method for extracting line segment information from an image using a line detection algorithm includes: identifying all possible collinear point sets in the image, for each line segment... The corresponding set of endpoints Construct its standard straight line equation by substituting the coordinates of the endpoints of the line segment into relevant calculations to determine the coefficients A, B, and C in the equation; and for all points To determine the distance point by point, the formula for calculating the perpendicular distance from a point to a line is used:
[0017] If the perpendicular distance from a point to the line is less than a set threshold ε, then the point is considered collinear with the line segment; all points that meet the collinearity criteria are added to the collinear point set of the line segment. In the end, each line segment can be represented as:
[0018] Among them, a m b m p is the endpoint of the line segment. i p j G is a letter label point that matches the endpoints of a line segment. m Let be the set of collinear points.
[0019] According to the present invention, an intelligent homework grading method based on geometric proof problems is provided, which constructs a directed acyclic graph (DAG) structure. The method includes the following steps: The teacher provides the standard answer text for the geometric proof, which is typically a multi-step reasoning process described in natural language. First, the standard answer text is preprocessed. Then, a large language model is used to perform structured parsing on the preprocessed standard answer text, transforming each sentence of reasoning in the standard answer text into a structured proof node. The logical premises and conclusion relationships between each proof node are extracted, and a directed acyclic graph (DAG) structure is constructed. In the constructed DAG, the graph structure... ,in The set of proof nodes contains all propositional nodes extracted from the answer text. It is a set of logical derivation edges, which accurately records the derivation relationships between proposition nodes.
[0020] According to the present invention, an intelligent homework grading method based on geometric proof problems is provided, which determines whether a graph structure is a valid acyclic graph based on Kahn's topological sorting algorithm, including the following steps: For a given graph structure Define the in-degree of each node as , is represented as:
[0021] Among them, nodes The degree refers to the number of directed edges in a graph structure that terminate at vertex v. This definition accurately quantifies the prerequisite dependencies of each node in the graph structure. A queue Q and a list L for recording the sorting results are initialized. Queue Q stores nodes with an in-degree of 0, serving as the starting set of nodes for topological sorting. List L records the order of nodes after topological sorting. The process then proceeds in a loop until... In each loop: from the queue Extracting nodes And add it to the sorted results list. In the process, nodes are selected sequentially according to their in-degree of 0; for each node... All adjacent nodes Perform an in-degree update operation:
[0022] If the in-degree of node u is updated Then the node Add to queue In the middle; after the loop ends, the validity of the graph structure is determined by comparing the length of the sorted result list L with the size of the proof node set V in the graph structure; if the final If |L| = |V|, it means that all nodes in the graph structure have undergone topological sorting and there are no cycles, making the graph structure a valid DAG; if |L| = |V|, it means that there are cycles in the graph structure, making it an illegal DAG.
[0023] According to the present invention, an intelligent grading method for geometric proof problems is provided. In the semantic normalization step of student answers, for each custom corner annotation in the student's submitted homework image, the PaddleOCR module is used to identify the annotation text box and output the center point position of the text box. For all letter marking points By calculating the distance, the center point of the distance angle label is selected. The most recent vertex used as the labeled angle , is represented as:
[0024] Then, filter from the set of line segments in the image all segments starting with a vertex. Line segments with endpoints form a candidate line segment set. , is represented as:
[0025] Construct the direction vector of the angle label , is used to represent the directional characteristics of corner annotations.
[0026] According to the present invention, an intelligent grading method for assignments based on geometric proof problems is provided, which processes candidate line segment sets. Construct a direction vector for each line segment in the diagram. and according to The sign of the value determines whether the line segment is placed into two separate line segment sets. , By performing a dot product operation on the direction vectors, line segments are grouped according to their relationship with the angle label direction; from and Find the points that are marked in each of these two sets. The two line segments with the smallest distance are used as the two line segments that enclose the labeled angle. , is represented as: ,
[0027] In the set of collinear points of two line segments, choose the same three-point letter representation as in the reference answer to describe the angle; if there is no angle representation that is the same as in the reference answer, then choose the vertex and the other endpoint of the two line segments to form the angle representation.
[0028] According to the present invention, an intelligent homework grading method based on geometric proof problems is provided. In the proof path matching determination step, the graph structure DAG constructed by the teacher's reference answer is obtained, and the conclusion node is identified as R. At the same time, the set of student question-asking nodes obtained from the student's answer parsing is set as R. The system performs a reverse breadth-first search, starting from the conclusion node. Starting from the beginning, we traverse each premise edge in reverse in the DAG and backtrack along the path; during the backtracking process, we rely on the large language model to determine whether all nodes on the current path can be found in the set of student-generated problem nodes. Find the equivalent match.
[0029] According to the present invention, an intelligent grading method for geometric proof problems is provided. The grading is marked according to the path matching results: if a path is found in the graph structure DAG where all nodes can be found to be equivalently matched in the student's problem node set, i.e., a complete match, then the student's proof process is judged to be correct and marked as correct; if no such complete matching path exists, then the proof process is judged to be incorrect, and the system further outputs the proposition with missing premises, clearly marking it as an incorrect proof process, and pointing out the key steps that caused the error.
[0030] Therefore, compared with existing technologies, the intelligent grading method and system for geometric proof problems proposed in this invention have the following beneficial effects: 1. This invention, through image understanding technology, can accurately identify various elements in a graphic, unify the angle semantics of different expressions using angle semantic normalization, and clarify the logical relationships in textual reasoning through logical structure reasoning mechanisms. Therefore, this invention integrates image understanding, angle semantic normalization, and logical structure reasoning technologies, possessing the ability to efficiently handle the diversity and complexity of students' handwritten graphic annotations and textual reasoning content in geometric proof problems.
[0031] 2. In practical applications, this invention supports the correction processing of mixed text and image inputs. It can accurately extract corner annotations from images. After identifying the corner annotations, this invention uses geometric semantic modeling to normalize and map them to standard angles. This unifies these different expressions into a standard semantic representation, establishing an accurate correspondence between custom corner annotations and standard angles. This avoids correction errors caused by inconsistent angle expressions and improves correction accuracy. This invention overcomes the impact of these differences through image processing and recognition algorithms, accurately locating and identifying custom corner annotations in images, providing accurate basic data.
[0032] 3. Based on the language understanding ability of large models and the graph structure reasoning mechanism, this invention can parse students' answers into a sequence of reasoning nodes. Students' proof answers are usually presented in the form of natural language and contain multiple reasoning steps. This invention understands natural language through large language models, transforms each reasoning step into a reasoning node, and forms an ordered sequence of nodes, structuring the students' complex proof process, which is convenient for subsequent analysis and verification.
[0033] 4. After parsing the student's answer into a sequence of reasoning nodes, this invention performs path matching with the directed acyclic graph formed by the teacher's reference answer, automatically determining the completeness of the reasoning chain and the reachability of the conclusion. The teacher's reference answer is presented in the form of a directed acyclic graph, where each node represents a proposition and edges represent logical derivation relationships. The path matching algorithm determines whether the sequence of reasoning nodes in the student's answer can form a valid path from the known conditions to the final conclusion. If a complete match is achieved, the student's proof process is considered reasonable; otherwise, problems in the proof process can be accurately identified, such as missing premises or incorrect reasoning order.
[0034] 5. Compared with traditional template matching or keyword recognition methods, this invention effectively reduces recognition and judgment errors caused by diverse handwritten annotation methods, flexible language expressions, and inconsistent reasoning sequences. Traditional methods rely on predefined templates or keywords, which can easily lead to recognition errors when students' answers do not perfectly match the template or use different keywords. This invention, by integrating multiple technologies, can adapt to various student answer styles and accurately understand their intentions, thereby greatly reducing recognition and judgment errors.
[0035] In summary, this invention achieves high accuracy while keeping the grading latency below 200 milliseconds. In education, timely feedback is crucial for student learning; rapid grading allows students to understand their progress and adjust their learning strategies accordingly. This invention, through optimized algorithms and efficient processing, achieves fast and accurate grading, meeting the needs of practical teaching applications. This invention significantly improves the comprehension, logical rigor, and overall performance of the automatic grading system for geometry proofs. By integrating multiple advanced technologies, the system can more deeply understand students' answers, accurately grasp the logical relationships, and thus make more reasonable grading judgments. Compared to traditional automatic grading systems, this invention represents a qualitative improvement in accuracy, reliability, and adaptability.
[0036] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0037] Figure 1 is a flowchart of an embodiment of an intelligent homework grading method based on geometric proof problems according to the present invention.
[0038] Figure 2 is a schematic diagram of an embodiment of an intelligent homework grading method based on geometric proof problems according to the present invention.
[0039] Figure 3 is a flowchart of the preprocessing of geometric proof problem images in an embodiment of the intelligent homework grading method based on geometric proof problems of the present invention.
[0040] Figure 4 is a flowchart illustrating the detection of letter annotation information in an image using optical character recognition technology in an embodiment of an intelligent homework grading method based on geometric proof problems according to the present invention.
[0041] Figure 5 is a flowchart illustrating the extraction of line segment information from an image using a line detection algorithm, as described in an embodiment of an intelligent homework grading method based on geometric proof problems according to the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0043] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0044] An embodiment of an intelligent homework grading method based on geometric proof problems is shown in Figures 1 and 2. This embodiment provides an intelligent homework grading method based on geometric proof problems, including: Problem image parsing step: Preprocessing the input geometric proof problem image, extracting the geometric edge features of the preprocessed image using edge detection technology, detecting letter annotation information in the image using optical character recognition technology, and extracting line segment information in the image using a line detection algorithm, thereby constructing a graph structure data model that at least includes letter annotation positions, pixel coordinates, and collinear relationships; Reference answer structured parsing step: Receiving the standard answer text provided by the teacher, using large language model technology in natural language processing to deeply parse the standard answer, transforming each sentence of reasoning in the standard answer into a structured proof node, and extracting the logical premises between each proof node. The relationship between propositions and conclusions is constructed using a directed acyclic graph (DAG), where nodes represent propositions and edges represent logical derivations. The semantic normalization step for student answers involves identifying custom angle annotations in student-submitted assignment images. Through semantic analysis and mapping techniques, combined with the constructed DAG data model, these custom angle annotations are converted and matched with the standard three-point angle representation in the DAG, achieving semantic unification and normalization. The proof path matching and judgment step involves structured parsing of the student's text input using a large language model to generate a set of proof propositions. The teacher then uses a DAG containing reference answers to perform path searching and matching, verifying whether the student's answer constitutes a valid logical derivation path from the known conditions to the final conclusion. Finally, the grading results and feedback are output.
[0045] In this embodiment, the custom angle annotations are converted into a standard triangular representation in the graph structure for association and matching. This includes: locating the corresponding vertex and edge information in the graph structure data model based on the center pixel coordinates of the custom angle annotations; determining the standard triangular representation of the custom angle annotations through the collinearity of the vertices and edges; and uniformly converting all custom angle annotations into a standardized triangular representation to achieve the unification and normalization of angle semantics.
[0046] In this embodiment, path search and matching are performed in the DAG logical structure. This includes using geometric constraints (such as collinearity and angular equivalence) in the graph data model to verify the geometric validity of propositions in the student's answer; searching backwards in the DAG logical structure for valid paths from the conclusion node to the known condition node, and determining whether the student's answer covers all key proposition nodes on the path; if a complete matching path exists, the student's answer is determined to be correct; otherwise, missing or incorrect proposition nodes are marked, and the grading results and feedback are output.
[0047] In the above image parsing steps, as shown in Figure 3, the input geometric proof problem image is preprocessed, including: defining the input geometric proof problem image as... ,image After grayscale conversion and denoising, the Canny edge detection operator is used to extract the geometric edges of the image. The Canny edge detection operator includes the following steps: Image smoothing step: using a two-dimensional Gaussian kernel... Convolutional denoising of an image yields a smoothed image, expressed by the following formula:
[0048]
[0049] in The standard deviation of the Gaussian kernel is typically set to 1.0 to 1.4. Through preset numerical constraints, it is ensured that the calculation of the Gaussian kernel G(x,y) and the convolution operation in subsequent image smoothing are based on the σ value within this specific range, so as to ensure the stability and applicability of the smoothing effect.
[0050] Image gradient calculation steps: Apply the Sobel operator to... Convolutions are performed in different directions to obtain the gradient components. Specifically, in the x-direction, convolution operations are performed using the Sobel operator matrix:
[0051] In the y-direction, convolution is performed using the Sobel operator matrix:
[0052] in, This represents the preprocessed image data; based on the calculated x and y gradient components, the gradient magnitude and direction of each pixel are calculated, expressed by the following formula:
[0053] Among them, using the formula The formula is used to calculate the gradient magnitude. It comprehensively considers the gradient components in both the x and y directions, accurately reflecting the intensity of brightness changes at each pixel. This is used to calculate the gradient direction and determine the direction of image brightness changes at each pixel.
[0054] The local maxima of a pixel are determined by comparing the gradient magnitudes of several neighboring pixels along the gradient direction. If the gradient magnitude of the current pixel is not a local maxima, the gradient magnitude of that pixel is set to 0 to remove pixels whose gradient changes are not the most significant, making the edges clearer and more precise, and highlighting the true edge pixels.
[0055] Dual thresholding and edge connection steps: Set two different thresholds, namely the high threshold... and low threshold These two thresholds are used to classify edge points into three categories: strong edges, weak edges, and non-edges; among them, the gradient magnitude is greater than the higher threshold T. H Pixels are identified as strong edge points; gradient magnitude is between the low threshold T. L and high threshold T H Pixels between these points are identified as weak edge points; the gradient magnitude is less than the low threshold T. L Pixels that are not strong edges are considered non-edge points. Weak edge points connected to strong edges are obtained using a neighborhood search and connectivity assessment method: starting from a strong edge point, weak edge points are searched within its neighborhood. If a weak edge point and a strong edge point satisfy certain connectivity conditions, such as being within a specified pixel distance and having a certain degree of continuity in the gradient direction, then the weak edge point and the strong edge point are connected, thus obtaining a closed continuous edge. The final output is an edge map. Its calculation expression is:
[0056] Where I(x,y) is the original image, and σ is the standard deviation of the Gaussian kernel used in image smoothing. This edge map provides accurate input for subsequent image processing operations such as Hough transform, ensuring that subsequent processing can be based on accurate edge information and improving the overall accuracy of image analysis and processing.
[0057] In the image parsing step, as shown in Figure 4, letter annotation information in the image is detected using optical character recognition technology. This includes: using PaddleOCR recognition technology to detect all letter annotations in the input image and outputting a set of all letter annotation points. Each letter is marked with a point. Including letter annotations Its corresponding center pixel coordinates , represented as The OpenCV module employs a line detection method based on probabilistic Hough transform to extract structure from the same image. The probabilistic Hough transform efficiently detects straight line structures in the image by sampling image edge information and performing parameter space voting, thus obtaining a set of all possible line segment candidates. Each line segment Represented as a line connecting two endpoints, with the endpoint coordinates as follows: For each line segment in the candidate set L Perform nearest neighbor matching on the two endpoints, targeting The endpoints of the two line segments In the set of labeled letter points P, find the labeled point with the smallest distance to each of them. and By calculating the Euclidean distance To determine the matching relationship, it is represented as:
[0058] The marked point with the smallest distance to the line segment endpoint after the nearest neighbor matching operation. and points Connecting these lines forms geometric line segments, which involves associating the endpoints of the line segments with the nearest letter labels, thus establishing a correspondence between line segments and letter labels in the image.
[0059] In the image parsing step, as shown in Figure 5, a line detection algorithm is used to extract line segment information from the image. This includes identifying all possible collinear points in the image, and the system performs this process for each line segment. The corresponding set of endpoints (where a) m =(x1,y1), b m =(x2,y2) represents the coordinates of the endpoints of the line segment. Construct its standard straight line equation (i.e., the general form Ax + By +C = 0). By substituting the coordinates of the endpoints into relevant calculations, determine the coefficients A, B, and C in the equation, thereby accurately describing the straight line containing the line segment and providing a mathematical foundation for subsequent collinearity determination; and for all points... (Including the letter 's') k Its corresponding center pixel coordinate q k That is, p k =(s k ,q k To determine the distance point by point, the formula for calculating the perpendicular distance from a point to a line is used:
[0060] If the perpendicular distance from a point to the line is less than a set threshold ε (e.g., 5 pixels), then the point is considered collinear with the line segment; all points that meet the collinearity criteria are added to the collinear point set of the line segment. In this process, each line segment not only contains its original endpoint information but also links to other collinear points, making the information of the line segment more complete and richer. Ultimately, each line segment can be represented as:
[0061] Among them, a m b m p is the endpoint of the line segment. i p j G is a letter label point that matches the endpoints of a line segment (based on the matching relationship). m Let be the set of collinear points.
[0062] Using the above method, this embodiment can perform high-precision modeling of all explicit point and line segment structures in the figure, generating complete graph structure data including letter labels, pixel positions and collinear relationships, providing basic input for subsequent angle semantic normalization and grading.
[0063] In the structured parsing step of the reference answer, a directed acyclic graph (DAG) is constructed, which includes the following steps: First, the teacher provides the standard answer text for the geometric proof. This text is usually a multi-step reasoning process described in natural language, such as "Since ∠A=∠B and ∠B=∠C, we get ∠A=∠C". The system first preprocesses the input text, including removing irrelevant characters and punctuation, to ensure the accuracy and efficiency of subsequent processing.
[0064] The preprocessed standard answer text is structured and parsed using a Large Language Model (LLM). Each sentence of reasoning in the standard answer text is treated as a proof node, and the causal relationship between logical premises and conclusions is extracted to construct a directed acyclic graph (DAG). In the constructed DAG, each node represents a proposition (e.g., "∠A=∠B"), and edges represent logical derivation relationships (i.e., the direction of derivation from one proposition to another). For example, if propositions P and Q jointly derive proposition R, then there are two directed edges in the DAG: one from P to R and the other from Q to R. The construction process involves building a Deepseek-R1 large language model from input prompts, where... The set of proof nodes contains all propositional nodes extracted from the answer text. It is a set of logical derivation edges, which accurately records the derivation relationships between proposition nodes.
[0065] In the structured parsing steps of the reference answer, the Kahn topological sorting algorithm is used to determine whether the graph structure is a valid acyclic graph. The execution process is as follows: For a given graph structure... Define the in-degree of each node as , is represented as:
[0066] Among them, nodes The degree refers to the number of directed edges in a graph structure that terminate at vertex v. This definition accurately quantifies the prerequisite dependencies of each node in the graph structure. A queue Q and a list L for recording the sorting results are initialized. Queue Q stores nodes with an in-degree of 0, serving as the starting set of nodes for topological sorting. List L records the order of nodes after topological sorting. The process then proceeds in a loop until... In each loop: from the queue Extracting nodes And add it to the sorted results list. In the process, nodes are selected sequentially according to their in-degree of 0, ensuring the logical order of the topological sort; for each node... All adjacent nodes Perform an in-degree update operation:
[0067] Since node v has been processed, the prerequisite dependencies of its neighbor node u have decreased, so the in-degree value of u is reduced accordingly; if the in-degree of node u is updated... Then the node Add to queue In the middle; after the loop ends, the validity of the graph structure is determined by comparing the length of the sorted result list L with the size of the proof node set V in the graph structure; if the final If |L| = |V|, it indicates that all nodes in the graph structure have undergone topological sorting and there are no cycles, making the graph structure a valid DAG. If |L| = |V|, it indicates that there are cycles in the graph structure, making it an invalid DAG. In the case of an invalid DAG, the system triggers a re-input mechanism, prompting the user to re-enter the relevant information for constructing the DAG graph using the large language model, so that the graph structure can be reconstructed and determined.
[0068] In the semantic normalization step of student answers, if there are custom angle labels in the student image (e.g., drawing an arc on ∠ABC and labeling it "1", and using "∠1" to replace "∠ABC" in the proof answer text), a mapping relationship between the custom angle labels and the standard three-point angle description will be established. The specific processing flow is as follows: For each custom angle label in the student's submitted assignment image, the PaddleOCR module is used to identify its label text box and output the center point position of the text box. For all letter marking points By calculating the distance, the center point of the distance angle label is selected. The most recent vertex used as the labeled angle , is represented as:
[0069] Then, filter from the set of line segments in the image all segments starting with a vertex. Line segments with endpoints form a candidate line segment set. , is represented as:
[0070] In this context, corner labels represent the angle formed by the line segments on either side of the label. Therefore, this embodiment needs to determine whether the two line segments "enclose" the corner label. First, the direction vector of the corner label is constructed. , is used to represent the directional characteristics of corner annotations.
[0071] Then, for the candidate line segment set Construct a direction vector for each line segment in the diagram. and according to The sign of the value determines whether the line segment is placed into two separate line segment sets. , By performing a dot product operation on the direction vectors, the line segments are grouped according to their relationship with the corner label direction, which makes it easier to filter the line segments that are sandwiched between the corner labels later.
[0072] from and Find the points that are marked in each of these two sets. The two line segments with the smallest distance are used as the two line segments that enclose the labeled angle. , is represented as: ,
[0073] From the set of collinear points of two line segments, a three-point letter representation (composed of points and vertices on the two line segments) identical to that in the reference answer is selected to describe the angle; if no angle representation identical to that in the reference answer exists, then a vertex and the other endpoint of the two line segments are selected to form the angle representation. This step converts the custom angle annotation into a standard three-point angle representation, achieving semantic normalization of angle annotations in student answers and providing a unified semantic basis for subsequent grading. Furthermore, the same method is used to normalize the semantics of other angle representations to be identical to those in the reference answer.
[0074] In the path matching determination step, the text input of the student's answer is structured and parsed using a Large Language Model (LLM), treating each proposition as a proof node and constructing a set of propositions. After obtaining the teacher's reference answer DAG and the student's proposition set, the system performs path search in the DAG to determine whether the student has completed the correct derivation path from the known conditions to the final conclusion. This step uses a graph path matching algorithm, the core objective of which is to determine whether there exists a path in the teacher's DAG where all nodes are covered by the student's answer.
[0075] In the path matching determination step, the DAG (Directed Acyclic Graph) constructed from the teacher's reference answer is obtained, and the conclusion node is defined as R. Simultaneously, the set of student question-asking nodes obtained from the student's answer analysis is set as... Perform a reverse breadth-first search (BFS) starting from the conclusion node. Starting from the beginning, we traverse each premise edge in reverse in the DAG and backtrack along the path; during the backtracking process, we rely on the large language model to determine whether all nodes on the current path can be found in the set of student-generated problem nodes. The system finds equivalent matches; the large language model performs equivalent matching judgments by semantically understanding and analyzing the student's question-asking nodes and the teacher's reference answer nodes, ensuring the accuracy and semantic consistency of the matching. In this way, the core objective of the system is to determine whether there exists a path in the teacher's DAG where all nodes are covered by the student's answer. Grading and labeling are based on the path matching results: if a path is found in the graph structure DAG where all nodes can find equivalent matches in the student's question-asking node set (i.e., a complete match), the student's proof is deemed correct and labeled as correct.
[0076] If no such perfect matching path exists, the proof process is deemed to contain an error. The system then outputs propositions with missing preconditions, clearly marking them as proof errors and pointing out the key steps that led to the errors, providing students with clear feedback and directions for improvement.
[0077] The grading results are fed back to users (such as students and teachers) so that students can understand the strengths and weaknesses in their proofs and make targeted learning and improvements; teachers can also use the grading results to understand students' learning progress and adjust their teaching strategies. Furthermore, the assessment results can be applied to teaching evaluation systems and other related applications, providing data support for the evaluation and improvement of teaching quality.
[0078] In summary, this invention, through image understanding technology, can accurately identify various elements in a graphic; utilizes angle semantic normalization to unify the angle semantics of different expressions; and leverages a logical structure reasoning mechanism to clarify the logical relationships in textual reasoning. For example, for student-defined angle annotations, regardless of their format, they can be accurately identified and normalized, thereby efficiently completing the analysis of complex answers. Therefore, this invention integrates image understanding, angle semantic normalization, and logical structure reasoning technologies, possessing the ability to efficiently handle the diversity and complexity of students' handwritten graphic annotations and textual reasoning in geometric proof problems.
[0079] In practical applications, this method supports the grading of mixed text and image inputs and can accurately extract corner annotations from images. Since students often use custom methods when annotating graphics, such as adding annotations like ∠1 and ∠x, and different handwriting styles can lead to differences in the shape and position of the annotations, this invention overcomes the impact of these differences through advanced image processing and recognition algorithms, accurately locating and recognizing custom corner annotations in the image, providing accurate basic data for subsequent processing. After recognizing the corner annotations, this invention normalizes and maps them to standard angles through geometric semantic modeling. The same angle may have multiple forms in different expressions, such as ∠A, ∠BAC, ∠EAD, etc. This invention can unify these different expressions into a standard semantic expression, establishing an accurate correspondence between custom corner annotations and standard angles, avoiding grading errors caused by inconsistent angle expressions, and improving the accuracy of grading.
[0080] Furthermore, based on the large-scale language understanding capability and graph structure reasoning mechanism, this invention can parse student answers into a sequence of reasoning nodes. The student's proof answer is typically presented in natural language, containing multiple reasoning steps. This invention uses a large-scale language model to understand natural language, transforming each reasoning step into a reasoning node, forming an ordered sequence of nodes. This structures the student's complex proof process, facilitating subsequent analysis and verification.
[0081] Furthermore, after parsing the student's answer into a sequence of reasoning nodes, this invention performs path matching with the directed acyclic graph formed by the teacher's reference answer, automatically determining the completeness of the reasoning chain and the reachability of the conclusion. The teacher's reference answer is presented in the form of a directed acyclic graph, where each node represents a proposition and edges represent logical derivation relationships. The path matching algorithm determines whether the sequence of reasoning nodes in the student's answer can form a valid path from the known conditions to the final conclusion. If a complete match is achieved, it indicates that the student's proof process is reasonable; otherwise, problems in the proof process can be accurately identified, such as missing premises or incorrect reasoning order.
[0082] Furthermore, compared to traditional template matching or keyword recognition methods, this invention effectively reduces recognition and grading errors caused by diverse handwritten annotation methods, flexible language expressions, and inconsistent reasoning sequences. Traditional methods rely on predefined templates or keywords, which can easily lead to recognition errors when students' answers do not perfectly match the template or use different keyword expressions. This invention, by integrating multiple technologies, can adapt to various student answer styles and accurately understand their intentions, thereby significantly reducing recognition and grading errors. In standard geometry proof scenarios, this invention achieves an accuracy rate exceeding 90%, significantly improving the reliability of grading.
[0083] Therefore, this invention maintains high accuracy while controlling the grading latency to within 200 milliseconds. In the field of education, timely feedback is crucial for student learning; rapid grading results allow students to understand their learning progress promptly and adjust their learning strategies. This invention achieves fast and accurate grading through optimized algorithms and efficient processing flows, meeting the needs of practical teaching applications. This invention significantly improves the comprehension, logical rigor, and overall performance of the automatic grading system for geometry proof problems. By integrating multiple advanced technologies, the system can more deeply understand students' answers, accurately grasp the logical relationships within them, and thus make more reasonable grading judgments. Compared with traditional automatic grading systems, the system of this invention has achieved a qualitative improvement in accuracy, reliability, and adaptability.
[0084] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0085] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. A method for intelligent grading of assignments based on geometric proof problems, characterized in that, Includes the following steps: The steps for parsing the problem image are as follows: The input geometric proof problem image is preprocessed, and edge detection technology is used to extract the geometric edge features of the preprocessed image. Optical character recognition technology is used to detect letter annotation information in the image, and a line detection algorithm is used to extract line segment information. This constructs a graph structure data model that includes at least the letter annotation positions, pixel coordinates, and collinear relationships. The steps for structuring the reference answer are as follows: The standard answer text provided by the teacher is received. Large language model technology in natural language processing is used to deeply parse the standard answer, transforming each sentence of reasoning in the standard answer into a structured proof node. The logical premises and conclusion relationships between each proof node are extracted, constructing a directed acyclic graph (DAG) structure, where the node table... The process involves several steps: First, the system presents propositions and uses edges to represent logical derivation relationships. Second, it normalizes student answers by identifying custom angle annotations in student-submitted assignment images. Through semantic analysis and mapping techniques, combined with a constructed graph structure data model, these custom angle annotations are converted and matched with the standard three-point angle representation in the DAG (Directed Acyclic Graph), achieving semantic unification and normalization. Third, it determines the proof path matching process by performing structured parsing of the student's text input using a large language model. This generates a set of proof propositions, which are then searched and matched within a DAG containing reference answers provided to the teacher. This verifies whether the student's answer constitutes a valid logical derivation path from known conditions to the final conclusion, ultimately outputting the grading results and feedback.
2. The method according to claim 1, characterized in that, The preprocessing of the input geometric proof problem image includes: defining the input geometric proof problem image as... ,image After grayscale conversion and denoising, the Canny edge detection operator is used to extract the geometric edges of the image. The Canny edge detection operator includes the following steps: Image smoothing step: using a two-dimensional Gaussian kernel... Convolutional denoising of an image yields a smoothed image, expressed by the following formula: in, The standard deviation of the Gaussian kernel; Image gradient calculation steps: Apply the Sobel operator to... Convolutions are performed in different directions to obtain the gradient components, as shown in the following formula: in, This represents the preprocessed image data; based on the calculated x and y gradient components, the gradient magnitude and direction of each pixel are calculated, expressed by the following formula: Local maxima are determined for each pixel along the gradient direction. If the gradient magnitude of the current pixel is not a local maximum, the gradient magnitude of that pixel is set to 0 to remove pixels whose gradient changes are not the most significant. The double thresholding and edge connection steps involve setting two different thresholds: a high threshold and a low threshold. and low threshold These two thresholds are used to classify edge points into three categories: strong edges, weak edges, and non-edges. Weak edge points connected to strong edges are then connected using a neighborhood search and connectivity-based method: starting from a strong edge point, weak edge points are searched within its neighborhood. If a weak edge point and a strong edge point satisfy a certain connectivity condition, they are connected, resulting in a closed, continuous edge map. Its calculation expression is: Where I(x,y) is the original image, and σ is the standard deviation of the Gaussian kernel used in image smoothing.
3. The method according to claim 2, characterized in that, The step of detecting letter annotation information in an image using optical character recognition technology includes: using PaddleOCR recognition technology to detect all letter annotations in the input image and outputting a set of all letter annotation points. Each letter is marked with a point. Including letter annotations Its corresponding center pixel coordinates , represented as The OpenCV module's line detection method based on probabilistic Hough transform is used to extract structure from the same image, obtaining a set of all possible line segment candidates. Each line segment Represented as a line connecting two endpoints, with the endpoint coordinates as follows: For each line segment in the candidate set L Perform nearest neighbor matching on the two endpoints, targeting The endpoints of the two line segments In the set of labeled letter points P, find the labeled point with the smallest distance to each of them. and By calculating the Euclidean distance To determine the matching relationship, it is represented as: The marked point with the smallest distance to the line segment endpoint after the nearest neighbor matching operation. and points Connecting these lines forms geometric line segments, which involves associating the endpoints of the line segments with the nearest letter labels, thus establishing a correspondence between line segments and letter labels in the image.
4. The method according to claim 3, characterized in that, The step of extracting line segment information from an image using a line detection algorithm includes: identifying all possible collinear points in the image, and for each line segment... The corresponding set of endpoints Construct its standard straight line equation by substituting the coordinates of the endpoints of the line segment into relevant calculations to determine the coefficients A, B, and C in the equation; and for all points To determine the distance point by point, the formula for calculating the perpendicular distance from a point to a line is used: If the perpendicular distance from a point to the line is less than a set threshold ε, then the point is considered collinear with the line segment; all points that meet the collinearity criteria are added to the collinear point set of the line segment. In the end, each line segment can be represented as: Among them, a m b m p is the endpoint of the line segment. i p j G is a letter label point that matches the endpoints of a line segment. m Let be the set of collinear points.
5. The method according to claim 1, characterized in that, Constructing a Directed Acyclic Graph (DAG) represents a graph structure, including the following steps: The teacher provides the standard answer text for the geometric proof, typically a multi-step reasoning process described in natural language. First, the standard answer text is preprocessed. Then, a large language model is used to perform structured parsing on the preprocessed standard answer text, transforming each sentence of reasoning into a structured proof node (ProofNode). The logical premises and conclusion relationships between these proof nodes are extracted, and a DAG is constructed. In the constructed DAG, the graph structure... ,in The set of proof nodes contains all propositional nodes extracted from the answer text. It is a set of logical derivation edges, which accurately records the derivation relationships between proposition nodes.
6. The method according to claim 5, characterized in that, Determining whether a graph structure is a valid acyclic graph using Kahn's topological sorting algorithm includes the following steps: For a given graph structure Define the in-degree of each node as , is represented as: Among them, nodes The degree refers to the number of directed edges in a graph structure that terminate at vertex v. This definition accurately quantifies the prerequisite dependencies of each node in the graph structure. A queue Q and a list L for recording the sorting results are initialized. Queue Q stores nodes with an in-degree of 0, serving as the starting set of nodes for topological sorting. List L records the order of nodes after topological sorting. The process then proceeds in a loop until... In each loop: from the queue Extracting nodes And add it to the sorted results list. In the process, nodes are selected sequentially according to their in-degree of 0; for each node... All adjacent nodes Perform an in-degree update operation: If the in-degree of node u is updated Then the node Add to queue In the middle; after the loop ends, the validity of the graph structure is determined by comparing the length of the sorted result list L with the size of the proof node set V in the graph structure; if the final If |L| = |V|, it means that all nodes in the graph structure have undergone topological sorting and there are no cycles, making the graph structure a valid DAG; if |L| = |V|, it means that there are cycles in the graph structure, making it an illegal DAG.
7. The method according to any one of claims 1 to 6, characterized in that: In the semantic normalization step of student answers, for each custom corner annotation in the student's submitted assignment image, the PaddleOCR module is used to identify its annotation text box and output the center point position of the text box. For all letter marking points By calculating the distance, the center point of the distance angle label is selected. The most recent vertex used as the labeled angle , is represented as: Then, filter from the set of line segments in the image all segments starting with a vertex. Line segments with endpoints form a candidate line segment set. , is represented as: Construct the direction vector of the angle label , is used to represent the directional characteristics of corner annotations.
8. The method according to claim 7, characterized in that: For candidate line segment set Construct a direction vector for each line segment in the diagram. and according to The sign of the value determines whether the line segment is placed into two separate line segment sets. , By performing a dot product operation on the direction vectors, line segments are grouped according to their relationship with the angle label direction; from and Find the points that are marked in each of these two sets. The two line segments with the smallest distance are used as the two line segments that enclose the labeled angle. , is represented as: , In the set of collinear points of two line segments, choose the same three-point letter representation as in the reference answer to describe the angle; if there is no angle representation that is the same as in the reference answer, then choose the vertex and the other endpoint of the two line segments to form the angle representation.
9. The method according to any one of claims 1 to 6, characterized in that: In the path matching determination step, the DAG (Directed Acyclic Graph) constructed from the teacher's reference answer is obtained, and the conclusion node is defined as R. Simultaneously, the set of student question-asking nodes obtained from the student's answer analysis is set as... The system performs a reverse breadth-first search, starting from the conclusion node. Starting from the beginning, we traverse each premise edge in reverse in the DAG and backtrack along the path; during the backtracking process, we rely on the large language model to determine whether all nodes on the current path can be found in the set of student-generated problem nodes. Find the equivalent match.
10. The method according to claim 9, characterized in that, The system performs corrections and annotations based on the path matching results: if a path is found in the DAG structure where all nodes can be found to have an equivalent match in the student's problem-setting node set (i.e., a complete match), then the student's proof is deemed correct and marked as correct; if no such complete match path exists, then the proof is deemed to have an error, and the system further outputs the proposition with missing premises, explicitly marking it as an error in the proof, and pointing out the key steps that led to the error.