Bilal Irfan
Work

Multimodal AI Exam Evaluation

Marks scanned exam papers against the mark scheme and hands them back annotated.

2026 · Client project

Overview

Students upload a past exam paper, as a PDF or a few phone photos. A vision model marks every answer against that exam's mark scheme, and the student gets their own paper back, highlighted in red, orange and green, with feedback on each question and topics to revise.

Calling a model on an image is the easy part. The hard part is making marks consistent and checkable across uneven scans, stopping the model from awarding marks for answers it can't see, and making sure a failed run never costs a student a credit. I built the AI grading pipeline and backend engineering with a small team at KNYSYS.

How a paper gets graded

Upload

A 12-page biology paper, photographed on a phone.

  1. Quality check

    Every page gets a sharpness score. Blurry photos are rejected with a clear message before any AI runs.

  2. Prepare pages

    Each page becomes two images: a smaller one for grading and the full-resolution original for annotation.

  3. Grade

    A vision model marks every answer against the mark scheme. Papers over 8 pages are graded in overlapping 6-page chunks, then merged.

  4. Validate

    The output must fit a strict schema, or it goes back to the model with the errors.

    • marks ≤ max marks
    • low confidence → human review
    • answer not visible → 0 marks
  5. Annotate

    An image model highlights each answer on the original page.

    • Q1a correct
    • Q2 partial
    • Q3b incorrect

Result

The student's own paper, marked and highlighted, with feedback per question, a model answer and topics to revise.

If grading still fails after 3 retries, the attempt is marked failed and the student's credit is refunded.

An illustrative example. No real student work is shown.

What made it hard

Students need to trust the marks, and teachers need to be able to check them. Four things made that hard:

Architecture

  1. Upload PDFs or photos and merge them into one PDF
  2. Reject blurry pages
  3. Render page images at two resolutions
  4. Grade with GPT-5.2, falling back to Gemini 2.5 Pro, in chunks for long papers
  5. Validate against the schema and retry with the errors
  6. Annotate each page with an image model
  7. Save results, email the student and serve signed download links

Key features

Built with

Django REST FrameworkCeleryRedisPostgreSQLLiteLLMInstructorPydanticGPT-5.2Gemini 2.5 ProGPT-ImagePyMuPDFS3Docker

What I learned