LevelHead
Code
Training-free page orientation

Deskew before you classify

Level the page first, then let any frozen orientation model vote over its four quarter turns.

Anonymous authors · paper under review

Classify-first versus LevelHead on a page turned 152 degrees
Classified first, a tilted page stays upside down and OCR reads gibberish. Levelled first, it comes out upright, for every backbone (right).

TL;DR Pipelines pick a page's quarter turn first and remove its tilt second, so the classifier sees pages unlike any it was trained on. LevelHead swaps the order and votes over the four quarter turns of the level page. Nothing is trained.

Method

Level the page, ask the backbone four times, roll back and combine
Any angle splits as θ = 90°·k + s. A spectral deskewer removes s; the backbone sees the level page in four turns; answers are rolled back and multiplied, so a fixed preference for one answer cancels out.

Results

SettingClassify-firstLevelHeadGain
4 classifiers, pages at any angle71.985.2+13.3
4 Qwen3-VL models, 7 benchmarks41.984.6+42.7
GPT-4o-mini, 7 benchmarks34.369.9+35.6
Gemma-4-31B, 7 benchmarks62.094.5+32.5
DeepSeek-V4.1-Flash, 7 benchmarks68.896.5+27.7
4 classifiers, phone photos at any angle69.389.8+20.5
4 classifiers, DISE scans at any angle65.091.3+26.3
One page per difficulty level
One page per difficulty level, where the two orders disagree. Same backbone (Qwen3-VL-32B), same vote; only the order differs.

A deskewer that reads photographs

An ink edge at the padding outvotes the text; a Hann taper restores it
The released jdeskew pads a page with white and then thresholds it, so a photo gains an ink line where it meets the padding. That line wins and the answer is 0°. A Hann taper fades it: photos left more than 15° off drop from 31% to 1.3% (screen) and from 33% to 2.6% (oblique). See it live.

Benchmarks

Seven labelled sets

ORB receipts, Indic scripts and documents on photos, plus ODB-4 and ODB-any from all 1,651 OmniDocBench pages.

Phone photos

1,433 Real5 photographs turned by known quarter turns and angles.

Scans

2,800 DISE 2021 test scans with known skew, in all four quarter turns.

Screen photographs corrected by both orders
Screen photographs at arbitrary angles: classify-first leaves them a quarter or half turn off; LevelHead turns them upright.