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
A user scans a document with their smartphone camera and the feature automatically detects the document in the frame.
source quote
“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
A machine learning-based edge detector produces an accurate edge map of the input image.
source quote
“Right: the output of the machine learning-based edge detector”
3
Hough transform line finding
Ai action
The Hough transform finds straight lines in the edge map by having each edge pixel vote for all lines passing through it.
source quote
“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
All possible quadrilaterals formed by line intersections are scored using edge detector probabilities, and the highest-scoring one is output as the detected document boundary.
source quote
“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
The detected document is extracted from the background, fitted to a rectangular shape, shadows removed, contrast adjusted, and saved to a PDF file.
source quote
“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
For Dropbox Business users, Optical Character Recognition (OCR) recognizes text in the document for search and copy-pasting.
source quote
“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
◆ Does this fit your context?

Compare to your context

Tell us your scale, team, and constraints. We'll show what changes at your size, what fails at your scale, and whether this case is a fit, needs adaptation, or won't scale to you. Free demo, no signup.

Compare to your context →
~30 seconds · free
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.

WHAT TO DO WITH THIS

Now compare it to your context

This case is one data point. Whether its pattern fits you depends on your volumes, your stack, and your exception load — that comparison is the step no case study can do for you.