Introduction
Grading in Science, Technology, Engineering, and Mathematics (STEM) disciplines presents a unique challenge for automation. Unlike humanities subjects where assessments are primarily text-based, STEM evaluations are inherently multimodal, requiring students to combine textual explanations, mathematical notation, and structural diagrams like flowcharts or circuit schemas.
Existing automated grading tools often fail in two critical areas: accurately transcribing messy, handwritten text and understanding the underlying logic of diagrams. Most current systems treat diagrams as static images to be compared for visual similarity. However, two flowcharts can look visually distinct—using different terminologies like "Yes/No" versus "True/False"—yet remain logically identical. This research introduces a system designed to bridge the gap between visual representation and semantic meaning, providing a more robust framework for automated STEM grading.
Methodology: The Multi-Stage Pipeline
The proposed system utilizes a multi-stage pipeline that processes text and diagrams as distinct but interconnected data streams. This architecture allows the system to evaluate the semantic logic of a student's work rather than relying on superficial visual matching.
Text Extraction and OCR
To handle the complexities of handwriting, the system employs CRAFT (Character Region Awareness for Text Detection) to pinpoint text regions and TrOCR (Transformer-based Optical Character Recognition) for transcription. A key refinement in this pipeline is the use of line-by-line segmentation. By providing the OCR model with the context of a full line rather than isolated words, the system significantly improves the accuracy of transcribing technical STEM terminology.
Diagram Evaluation and Semantic Mapping
The most significant contribution of this work is the approach to diagrammatic evaluation. Instead of image-to-image comparison, the system uses YOLOv5 to detect flowchart elements such as blocks and arrows. These visual elements are then converted into a structured textual description (an adjacency list) containing Block IDs, types, internal text, and logical connections.
LLM-Based Assessment
Both the transcribed text and the structured diagram descriptions are passed to Mistral-7B, a Large Language Model (LLM). The LLM compares the student's input against a provided "model answer." By evaluating factors such as grammatical correctness, logical flow, and keyword coverage, the LLM can recognize "logical equivalence." This allows the system to award marks for a correct logical process even if the student's diagram does not visually mirror the reference key.
Results and Discussion
The system was evaluated using a custom internal benchmark of 250 questions collected from 50 student papers across five subjects: Data Structures and Algorithms (DSA), Computer Networks (CN), Design and Analysis of Algorithms (DAA), Computer Systems Design and Fundamentals (CSDF), and Software Engineering (SE).
Quantitative Performance
Out of the 250 questions tested, 196 (78.4%) received marks that aligned with human grader expectations. Performance varied by subject complexity:
- Software Engineering: 42/50 correct assessments.
- Computer Networks: 41/50 correct assessments.
- Design and Analysis of Algorithms: 36/50 correct assessments.
The lower performance in DAA and DSA is attributed to the higher complexity of the logic and diagrams involved, which places greater demand on both the OCR and the LLM's reasoning capabilities.
Qualitative Insights
A major advantage of this LLM-integrated approach is the ability to provide nuanced feedback. Rather than a binary score, the system generates a "Reason" for each grade. For instance, it can specifically identify if a student missed a "memory allocation" step in a text answer or if the block ordering in a flowchart was logically flawed.
Limitations and Future Directions
While the results are promising, the system's efficacy remains sensitive to handwriting legibility; if the initial OCR step fails, the downstream LLM assessment is compromised. Currently, the diagrammatic evaluation is focused on flowcharts. Future iterations aim to expand this capability to include UML diagrams, ER diagrams, and mathematical graphs. Additionally, the researchers plan to scale the dataset and explore support for Indic languages to increase the tool's accessibility in diverse educational environments.
Summary updated