Job single question batch re-batch method, storage medium and device

By clustering and stitching homework answer images using a visual semantic analysis model, and combining it with a large language model for batch scoring, this approach solves the problems of resource waste and low processing efficiency in existing technologies. It achieves an efficient and interpretable homework grading process, which is suitable for subjective question re-grading scenarios across multiple grade levels and subjects.

CN122454580APending Publication Date: 2026-07-24ZHUHAI DUSHILANG SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI DUSHILANG SOFTWARE TECH CO LTD
Filing Date
2026-03-17
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

When re-grading a single question in the existing intelligent homework grading system, each student needs to independently call the OCR + large model to re-grade the same question, which results in serious waste of resources and low processing efficiency. The serial processing mode is time-consuming.

Method used

A visual semantic analysis model is used to cluster and group the answer images of multiple students for the same question. After being stitched into a synthetic image, only one OCR recognition is performed. Composite prompt words are constructed by combining the question context and scoring criteria. Batch scoring is performed through a large language model. Student identity coding information is embedded in the synthetic image to ensure the traceability of the scoring results.

Benefits of technology

It significantly improves processing efficiency, reduces the number of calls to OCR and large language models, reduces overall re-batch processing time, improves the consistency and interpretability of scores, meets educational data management standards, and has good scalability and compatibility.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The application discloses a kind of homework single topic batch re-batch method, storage medium and equipment, from the same topic of the image of the answer to the extraction of the same topic to be re-batched, and each answer image is attached Metadata label including student identity label;Each answer image is carried out semantic similarity calculation, clustering and grouping by visual semantic analysis model;According to the preset layout rule, each answer image in grouping is spliced into a composite image, and the corresponding student identity code information is embedded;For single composite image, execute once OCR identification processing to extract the answer text corresponding to all answer images, construct composite prompt word, guide large language model to return structured score array;Each score result is dynamically mapped to corresponding student individual;Update the original score record of each student's electronic homework.The application can significantly improve processing efficiency, enhance scoring consistency and explainability, consider engineering practicability and education compliance, have good expansibility and compatibility.
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 a method, storage medium, and device for batch re-grading of homework assignments. Background Technology

[0002] When re-grading a single question in the existing intelligent homework grading system, each student needs to independently call the OCR+large model for re-grading the same question. For example, 200 homework assignments would require 200 independent calls to the OCR+large model, which is a serious waste of resources. Moreover, the serial processing mode results in long overall processing time and low processing efficiency. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention aims to provide a method, storage medium, and device for batch re-grading of assignment questions.

[0004] To achieve the above objectives, the present invention adopts the following technical solution: A method for batch re-grading of homework assignments includes the following steps: S1. Extract the answer images of the same question to be re-graded from the electronic assignments of multiple students, and attach metadata tags containing student identification to each answer image; S2. Calculate the semantic similarity of each answer image obtained in step S1 using a visual semantic analysis model, and cluster and group each answer image according to the semantic similarity. S3. For each group, according to the preset layout rules, the answer images in the group are stitched into a composite image, and the student identity code information corresponding to each answer image is embedded in the stitching process. S4. For a single composite image, perform an OCR recognition process to extract the answer text corresponding to all answer images. Then, combine all answer text with the question context description, serial number marker and scoring criteria to construct compound prompt words. Input the compound prompt words into the large language model to guide the large language model to independently grade each answer text in sequence and return a structured scoring array. The sequence number is the physical arrangement number of the answer image corresponding to each answer text in the composite image, that is, the order of the corresponding answer images in the single composite image generated by splicing according to the preset layout rules; when the OCR recognition process outputs the answer text, the order of the recognized answer text and its corresponding original image is strictly bound and a unique sequence number is assigned. S5. Receive the scoring array returned by the large language model, map each scoring result in the scoring array to the corresponding answer image according to the serial number, and further dynamically map the scoring result to the corresponding student individual according to the student identity code information embedded in the answer image. S6. Update the original grading records for each student's electronic assignments.

[0005] Furthermore, in step S2, the visual semantic analysis model uses a lightweight convolutional neural network or a visual Transformer structure to extract visual semantic features from each answer image, including the spatial layout of the answer image, the handwriting density distribution, and the geometric consistency of the answer area. Then, the semantic similarity between each answer image is calculated based on the visual semantic features, and the answer images are clustered and grouped according to the semantic similarity.

[0006] Furthermore, in step S3, the size of the synthesized image is adapted to the standard printing paper size, and anti-interference blank margins are set between adjacent answer images in the synthesized image.

[0007] Furthermore, the above method also includes an anomaly handling step: when the OCR recognition of a certain answer image fails or the scoring format of the large language model is abnormal, the corresponding answer image is separated and subjected to an independent re-batch process.

[0008] Furthermore, the independent re-batch process is either manually intervened or reprocessed by high-precision independent OCR and large language model channels.

[0009] Furthermore, the specific process of reprocessing by high-precision independent OCR and large language model channels is as follows: A1. High-fidelity image preprocessing: For abnormal answer images, refined preprocessing is initiated, including adaptive binarization, handwriting enhancement, geometric correction, and super-resolution reconstruction is enabled to improve the clarity of key text areas, ensuring that the image entering OCR recognition processing is the optimal expression under current technical conditions. A2. Multi-engine fusion OCR recognition: At least two heterogeneous OCR engines are invoked in parallel, including a high-precision OCR engine and a rule-guided OCR engine; each OCR engine independently performs recognition processing on the image obtained in step A1. Then, a fusion strategy based on confidence and rule verification is adopted to analyze the recognition results of each OCR engine: First, based on the confidence score output by the high-precision OCR engine, low-confidence suspected error areas in its recognition results are identified; then, the content of the identified suspected error areas is compared with the corresponding part in the recognition result of the rule-guided OCR engine. If the corresponding part in the recognition result of the rule-guided OCR engine meets the question's standard answer keyword template and answer box coordinate constraints, the content of the suspected error area is replaced with the corresponding part in the recognition result of the rule-guided OCR engine, while other high-confidence areas in the recognition result of the high-precision OCR engine are retained, thus obtaining the final OCR recognition result; finally, a structured text result with confidence score, character-level coordinates, and semantic block annotation is output, and the OCR recognition results generated by each OCR engine are retained as alternative paths; A3. Construction of Context-Enhanced Composite Hints: Based on the structured text results output in step A2, construct hint words that far exceed the granularity of the main channel. The hint words contain the stem and scoring criteria of the original questions, and at least include: the semantic block annotations and spatial relationships in the structured text results; the segments with confidence scores below the threshold and their Top-3 candidates; and an explicit instruction requiring the large language model to return an atomic score object in JSON format containing fields such as score, reason, and quoted original text segments. Semantic blocks are classification labels for the logical functions of text regions, while fragments are the specific recognized text units that constitute these semantic blocks; confidence scores are generated for each specific recognized text unit, that is, each specific recognized text unit contained in a semantic block has a corresponding confidence score; Top-3 candidates for fragments with confidence scores below the threshold refer to the three most likely alternative recognized contents of the fragment, which are used by the large language model to determine which candidate result is correct in combination with the context. A4. Deterministic Large Language Model Inference and Double Verification Mechanism: The large language model is invoked, and the prompt words constructed in step A3 are input into the model, with structured output constraints enforced. After inference is complete, double verification is performed: Format validation: Verify whether the output of the large language model conforms to the predefined JSON Schema, including whether the fields are complete, the types are correct, and the values ​​are within a reasonable range; Logical verification: The reasoning chain is traced back to the structured text result obtained in step A2 to verify whether it truly supports the scoring conclusion. Any failure of a verification will trigger the manual review interface; A5. Atomization Result Encapsulation and Audit Archiving: The verified scoring results are encapsulated into a standardized record containing metadata such as a unique re-batch transaction ID, the hash value of the original answer image, the processing time of each stage, the OCR confidence distribution histogram, and the consumption of large language inference tokens. This record is directly written into the audit log system, and the original scoring record of the student's assignment corresponding to the abnormal answer image is updated synchronously.

[0010] Furthermore, in step S3, the student identity encoding information is embedded into the underlying pixels of the image through frequency domain steganography, which does not affect human visual perception, but can be restored by a dedicated decoder.

[0011] Furthermore, step S6 also includes: generating a re-batch audit log containing timestamps, operator information, batch ID, and exception handling logs.

[0012] 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.

[0013] The present invention also provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the above-described method.

[0014] The beneficial effects of this invention are as follows: 1. An integrated grading paradigm of "image clustering—synthetic stitching—single OCR—structured prompts": This invention breaks through the traditional serial mode of processing each answer independently, and pioneers the intelligent clustering and stitching of multiple semantically similar student answer images into a single synthetic image, implicitly embedding student identity coding information within it; all answer text extraction is completed with only one OCR recognition, and then by constructing composite prompt words containing question context, serial number markers, and scoring criteria, a large language model is driven to complete the batch, orderly, and independent structured scoring output. The entire process, from data organization and feature perception to model invocation, is reconstructed.

[0015] 2. Visual semantic-driven intelligent grouping mechanism for answer images: Unlike simple sequential or random grouping, this invention introduces a visual semantic analysis model (supporting CNN or ViT architecture) to cluster answer images based on educational scenario-specific visual cues such as spatial layout structure, handwriting density distribution characteristics, and geometric consistency of answer areas. This makes answers within the same group more comparable in terms of expression logic, writing standardization, and completeness, significantly improving the consistency and fairness of subsequent large-scale model scoring.

[0016] 3. Dual robust design for educational auditing needs: On the one hand, frequency domain steganography is used to embed student identity codes in the synthesized images to ensure that the identity information is invisible, interference-resistant, and accurately reproducible, avoiding the negative impact of traditional watermarks or text annotations on OCR accuracy; on the other hand, a hierarchical anomaly handling mechanism is established—when OCR fails or the output format of the large language model is abnormal, abnormal samples are automatically stripped and entered into a high-precision independent channel (manual intervention or dedicated OCR+LLM re-batch), ensuring the reliability of the overall process and the traceability of results.

[0017] In summary, the present invention can achieve the following: Significantly improves processing efficiency: Taking 200 jobs as an example, the number of OCR calls is reduced from 200 to about 10-20 (depending on the number of cluster groups), the number of inferences of large language models is reduced by the same order of magnitude, and the overall re-batch time is reduced by more than 70%, solving the problem of computing power bottleneck and response delay caused by high-frequency repeated calls in existing technologies. Enhance scoring consistency and interpretability: Semantic clustering enables "comparative grading of similar cases," reducing scoring bias caused by individual differences in response formats in large language models; the combination of structured scoring arrays and explicit serial number markings supports question-by-question tracing, result verification, and teaching attribution analysis. Balancing engineering practicality and educational compliance: The synthesized image is adapted to standard printing specifications and anti-interference margins are set, ensuring compatibility with existing scanning and recognition hardware; the embedded identity encoding and complete audit log (including timestamps, operators, batch IDs, and anomaly records) meet the requirements of educational data management standards and process traceability. It has good scalability and compatibility: It does not depend on specific OCR or large language model vendors. Each module is clearly decoupled and can be flexibly adapted to visual semantic analysis models and large language models of different accuracy levels. It is suitable for subjective question re-marking scenarios in multiple educational stages and disciplines such as K12, vocational education, and higher education. Detailed Implementation

[0018] 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.

[0019] This embodiment provides a method for batch re-grading of assignment questions, including the following steps: S1. Extract the answer images of the same question to be re-graded from the electronic assignments of multiple students, and attach metadata tags containing student identification to each answer image; S2. Calculate the semantic similarity of each answer image obtained in step S1 using a visual semantic analysis model, and cluster and group each answer image according to the semantic similarity. S3. For each group, according to the preset layout rules, the answer images in the group are stitched into a composite image, and the student identity code information corresponding to each answer image is embedded in the stitching process. S4. For a single synthesized image, perform an OCR recognition process to extract the answer text corresponding to all answer images. Then, combine all answer text with the question context description, serial number mark and scoring criteria to construct a compound prompt. Input the compound prompt into the large language model to guide the large language model to independently grade each answer text in sequence and return a structured scoring array. The sequence number is the physical arrangement number of the answer image corresponding to each answer text in the composite image, that is, the order of the corresponding answer images in the single composite image generated by stitching according to the preset layout rules (such as from left to right, from top to bottom). When the OCR recognition process outputs the answer text, the order of the recognized answer text and its corresponding answer image is strictly bound, and a unique sequence number is assigned (such as "#1", "#2"..."#N") to ensure that the source of the answer text is traceable; When constructing compound prompt words, each answer text is explicitly labeled with its own serial number as a prefix (e.g., "[#3] Student's answer: ..."). This allows the large language model to clearly perceive the independence and sequential relationship between different answer texts. As a result, when generating the structured score array, the large language model can strictly output the corresponding score results according to the serial number order (e.g., [score 1, score 2, ..., score N]), providing a deterministic basis for the mapping of score results in the subsequent step S5.

[0020] S5. Receive the scoring array returned by the large language model, map each scoring result in the scoring array to the corresponding answer image according to the serial number, and further dynamically map the scoring result to the corresponding student individual according to the student identity code information of the corresponding answer image. S6. Update the original grading records for each student's electronic assignments.

[0021] In this embodiment, in step S2, the visual semantic analysis model uses a lightweight convolutional neural network or a visual Transformer structure to extract visual semantic features from each answer image, including the spatial layout of the answer image, the handwriting density distribution, and the geometric consistency of the answer area. Then, based on the visual semantic features of each answer image, the semantic similarity between each answer image is calculated, and the answer images are clustered and grouped according to the semantic similarity.

[0022] Spatial layout refers to the overall structural characteristics of a student's answer within the answer area, such as the relative positions of text / formulas / graphics, paragraph segmentation, alignment of numbers and content, and the distribution of white space. These spatial layout characteristics reflect a student's logical organization habits and standardized expression. They are extracted from the answer image by a visual semantic analysis model through attention mechanisms or spatial perception modules (such as position encoding and local window modeling). This belongs to the higher-level semantic level of layout semantics, rather than simply coordinate information.

[0023] Handwriting density distribution refers to the degree of clustering of stroke pixels per unit area and its spatial variation pattern in an answer image, encompassing quantifiable characteristics such as writing density, stroke intensity, correction frequency, and spacing. The visual semantic analysis model models the statistical characteristics (such as local variance and gradient histogram distribution entropy) of this handwriting density distribution through multi-scale feature map responses (e.g., shallow texture response + deep semantic aggregation), transforming it into a discriminative semantic feature vector to distinguish typical behavioral patterns such as neat answers, sloppy answers, and brief answers.

[0024] Geometric consistency of the answer area refers to the degree of matching between the student's actual answer area and the standard answer box (or expected answer range) in terms of shape, proportion, orientation, and boundary fit. This includes whether the answer area exceeds the boundary, whether it is offset, whether there is scaling distortion, and whether there is rotation or tilt. The characteristics of geometric consistency of the answer area are explicitly modeled by combining handwriting density distribution with spatial transformation invariance design (such as STN modules or geometrically perceptual convolution), reflecting the student's understanding and execution ability of answer specifications. It belongs to semantic features that integrate geometric prior knowledge.

[0025] In this embodiment, in step S3, the size of the synthesized image is adapted to standard printing paper size, such as A4 or A3, and anti-interference blank margins are set between adjacent answer images in the synthesized image.

[0026] In this embodiment, the above method further includes an anomaly handling step: when the OCR recognition processing of a certain answer image fails or the scoring array output by the large language model is abnormal, the corresponding answer image is separated as an abnormal answer image and subjected to an independent re-batch process.

[0027] Specifically, the overall structure of the score array output by the large language model does not conform to the preset, parsable structured score array format requirements. This will prevent the accurate binding of score results to individual students through established rules (such as sequence number mapping, JSON schema validation, array length consistency, etc.). The specific manifestations of the abnormal score array format are as follows: 1. Array structure failures: Outputting non-array format (e.g., returning plain text descriptions such as "The 3rd student answered well, 8 points", instead of a structured array); the array length is inconsistent with the number of answer images in the composite image (e.g., 5 answer images are stitched together, but LLM only returns 4 or 6 scores); the array element types are mixed (e.g., some are numbers, some are strings, such as "full marks", "not answered", "requires review", and are not uniformly encoded according to the convention); the array nesting level is incorrect (e.g., returning a multidimensional array or a complex structure containing objects, exceeding the expected flat one-dimensional scoring array on which step S5 depends).

[0028] 2. Semantic parsing conflict type: The score value obviously violates the question scoring standard (e.g., a question with a full score of 10 points returns "15 points" or "-2 points"). Although the format is number, the logic goes out of bounds, triggering the failure of business rule verification; the same sequence number corresponds to multiple scores (e.g., the prompt clearly marks "[#4]...", but #4 is mentioned repeatedly in the output score array and given different scores), causing mapping ambiguity.

[0029] 3. Missing or misaligned metadata: Failure to respond according to the mandatory sequence prefix in the compound prompt (such as missing "#1", "#2", etc.), resulting in the inability to establish the order anchor between the answer text and the scoring result; Although an array is returned, the order of the array elements is inconsistent with the actual splicing order of the answer image in the composite image (such as the answer in the first position of the physical location corresponding to the third element of the array).

[0030] In this embodiment, the determination of score array format anomalies is automatically completed by a preset format validator (such as based on regular expression matching, JSON Schema validation, and triple assertions of length / type / range). If any dimension validation fails, it is considered a score array format anomaly, immediately triggering the anomaly handling process. All answer images (along with their metadata tags and original images) in the corresponding synthetic image of the score array are extracted from the current batch and entered into independent re-batch processes as anomalous answer images. Therefore, score array format anomaly is an interface-level fault-tolerant design for engineering robustness. Its core objective is to ensure the determinism and atomicity of the dynamic mapping in step S5, ensuring that each score result can be unambiguously and auditably attributed to a unique student.

[0031] Furthermore, in this embodiment, in the independent re-batch process, the data is reprocessed either by manual intervention or by a high-precision independent OCR+LLM channel.

[0032] The high-precision independent OCR+LLM channel is a dedicated, enhanced, closed-loop controllable re-batch sub-process executed on abnormal answer images. Its processing is strictly different from that of the main batch channel, and its specific process is as follows: A1. High-fidelity image preprocessing: For abnormal answer images, refined preprocessing is initiated, including adaptive binarization (suppressing uneven lighting and paper texture), handwriting enhancement (based on local contrast stretching and edge sharpening), geometric correction (using quadrilateral vertex detection in the answer area to perform perspective transformation and eliminate tilt and distortion), and optional super-resolution reconstruction (such as the ESRGAN lightweight model) to improve the clarity of key text areas, ensuring that the image entering OCR recognition processing is the optimal expression under current technical conditions.

[0033] A2. Multi-engine Fusion OCR Recognition: At least two heterogeneous OCR engines are invoked in parallel. In this embodiment, one is a high-precision OCR engine (such as PaddleOCR Server or DocTR high-precision configuration), specializing in complex texts for educational scenarios such as handwritten text, formulas, and multi-level numbering. The other is a rule-guided OCR engine (such as a directional recognizer that combines the keyword template of the question's standard answer with the coordinate constraints of the answer box), which triggers local re-recognition or candidate word correction for suspected recognition error areas (such as low-confidence characters). Each OCR engine independently performs recognition processing on the image obtained in step A1.

[0034] Then, a fusion strategy based on confidence and rule verification is adopted to evaluate the recognition results of each OCR engine: First, based on the confidence score output by the high-precision OCR engine, suspected error areas with low confidence are identified in its recognition results; then, the content of the identified suspected error areas is compared with the corresponding part of the recognition result of the rule-guided OCR engine. If the corresponding part of the recognition result of the rule-guided OCR engine conforms to the question's standard answer keyword template and answer box coordinate constraints, the content of the suspected error area is replaced with the corresponding part of the recognition result of the rule-guided OCR engine. Other high-confidence areas in the recognition result of the high-precision OCR engine are retained, thus obtaining the final OCR recognition result. In this way, the final output OCR recognition result is a fusion recognition result after double verification and optimization. Finally, a structured text result with confidence score, character-level coordinates, and semantic block annotations (such as "question stem quotation", "calculation process", "conclusion sentence") is output, and the OCR recognition results generated by each OCR engine are retained as alternative paths.

[0035] Retaining the OCR recognition results generated by each OCR engine as alternative paths is to record the original judgment content of each OCR engine, so that when the final result needs to be reviewed or audited, the specific recognition differences between different OCR engines can be traced and compared, rather than just storing the single result after final fusion.

[0036] A3. Construction of Context-Enhanced Composite Hints: Based on the structured text results output in step A2, construct hint words with a granularity far exceeding that of the main channel. These hint words include the stem and scoring criteria of the original questions, and also include: the semantic block annotations and spatial relationships in the structured text results (e.g., "top left corner formula derivation area: ..."); segments with confidence scores below the threshold and their Top-3 candidates (for cross-validation of the large language model); a summary of the answering styles of other questions by the same student (optional, used for consistency calibration); and explicit instructions requiring the large language model to return an atomic score object in JSON format containing the fields "score", "reasoning", and "evidence_span".

[0037] It should be noted that semantic blocks are classification labels for the logical functions of text regions, while segments are the specific recognized text units that constitute these semantic blocks. The confidence score is generated for each specific recognized text unit; that is, each specific recognized text unit contained within a semantic block has a corresponding confidence score.

[0038] The Top-3 candidates for segments with confidence scores below the threshold refer to the three most likely alternative content for that segment, which are used by the large language model to determine which candidate result is correct based on the context.

[0039] A4. Deterministic Large Language Model Inference and Double Validation Mechanism: Call a large language model with a higher number of parameters / better fine-tuning (such as Qwen-Max or GLM-4-Flash fine-tuned for the education domain), input the prompt words constructed in step A3 into the large language model, and enforce structured output constraints (JSON Schema + Output Guardrails); after inference is completed, perform double validation: Format validation: Verify whether the output of the large language model conforms to the predefined JSON Schema, including whether the fields are complete, the types are correct, and the values ​​are within a reasonable range; Logical verification: Backtrack "reasoning" and "evidence_span" to the structured text result obtained in step A2 to verify whether the reasoning chain truly supports the scoring conclusion (e.g., if it points out "the unit is not written" but the corresponding missing position is not located in the evidence, it is judged as a logical break).

[0040] Any failure of a verification will trigger the manual review interface.

[0041] A5. Atomization Result Encapsulation and Audit Archiving: The verified scoring results are encapsulated into a standardized record containing metadata such as a unique re-batch transaction ID, the hash value of the original answer image, the processing time of each stage, the OCR confidence distribution histogram, and the consumption of large language inference tokens. This record is directly written into the audit log system, and the original scoring record of the student's assignment corresponding to the abnormal answer image is updated synchronously.

[0042] The entire process described above is independent of the main batch, does not interrupt the batch process, and all intermediate products and decision-making basis are traceable and reproducible.

[0043] In this embodiment, in step S3, the student identity encoding information is embedded into the underlying pixels of the corresponding answer image through frequency domain steganography, which does not affect human visual perception, but can be restored by a dedicated decoder.

[0044] In this embodiment, step S6 further includes: generating a re-batch audit log containing timestamps, operator information, batch ID, and exception handling logs.

[0045] Example 2 This embodiment provides an application example of Embodiment 1.

[0046] In a certain exam, the teacher discovered that the original grading criteria for question 18 (a problem about combining the graph of a linear function with a practical problem) had been misunderstood, and the answers to this question from all 1,024 students in 24 classes across the entire grade needed to be re-graded uniformly.

[0047] S1. Extract the images to be re-batched and attach metadata. Images of all students' answers to question 18 from this exam were selected (each image is approximately 600×800 pixels), totaling 1,024 images. Metadata tags identifying the student were automatically added to each image. The image is stored in PNG format in a temporary batch processing directory.

[0048] S2, Semantic Similarity Clustering Grouping The pre-trained lightweight visual Transformer model (ViT-Tiny / 8) is used to extract the spatial layout feature vector of each answer image, including: Does the answer area use a coordinate system for plotting? Does it include the formula derivation process? Heatmap of text density distribution; Keyword location (e.g., "Solution: Let…", "Answer:…").

[0049] Cosine similarity was used to calculate the semantic distance between pairwise answer images, and the DBSCAN algorithm was used for clustering, ultimately dividing the 1,024 answers into 6 categories: Complete and standardized version (including diagrams, formulas, and textual explanations, totaling 312 people). The formula is correct, but there is no illustration (278 people in total). Only textual descriptions, no calculations (total of 165 people) Images were messed up or heavily altered (98 people in total). Leave the answer blank or provide a very brief response (132 people in total) Abnormal scan images (blurred / truncated, 39 people in total) Category 6 was marked as an anomalous sample and entered into an independent re-batch process; the remaining five categories were processed by splicing.

[0050] S3, Image Stitching and Identity Encoding Embedding Taking the first type, "complete and standardized type", as an example, the composite image template is designed according to the A4 paper landscape layout (210mm × 297mm, resolution of 300dpi), with 3 answer images arranged in each row and a 15mm blank margin between each column to prevent OCR crosstalk.

[0051] During the stitching process, corresponding student identification codes (such as SID:C30521|Q:18) are generated and embedded into the DCT coefficients of the non-critical area in the lower right corner of each answer image using frequency domain steganography, without affecting human visual perception. Simultaneously, miniature Data Matrix codes are superimposed in invisible areas as redundant backups.

[0052] The final result is a composite image with a size of 2480×3508 pixels, containing 312 answers, arranged in a 104-row × 3-column layout.

[0053] S4. OCR Recognition and Compound Prompt Word Construction PaddleOCR is used to extract text in batches for each synthesized image to obtain structured output.

[0054] Then, a compound prompt word is constructed and sent to the large language model API.

[0055] S5. Scoring Result Analysis and Dynamic Mapping After the large language model returns a structured score array, the score results are accurately mapped back to the original student records based on the concatenation order (index) and the embedded identity code (student_id is restored from the watermark using a dedicated decoder).

[0056] For example, the 0th position corresponds to student ID C30521, whose new score of 9.0 is written to the database and marked as "re-graded by AI".

[0057] S6. Update scoring and generate audit logs The task management platform API was called to update 1,024 rating records in batches and generate audit logs.

[0058] Teachers can view comparative charts before and after the re-grading on the platform and find that the average score has risen from 6.7 to 7.9, reflecting that the original judgment was too strict.

[0059] 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 batch re-grading of homework assignments, characterized in that, Includes the following steps: S1. Extract the answer images of the same question to be re-graded from the electronic assignments of multiple students, and attach metadata tags containing student identification to each answer image; S2. Calculate the semantic similarity of each answer image obtained in step S1 using a visual semantic analysis model, and cluster and group each answer image according to the semantic similarity. S3. For each group, according to the preset layout rules, the answer images in the group are stitched into a composite image, and the student identity code information corresponding to each answer image is embedded in the stitching process. S4. For a single composite image, perform an OCR recognition process to extract the answer text corresponding to all answer images. Then, combine all answer text with the question context description, serial number marker and scoring criteria to construct compound prompt words. Input the compound prompt words into the large language model to guide the large language model to independently grade each answer text in sequence and return a structured scoring array. The sequence number is the physical arrangement number of the answer image corresponding to each answer text in the composite image, that is, the order of the corresponding answer images in the single composite image generated by splicing according to the preset layout rules; when the OCR recognition process outputs the answer text, the order of the recognized answer text and its corresponding original image is strictly bound and a unique sequence number is assigned. S5. Receive the scoring array returned by the large language model, map each scoring result in the scoring array to the corresponding answer image according to the serial number, and further dynamically map the scoring result to the corresponding student individual according to the student identity code information embedded in the answer image. S6. Update the original grading records for each student's electronic assignments.

2. The method according to claim 1, characterized in that, In step S2, the visual semantic analysis model uses a lightweight convolutional neural network or visual Transformer structure to extract visual semantic features from each answer image, including the spatial layout of the answer image, the handwriting density distribution, and the geometric consistency of the answer area. Then, the semantic similarity between each answer image is calculated based on the visual semantic features, and the answer images are clustered and grouped according to the semantic similarity.

3. The method according to claim 1, characterized in that, In step S3, the size of the composite image is adapted to the standard printing paper size, and anti-interference blank margins are set between adjacent answer images in the composite image.

4. The method according to claim 1, characterized in that, It also includes anomaly handling steps: when the OCR recognition of a certain answer image fails or the scoring format of the large language model is abnormal, the corresponding answer image is separated and re-batched independently.

5. The method according to claim 4, characterized in that, The independent re-batch process is either manually intervened or reprocessed by high-precision independent OCR and large language model channels.

6. The method according to claim 5, characterized in that, The specific process of reprocessing using high-precision independent OCR and large language model channels is as follows: A1. High-fidelity image preprocessing: For abnormal answer images, refined preprocessing is initiated, including adaptive binarization, handwriting enhancement, geometric correction, and super-resolution reconstruction is enabled to improve the clarity of key text areas, ensuring that the image entering OCR recognition processing is the optimal expression under current technical conditions. A2. Multi-engine fusion OCR recognition: At least two heterogeneous OCR engines are invoked in parallel, including a high-precision OCR engine and a rule-guided OCR engine; Each OCR engine independently performs recognition processing on the image obtained in step A1; Then, a fusion strategy based on confidence and rule verification is adopted to analyze the recognition results of each OCR engine: First, based on the confidence score output by the high-precision OCR engine, the suspected error areas with low confidence in its recognition results are identified. The content of the identified suspected error areas is then compared with the corresponding part of the recognition result of the rule-guided OCR engine. If the corresponding part of the recognition result of the rule-guided OCR engine matches the question's standard answer keyword template and answer box coordinate constraints, the content of the suspected error area is replaced with the corresponding part of the recognition result of the rule-guided OCR engine. Other high-confidence areas in the recognition result of the high-precision OCR engine are retained, thus obtaining the final OCR recognition result. Finally, a structured text result with confidence score, character-level coordinates, and semantic block annotation is output, and the OCR recognition results generated by each OCR engine are retained as alternative paths. A3. Construction of Context-Enhanced Composite Hints: Based on the structured text results output in step A2, construct hint words that far exceed the granularity of the main channel. The hint words contain the stem and scoring criteria of the original questions, and at least include: the semantic block annotations and spatial relationships in the structured text results; the segments with confidence scores below the threshold and their Top-3 candidates; and an explicit instruction requiring the large language model to return an atomic score object in JSON format containing fields such as score, reason, and quoted original text segments. Semantic blocks are classification labels for the logical functions of text regions, while fragments are the specific recognized text units that constitute these semantic blocks; confidence scores are generated for each specific recognized text unit, that is, each specific recognized text unit contained in a semantic block has a corresponding confidence score; Top-3 candidates for fragments with confidence scores below the threshold refer to the three most likely alternative recognized contents of the fragment, which are used by the large language model to determine which candidate result is correct in combination with the context. A4. Deterministic Large Language Model Inference and Double Verification Mechanism: Call the large language model, input the prompt words constructed in step A3 into the large language model, and force the activation of structured output constraints; After inference is complete, perform double verification: Format validation: Verify whether the output of the large language model conforms to the predefined JSON Schema, including whether the fields are complete, the types are correct, and the values ​​are within a reasonable range; Logical verification: The reasoning chain is traced back to the structured text result obtained in step A2 to verify whether it truly supports the scoring conclusion. Any failure of a verification will trigger the manual review interface; A5. Atomization Result Encapsulation and Audit Archiving: The verified scoring results are encapsulated into a standardized record containing metadata such as a unique re-batch transaction ID, the hash value of the original answer image, the processing time of each stage, the OCR confidence distribution histogram, and the consumption of large language inference tokens. This record is directly written into the audit log system, and the original scoring record of the student's assignment corresponding to the abnormal answer image is updated synchronously.

7. The method according to claim 1, characterized in that, In step S3, the student identity encoding information is embedded into the underlying pixels of the image using frequency domain steganography, which does not affect human visual perception, but can be restored by a dedicated decoder.

8. The method according to claim 1, characterized in that, Step S6 also includes: generating a re-batch audit log containing timestamps, operator information, batch ID, and exception handling logs.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.

10. A computer device, characterized in that, It includes a processor and a memory, the memory being used to store a computer program; the processor being used to execute the computer program to implement the method of any one of claims 1-8.