An intelligent test question clipping method, a storage medium and an equipment

By using multi-scale feature fusion and neural network technology to dynamically expand the answer area, the problem of lost or misplaced answers caused by students answering outside the preset area is solved, achieving high accuracy and robustness in intelligent question cropping.

CN122135384APending Publication Date: 2026-06-02读书郎教育科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
读书郎教育科技有限公司
Filing Date
2026-02-11
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies are prone to losing or misaligning answers when students exceed the preset answer area, and the adaptability of static parameter expansion is insufficient.

Method used

A multi-scale feature fusion network is used to recognize test paper images. An LSTM network is used to predict the extension direction of handwriting. A convolutional neural network is used to identify smudged areas. A Transformer model is used to predict the answer position. A dynamic fan-shaped search area is established, and an answer area extension band is constructed. The cropping parameters are optimized through graph neural networks and reinforcement learning to achieve dynamic expansion and multi-dimensional difference calculation.

Benefits of technology

It enables intelligent adaptation to answers that exceed the acceptable range, improving grading accuracy and ensuring complete capture and correct cropping of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_3
    Figure SMS_3
Patent Text Reader

Abstract

This invention discloses an intelligent test question cropping method, storage medium, and device. The method identifies all handwritten text lines in a test question image; determines an initial answer area expansion band; for handwritten text lines exceeding the preset answer area, it predicts the handwriting extension direction based on an LSTM network and establishes a dynamic fan-shaped search area; when the handwriting extension direction and handwriting pressure of the handwritten text lines searched within the dynamic fan-shaped search area meet the conditions, it automatically expands the boundary of the answer area expansion band, enclosing the searched handwritten text lines within the answer area expansion band; it identifies smudged areas using a convolutional neural network and calculates the multi-dimensional difference between the smudged areas and adjacent handwritten text lines using the following formula; when the conditions are met, a multi-level offset compensation mechanism is activated, incorporating the unsmudged handwritten text adjacent to the smudged area into the answer area expansion band; and it crops the test questions according to the final obtained answer area expansion band. This invention can improve grading accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent education technology, specifically to an intelligent test question cutting method, storage medium, and device. Background Technology

[0002] Current test grading techniques primarily rely on fixed-area cropping methods, which crop the student's answer area according to a pre-defined boundary. However, when a student's answer extends beyond the pre-defined boundary, direct cropping can lead to lost or misaligned answers. Some solutions extend the answer area boundary using static parameters, but these methods, which adapt to different situations involving out-of-bounds answers, remain ineffective. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention aims to provide an intelligent test question cutting method, storage medium, and device.

[0004] To achieve the above objectives, the present invention adopts the following technical solution: A method for intelligent test question cropping includes the following steps: S1. Acquire test paper images and identify all handwritten text lines in the test paper images using a multi-scale feature fusion network; S2. For each question, determine the initial answer area expansion zone; the area of ​​the initial answer area expansion zone is the sum of the area of ​​the preset answer area and the area of ​​the expansion zone with a width of W outside the boundary of the preset answer area. The width W of the answer area extension band is calculated as α × average line height + β × handwriting density, where α and β are adaptive coefficients. S3. For handwritten text lines that exceed the preset answer area, predict their handwriting extension direction based on the LSTM network and establish a dynamic sector search area; when the difference between the handwriting extension direction of the handwritten text line searched in the dynamic sector search area and the handwriting extension direction of the handwritten text line in the preset answer area does not exceed the consistency threshold θ, and the rate of change of its handwriting pressure relative to the handwritten text line in the preset answer area does not exceed the rate of change threshold δ, automatically expand the boundary of the answer area expansion band and wrap the searched handwritten text line within the answer area expansion band. The dynamic sector search area specifically refers to a sector-shaped area that expands along the predicted direction of the handwriting extension, with the end point of the handwritten text line as the vertex. The end point of the handwriting is the end position of the handwritten text line within the preset answer area, and is the starting vertex of the dynamic sector search area. S4. In the expanded answer area after step S3, the smudged areas are identified using a convolutional neural network, and the multi-dimensional difference between them and adjacent handwritten text lines is calculated using the following formula:

[0005] Wherein, GD is the grayscale difference, CD is the color difference, TD is the texture difference, and w1, w2, and w3 are the adaptive weights of GD, CD, and TD, respectively; when MD > composite threshold, a multi-level offset compensation mechanism is activated to include the unsmudged handwritten text adjacent to the smudged area into the answer area extension band. S5. Cut the questions according to the answer area expansion band obtained in step S4.

[0006] Furthermore, in step S2, α∈[0.5,2] and β∈[0.1,0.5].

[0007] Furthermore, in step S4, the specific process of offset compensation is as follows: A1. Construct a Transformer-based response location prediction model:

[0008] Where Xn is used to predict the coordinates of the nth answer position; X{n-1} is the previously identified answer position; E{n-1} is the environmental feature, C is the context feature, f is the Transformer attention network; ε is the random noise term used to simulate the natural fluctuations in the writing position; A2. Dynamically adjust the expansion strategy of the subsequent answer area expansion zone based on the prediction results of the answer position prediction model.

[0009] Furthermore, the steps following step S4 and before step S5 include the following: Establish a handwriting temporal correlation model to reconstruct the trajectory of continuous handwriting across regions:

[0010] Where S is the handwriting continuity score, ai is the handwriting intensity coefficient, b_i is the attenuation factor, and θi is the turning angle; When S > the timing threshold, discrete handwriting fragments are automatically connected.

[0011] Furthermore, for question types with left and right sections, a question stem-answer area association model based on graph neural networks is established:

[0012] Where F is the question stem-answer area correlation score, GNN is the graph neural network model, Al is the left question stem feature, Ar is the right answer area feature, D is the spatial relationship, and C is the semantic association; when the correlation is greater than the dynamic threshold, cross-area intelligent association is automatically established.

[0013] Furthermore, a three-dimensional spatial mapping relationship is established for special question types:

[0014] Where Z represents the three-dimensional intensity of the handwriting in space, (X,Y) are the planar coordinates of the handwriting on the test paper; H is the handwriting height feature, which is a custom feature mapping mechanism built based on actual application scenarios, used to transform physical pressure into structured parameters that can be used for calculation; γ,η are spatial weight coefficients; X×Y is the planar coordinate interaction term; spatially related handwriting is preserved through a three-dimensional clipping algorithm.

[0015] Furthermore, the above method also includes step S6: constructing a reinforcement learning-based dynamic evaluation module to optimize the pruning parameters in real time.

[0016] Where Q(s,a) is the state-action value function, s is the state feature, a is the pruning action, and R is the immediate reward; maxQ(s',a') represents the maximum expected value of the next state s' and action a'; γ is the discount factor; and the overlap threshold and expansion strategy are automatically adjusted based on feedback.

[0017] The present invention also provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-described method.

[0018] The present invention also provides 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 above-described method.

[0019] The beneficial effects of this invention are as follows: This invention combines multiple methods such as static expansion, handwriting extension direction prediction, dynamic search, and smudge area recognition to achieve dynamic expansion of the answer area, which can automatically adapt to out-of-range answers in various situations, thereby improving the accuracy of grading. Detailed Implementation

[0020] The present invention will be further described below. It should be noted that this embodiment is based on the present technical solution and provides detailed implementation methods and specific operation processes, but the protection scope of the present invention is not limited to this embodiment.

[0021] This embodiment provides an intelligent test question cropping method, including: S1. Acquire test paper images and identify all handwritten text lines in the test paper images using a multi-scale feature fusion network; S2. For each question, determine the initial answer area expansion zone. The area of ​​the initial answer area expansion zone is the sum of the area of ​​the preset answer area and the area of ​​the expansion area with a width of W outside the preset answer area boundary. The answer area expansion zone is an expanded and enhanced answer area used to more accurately assess whether handwritten text lines belong to the answer area, especially in cases of slight boundary crossings, cursive writing, or slant, thereby improving matching accuracy and intelligent cropping.

[0022] The width W of the answer area extension band is calculated as follows: W = α × average line height + β × handwriting density, where α ∈ [0.5, 2] and β ∈ [0.1, 0.5] are adaptive coefficients. "α × average line height" dynamically adjusts the extension range based on the line height of the handwritten text (e.g., if the line height is 10px, α = 1.5, then the extension is 15px). "β × handwriting density" supplements the extension based on the density of the handwritten text (higher handwriting density results in greater extension). For example, if the handwritten answer has a line height of 10px and a handwriting density of 10px, then W = 1.5 × 10 + 0.3 × 10 ≈ 18px.

[0023] S3. For handwritten text lines that exceed the preset answer area, predict their handwriting extension direction based on the LSTM network and establish a dynamic sector search area; when the difference between the handwriting extension direction of the handwritten text line searched in the dynamic sector search area and the handwriting extension direction of the handwritten text line in the preset answer area does not exceed the consistency threshold θ, and the rate of change of its handwriting pressure relative to the handwritten text line in the preset answer area does not exceed the rate of change threshold δ, automatically expand the boundary of the answer area expansion band and wrap the searched handwritten text line within the answer area expansion band. The dynamic sector search area specifically refers to a sector-shaped region extending in the predicted direction of the handwritten text line, with the endpoint of the handwriting as its vertex. The endpoint of the handwriting is the end position of the handwritten text line within the preset response area, serving as the starting vertex of the dynamic sector search area and also as the spatial and semantic anchor point for determining whether the response outside the designated area is continuous and reasonable. For example, if the LSTM network predicts that the handwriting extends to the lower right, a dynamic sector search area (such as a 60° sector) is established to search to the lower right. The direction of the handwritten text line's extension refers to the angle between the writing direction of the handwritten text line and the horizontal direction. Changes in handwriting pressure refer to changes in stroke thickness (e.g., a sudden decrease in pressure may indicate the endpoint of the handwriting).

[0024] The above process intelligently expands the search range by analyzing the extension direction and writing characteristics of handwritten text lines, ensuring that handwritten answers outside the preset answer area can also be fully captured.

[0025] The following are further examples: When a student writes their answer outside the pre-defined answer area, the LSTM network predicts that the handwriting will extend to the right, thus establishing a 60° sector search area that expands to the right. If the subsequent handwriting extends in the same direction (e.g., all within 10° to the right) and the handwriting pressure is stable, the answer area will automatically expand to include the complete answer.

[0026] S4. In the expanded answer area after step S3, the smudged areas are identified using a convolutional neural network, and the multi-dimensional difference between them and adjacent handwritten text lines is calculated using the following formula:

[0027] Wherein, GD is the grayscale difference, CD is the color difference, TD is the texture difference, and w1, w2, and w3 are the adaptive weights of GD, CD, and TD, respectively; when MD > composite threshold, a multi-level offset compensation mechanism is activated to include the unsmudged handwritten text adjacent to the smudged area into the answer area extension band.

[0028] S5. Cut the questions according to the answer area expansion band obtained in step S4.

[0029] Through the above process, multi-dimensional feature analysis can accurately distinguish between smudges and valid answers, avoiding misjudgments or omissions due to smudge interference. MD (Multidimensional Difference) is used to comprehensively evaluate the degree of difference between the smudged area and adjacent handwritten text lines (e.g., MD=0.8 indicates a significant difference); GD (Grayscale Difference) is used to evaluate the brightness difference between the smudged area and normal handwriting (e.g., the grayscale value of the smudged area is 30% lower than that of the normal handwriting); CD (Color Difference) is used to evaluate the color difference between the color used for smudges and the original handwriting (e.g., using blue correction fluid to cover black handwriting); TD (Texture Difference) is used to evaluate the roughness characteristics of the smudged area (e.g., the texture of the area covered by correction tape is smoother than that of the handwritten handwriting). w1, w2, and w3 are adaptive weighting coefficients, such as w1=0.5, w2=0.3, w3=0.2 indicating a greater emphasis on grayscale difference. The composite threshold serves as the critical value for triggering the multi-level offset compensation mechanism (e.g., compensation is activated when MD>0.7). Smudge area recognition is the accurate perception and semantic understanding of cross-boundary smudge behavior, and is a key link in achieving highly robust intelligent review.

[0030] For example, when a student uses an eraser to correct their answer, a convolutional neural network detects that the erased area and the significant changes in grayscale (GD) and texture (TD) of the erased area. Based on this, the MD is calculated as 0.5×GD+0.3×CD+0.2×TD=0.82. Since the MD exceeds the threshold of 0.7, offset compensation is automatically activated, and adjacent unerased text is included in the answer area extension band.

[0031] Furthermore, in this embodiment, the specific process of offset compensation is as follows: A1. Construct a Transformer-based response location prediction model:

[0032] Where E{n-1} represents environmental features, C represents contextual features, f represents the attention network, and ε represents random noise, used to simulate the natural fluctuations in writing position.

[0033] A2. Dynamically adjust the expansion strategy of the subsequent answer area expansion zone based on the prediction results of the answer position prediction model.

[0034] Through the above process, by analyzing students' writing habits and environmental characteristics, the system can intelligently predict the subsequent answer positions and dynamically adjust the answer area expansion zone to ensure that continuously written answers can be completely captured.

[0035] Xn is the coordinate of the predicted nth answer position, for example, predicting that the next character might appear at position (100, 200); X{n-1} is the previous identified answer position, such as the previous character being located at (90, 190); E{n-1} represents environmental features, such as the remaining space in the current line, adjacent question areas, etc. C represents contextual features, such as question type, historical writing speed, etc. The f function represents the Transformer attention network, used to calculate the association weights between positions.

[0036] For example, when a student writes a math solution continuously, the position of the first three characters (50,100), (60,110), and (70,120) is analyzed using the f function; combined with environmental features (there is enough space on the right) and context (this is a calculation problem that requires multiple lines of writing), the next character is predicted to appear at (80,130), and the answer expansion band is automatically expanded to include that position.

[0037] Furthermore, in this embodiment, the following steps are included after step S4 and before step S5: Establish a handwriting temporal correlation model to reconstruct the trajectory of continuous handwriting across regions:

[0038] Where S is the handwriting continuity score, ai is the handwriting intensity coefficient, b_i is the attenuation factor, and θi is the turning angle; When S > the timing threshold, discrete handwriting fragments are automatically connected.

[0039] The above process analyzes the writing trajectory characteristics of continuous handwriting across regions, intelligently identifies and automatically connects discrete handwriting fragments interrupted by the answer area extension zone, ensuring that the student's continuously written answer can be completely captured.

[0040] S represents the handwriting continuity score; for example, a score of 85 indicates very continuous handwriting. ai is the handwriting intensity coefficient, such as stroke thickness or ink density; a higher value indicates heavier writing pressure. e {-b_i·Δt} `<input type="b_i">` is the time decay function; for example, handwriting at 2-second intervals decays to 60% of its original intensity. `b_i` is the decay factor; setting it to 0.3 indicates a 30% decay in handwriting correlation per second. `Δt` is the handwriting time interval. The time sequence threshold is a preset continuity judgment standard, such as 70 points.

[0041] For example, when a student writes outside the answer area, the handwriting temporal correlation model detects two handwriting intensity coefficients ai of 0.8 and 0.7 respectively, and calculates the time interval Δt = 1 second (if b_i = 0.2, then it decays to e). {-0.2} =0.82), the turning angle θi=30° (cos30°≈0.87), then the continuity score S=0.8×0.82×0.87+0.7×0.82×0.87≈1.12. S exceeds the threshold of 0.8, so the two handwriting segments are automatically connected to form a complete answer.

[0042] In this embodiment, for question types divided into left and right sections, a question stem-answer area association model based on graph neural networks is established:

[0043] Where F represents the correlation score between the question stem and the answer area (e.g., a score of 0.85 indicates a strong correlation), GNN is a graph neural network model, Al represents the features of the left-side question stem (e.g., the keyword vector of the question stem in a mathematical word problem), Ar represents the features of the right-side answer area (e.g., the formula recognition result of the student's answer), D represents the spatial relationship (e.g., the horizontal distance between the question stem and the answer area is 200 pixels), and C represents the semantic association (e.g., the semantic similarity between "solve the equation" in the question stem and "x=5" in the answer area). When the correlation degree is greater than the dynamic threshold, cross-regional intelligent correlation is automatically established.

[0044] In the above process, the spatial and semantic relationship between the question stem and the answer area is analyzed by graph neural network, and the accurate association between cross-area answers is automatically established to solve the problem of mismatch between answers and questions in left and right column test papers.

[0045] For example, when a student answers a math test, the left-hand question stem A_l contains the text feature "solve a system of two linear equations in two variables", and the right-hand answer area A_r identifies the handwritten formula "x=3, y=2". The spatial relationship D shows that the two are on the same horizontal line (150 pixels apart). The semantic association C is calculated to be 0.8 (because it contains keywords such as "solve" and "equation"). Then the GNN model outputs an association degree F=0.82>the dynamic threshold 0.75, and at this time, the matching relationship between the answer and the question stem is automatically established.

[0046] In this embodiment, a three-dimensional spatial mapping relationship is established for special problem types (such as solid geometry problems):

[0047] Where Z represents the three-dimensional intensity of the handwriting in space, and (X,Y) are the planar coordinates of the handwriting on the test paper; H is the handwriting height feature, which is a custom feature mapping mechanism built based on actual application scenarios. It is used to convert physical pressure into structured parameters that can be used for calculation. For example, for a pressure-sensitive pen, the pressure of 0.5mm can be defined as H=0.8. It also generates an equivalent "virtual height feature" by fusing image visual features (such as stroke thickness, gray depth, and texture density) to achieve a reasonable estimate of writing force; γ and η are spatial weight coefficients (such as γ=0.3 focusing on planar expansion and η=0.7 focusing on pressure perception); X×Y is a planar coordinate interaction term (such as 100×200=20000 reflecting the coverage of the planar area).

[0048] Spatial correlation of handwriting is preserved through a 3D cropping algorithm.

[0049] In the above process, by capturing the spatial pressure characteristics during writing, a three-dimensional coordinate mapping relationship is established to ensure that the three-dimensional writing handwriting can be completely captured and associated.

[0050] For example, when a student uses a pressure-sensitive pen to solve a solid geometry problem, the pen stroke position is detected as X=150px, Y=300px, the pressure intensity is H=0.6, γ=0.4 (the problem type requires emphasis on planar expansion), and η=0.6 (pressure analysis needs to be strengthened). The calculated value is Z=0.4×(150×300)+0.6×0.6=18000.36. A three-dimensional mapping is constructed using the Z value, automatically associating layered pen strokes at the same spatial location (such as auxiliary lines drawn first and solution steps written later).

[0051] In this embodiment, the method further includes step S6: constructing a dynamic evaluation module based on reinforcement learning to optimize the pruning parameters in real time.

[0052] Where Q(s,a) is the state-action value function (e.g., the expected long-term score of the current pruning strategy), s is the state feature (a combination of parameters such as current handwriting overlap, answer area expansion band width, etc.), a is the pruning action (e.g., expanding the answer area expansion band boundary), R is the immediate reward (e.g., the quantitative value of the improvement in grading accuracy after a certain pruning); maxQ(s',a') represents the maximum expected value of the next state s' and action a' (e.g., the potential benefit of the optimized strategy); γ is the discount factor (e.g., setting it to 0.9 indicates a greater emphasis on recent rewards).

[0053] The expansion strategy is automatically adjusted based on feedback from the feedback.

[0054] In the above process, by evaluating the cropping effect in real time and automatically adjusting parameters, the recognition and cropping accuracy of handwritten text can be continuously optimized based on actual feedback.

[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 intelligent test question cropping, characterized in that, Includes the following steps: S1. Acquire test paper images and identify all handwritten text lines in the test paper images using a multi-scale feature fusion network; S2. For each question, determine the initial answer area expansion zone. The area of ​​the initial answer area expansion zone is the sum of the area of ​​the question's preset answer area and the area of ​​the expansion zone with a width of W outside the preset answer area boundary. The width W of the answer area extension band is calculated as α × average line height + β × handwriting density, where α and β are adaptive coefficients. S3. For handwritten text lines that exceed the preset answer area, predict their handwriting extension direction based on the LSTM network and establish a dynamic sector search area; when the difference between the handwriting extension direction of the handwritten text line searched in the dynamic sector search area and the handwriting extension direction of the handwritten text line in the preset answer area does not exceed the consistency threshold θ, and the rate of change of its handwriting pressure relative to the handwritten text line in the preset answer area does not exceed the rate of change threshold δ, automatically expand the boundary of the answer area expansion band and wrap the searched handwritten text line within the answer area expansion band. The dynamic sector search area specifically refers to a sector-shaped area that expands along the predicted direction of the handwriting extension, with the end point of the handwritten text line as the vertex. The end point of the handwriting is the end position of the handwritten text line within the preset answer area, and is the starting vertex of the dynamic sector search area. S4. In the expanded answer area after step S3, the smudged areas are identified using a convolutional neural network, and the multi-dimensional difference between them and adjacent handwritten text lines is calculated using the following formula: Wherein, GD is the grayscale difference, CD is the color difference, TD is the texture difference, and w1, w2, and w3 are the adaptive weights of GD, CD, and TD, respectively; when MD > composite threshold, a multi-level offset compensation mechanism is activated to include the unsmudged handwritten text adjacent to the smudged area into the answer area extension band. S5. Cut the questions according to the answer area expansion band obtained in step S4.

2. The method according to claim 1, characterized in that, In step S2, α∈[0.5,2] and β∈[0.1,0.5].

3. The method according to claim 1, characterized in that, In step S4, the specific process of offset compensation is as follows: A1. Construct a Transformer-based response location prediction model: Where Xn is used to predict the coordinates of the nth answer position; X{n-1} is the previously identified answer position; E{n-1} is the environmental feature, C is the context feature, f is the Transformer attention network; ε is the random noise term used to simulate the natural fluctuations in the writing position; A2. Dynamically adjust the expansion strategy of the subsequent answer area expansion zone based on the prediction results of the answer position prediction model.

4. The method according to claim 1, characterized in that, The steps following step S4 and before step S5 include the following steps: Establish a handwriting temporal correlation model to reconstruct the trajectory of continuous handwriting across regions: Where S is the handwriting continuity score, ai is the handwriting intensity coefficient, b_i is the attenuation factor, and θi is the turning angle; When S > the timing threshold, discrete handwriting fragments are automatically connected.

5. The method according to claim 1, characterized in that, For question types with left and right sections, a question stem-answer area association model based on graph neural networks is established: Where F is the question stem-answer area correlation score, GNN is the graph neural network model, Al is the left question stem feature, Ar is the right answer area feature, D is the spatial relationship, and C is the semantic association; when the correlation is greater than the dynamic threshold, cross-area intelligent association is automatically established.

6. The method according to claim 1, characterized in that, Establish a three-dimensional spatial mapping relationship for special question types: Where Z represents the three-dimensional intensity of the handwriting in space, (X,Y) are the planar coordinates of the handwriting on the test paper; H is the handwriting height feature, which is a custom feature mapping mechanism built based on actual application scenarios, used to transform physical pressure into structured parameters that can be used for calculation; γ,η are spatial weight coefficients; X×Y is the planar coordinate interaction term; spatially related handwriting is preserved through a three-dimensional clipping algorithm.

7. The method according to claim 1, characterized in that, It also includes step S6: constructing a reinforcement learning-based dynamic evaluation module to optimize pruning parameters in real time. Where Q(s,a) is the state-action value function, s is the state feature, a is the pruning action, and R is the immediate reward; maxQ(s',a') represents the maximum expected value of the next state s' and action a'; γ is the discount factor; and the overlap threshold and expansion strategy are automatically adjusted based on feedback.

8. 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-7.

9. 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-7.