Case study · 02 / 2025 · Vision-Language AI
A full-stack Vision-Language system that automates exam sheet grading. The local model reads handwritten student answers and scores them against rubrics.

- Role
- Vision-Language AI
- Year
- 2025
- Outcome
- End-to-End VLM Pipeline
- Architecture Stack
- Next.jsFastAPIOllama Qwen2.5-VLOpenCV
01 / Context & Problem Statement
Multiple-choice exams are quick to score but manual grading sheets and standard optical mark readers are expensive and inflexible. This system provides a web-based automated exam grading solution using computer vision and local vision-language models (VLMs) to read, score, and manage exam sheets from camera photos.
02 / System Architecture & Pipeline Flow
Camera Capture & OpenCV Deskew
Applies Canny edge detection, 4-point perspective transform, and adaptive thresholding on mobile photos.
ROI Segmentation & Bubble OMR
Extracts Student ID, Exam Code, multiple-choice grid, and crops handwritten short-answer regions.
Local Qwen2.5-VL Inference
Runs quantized Qwen2.5-VL via Ollama locally to transcribe and grade handwritten answers against rubrics.
FastAPI + Next.js Analytics
Cross-checks multi-code Excel answer keys and exports annotated grading sheets & class score distributions.
03 / Engineering Approach
Built the frontend using Next.js and TailwindCSS, backed by a FastAPI backend. The image preprocessing pipeline is written in Python using OpenCV to perform perspective correction, image alignment, and bubble-sheet detection. For complex handwriting recognition or text questions, a local Qwen2.5-VL model served via Ollama is integrated, enabling offline, highly secure processing of student answers. Teachers can upload multi-code key spreadsheets via Excel and process student submissions in bulk.
04 / Key Engineering Deliverables
- Perspective correction & illumination normalization pipeline in OpenCV
- Local Vision-Language Model (Qwen2.5-VL) integration via Ollama REST API
- Multi-exam-code Excel key importer and automated gradebook export
05 / Engineering Reflection
"Offline-first AI products require careful resource management. Tuning Qwen2.5-VL to run on consumer hardware showed me how to balance physical latency with inference accuracy, creating a private-by-design tool schools can trust."
