Data entry ops · Production

Dropbox builds ML-based document detection pipeline for iOS scanning

The problem

Dropbox needed accurate, fast document detection that could run on mobile devices. DNNs were too expensive in compute and memory for mobile deployment, and Apple's built-in rectangle detection SDK was insufficiently accurate for essential use-cases such as scanning small receipts or business cards in cluttered backgrounds.

First attempt

DNNs were ruled out due to mobile compute and memory cost. Apple's rectangle detection SDK underperformed in complex scenes. The Canny edge detector was trialled but produced poor results because it amplified text inside the document while failing to clearly detect document edges.

Workflow diagram · grounded in source
1
User scans document
trigger
“This new feature allows users to scan documents with their smartphone camera and store those scans directly in their Dropbox. The feature automatically detects the document in the frame”
2
ML-based edge detection
ai_action
“Right: the output of the machine learning-based edge detector”
3
Hough transform line finding
ai_action
“we use the venerable Hough transform, a technique that lets individual data points "vote" for likely solutions to a set of equations. In our case, each detected edge pixel votes for all lines passing through that point”
4
Quadrilateral scoring and selection
ai_action
“enumerate all possible quadrilaterals, each of which is scored by adding up the probability predicted by the edge detector over pixels along its perimeter. The quadrilateral with highest score is output as the detected document”
5
Extract and save as PDF
output
“extracts it from the background, fits it to a rectangular shape, removes shadows and adjusts the contrast, and finally saves it to a PDF file”
6
OCR for Business users
ai_action
“we also run Optical Character Recognition (OCR) to recognize the text in the document for search and copy-pasting”
Reported outcome

Dropbox's custom pipeline runs near-realtime at 8–10 frames per second, requires much less labeled training data than DNNs, and produces detections 60% less likely to need manual user correction than Apple's SDK — validated by an A/B test.

Reported metrics
manual correction likelihood vs Apple SDK60% less likely
Pipeline throughputnear realtime at about 8–10 frames per second
Reported stack
OCRHough transform
Source
https://dropbox.tech/machine-learning/fast-and-accurate-document-detection-for-scanning
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

Dropbox's custom pipeline runs near-realtime at 8–10 frames per second, requires much less labeled training data than DNNs, and produces detections 60% less likely to need manual user correction than Apple's SDK — val…

What tools did this team use?

OCR, Hough transform.

What results were reported?

manual correction likelihood vs Apple SDK: 60% less likely; Pipeline throughput: near realtime at about 8–10 frames per second (source-reported, not independently verified).

What failed first in this deployment?

DNNs were ruled out due to mobile compute and memory cost.

How is this data entry ops AI workflow structured?

User scans document → ML-based edge detection → Hough transform line finding → Quadrilateral scoring and selection → Extract and save as PDF → OCR for Business users.