Case Study

Otocropper — Offline Question Cropper for Scanned Question Banks

An offline Mac app that turns scanned Turkish question-bank PDFs into one image per question, named by the printed question number and filed by unit and test. Built for teachers at Erkan Ulu Okulları in Istanbul. A 414-page book (1,831 questions) goes from import to ready-to-review crops in 6 min 22 s on an M5 Max.

Client: Erkan Ulu Schools Sector: K‑12 Education Platform: macOS, Offline Owner: Savaş Tutumlu Status: Deployed · v1.0.4

Inside Otocropper

From scanned page to filed questions, the review app and the held-out test. Publisher pages are blurred. Select any image to open it at full size.

The Problem

Question banks arrive as scanned books. Teachers needed every question as its own image, filed the way the book is printed, without leaving their Mac.

📄

Crowded Pages

A scanned page mixes several questions with passages, figures, instructions, section headers, headers and footers, and answer keys.

🗂️

Filed Like the Book

Each question has to come out as its own image, named by its printed number and filed by unit and test.

💻

No Setup for Teachers

Teachers need no Terminal, Python or internet connection: everything runs offline inside one app.

What Was Built

A trained detector and a native Mac app, from data labeling to a notarized release.

🎯

Page-Region Detector

An RT-DETRv2 object detector fine-tuned on 7 page-region classes (question, passage, figure, instruction, section header, header/footer, answer key), using pages from a five-book labeled corpus.

🏷️

Labeling Pipeline

Draft labels went through a verifier pass and a FastAPI box editor, which fed reviewed labels into COCO train, validation and test splits.

🧩

Four-Pass Inference

Two checkpoints and three input scales, fused with weighted box fusion. Thresholds were calibrated on the validation split.

🔍

Rules From Error Analysis

Three post-processing rules (ink gate, right-edge trim, class competition) came from reviewing every remaining error by eye, and each was measured on validation before test.

🔢

Names From OCR

Tesseract reads question numbers and test and unit headers, so exports mirror the printed book: 1.jpg, 4-G.jpg for full-width questions, 7_with_passage.jpg for shared passages.

🍎

Native Mac App

A SwiftUI app bundling Python 3.13, PyTorch on the Apple GPU (MPS), Tesseract and both checkpoints, signed with Developer ID and notarized.

97.1% Recall on a held-out 238-page book (554 questions), IoU ≥ 0.9
96.9% Precision on the same book, IoU ≥ 0.9
222 / 238 Held-out pages that needed no edits
6 min 22 s A 414-page book (1,831 questions) from import to ready-to-review crops on an M5 Max

The held-out book was never used in training. Thresholds and rules were chosen on the validation split, then frozen for the test book.

Engineering Highlights

Measured on validation, proven on a book the model never saw, shipped to teachers' Macs.

  • Strict scoring — a predicted question box counts as correct only at IoU ≥ 0.9 with the reference label.
  • Multi-scale fusion — fusing three input scales of one checkpoint raised fully correct held-out pages from 90.3% to 92.0%; the shipped detector adds a second checkpoint as a fourth pass.
  • Error-analysis rules — the ink gate removed 12 false positives and class competition 5 more, at no cost in true positives on the test book; right-edge trim added 4 true positives.
  • Licence-aware model choice — RT-DETRv2 rather than YOLO: the app ships no Ultralytics or DocLayout-YOLO code, to avoid AGPL licensing.
  • On-device inference — PyTorch on the Apple GPU (MPS), fully offline.
  • Release discipline — checked against 20 PDFs from the school (4,813 pages) before release 1.0.2; five versions shipped between 8 and 14 September 2026, the last two in response to teacher reports.

Role: Savaş Tutumlu was the sole developer: data labeling, model training and evaluation, the macOS app, packaging and release.

Pipeline

TRAINING (CUDA workstation)
+------------------------------+
| five-book labeled corpus     |
| draft labels -> verifier     |
| FastAPI box editor           |
| COCO train / val / test      |
| fine-tune RT-DETRv2          |
| calibrate on validation      |
+--------------+---------------+
               |
               | weights (2 checkpoints)
               v
ON THE MAC (offline)
+------------------------------+
| render PDF pages             |
| detect: 4 passes, fused      |
| clean up: 3 rules            |
| Tesseract OCR (Turkish)      |
| review in SwiftUI app        |
| export: unit / test / 1.jpg  |
+------------------------------+

Python, PyTorch, Tesseract and both checkpoints ship inside one app

Technology Stack

  • RT-DETRv2
  • PyTorch (MPS)
  • Python 3.13
  • Weighted box fusion
  • Tesseract OCR
  • FastAPI
  • COCO
  • SwiftUI
  • Developer ID notarization

Status

  • August 2026 — corpus, labeling and model training.
  • 8 September 2026 — version 1.0.0 released to the school.
  • 9–14 September 2026 — versions 1.0.1 to 1.0.4; 1.0.3 and 1.0.4 followed teacher reports.
  • 24 September 2026 — a practice-exam edition, 1.0.0.
  • Today — deployed and in use by teachers at Erkan Ulu Okulları (school app 1.0.4; practice-exam edition 1.0.0).

Ready to Transform Your Operations?

Let's discuss how custom AI solutions can solve your unique challenges.

Schedule a Consultation