Skip to content
AI360Xpert
Beta

DBNet Binarizes Text Cleanly

DBNet learns its own threshold map for turning soft text heat into crisp polygons, so faint letters survive without flooding the page.

DBNet pairs a soft heat of 0.71 with a learned threshold of 0.42, keeping the faint stroke that a fixed 0.5 cutoff deletes
DBNet pairs a soft heat of 0.71 with a learned threshold of 0.42, keeping the faint stroke that a fixed 0.5 cutoff deletes

Why Does This Exist?

Fixed cutoffs force a bad trade. Low thresholds flood pages with noise, high thresholds erase faint receipts. One number cannot fit every pixel.

DBNet predicts the threshold itself per pixel and binarizes differentiably. It refines text detection, passes polygons to text recognition, and cleans the handoff into optical character recognition.

Think of It Like This

A flood line drawn per street

A town draws flood walls per street height instead of one city wall. Low streets get higher walls, high streets get lower ones.

It fails when the survey is wrong. Bad local walls flood some streets while walling off dry ones, just as bad thresholds keep noise and drop ink.

How It Actually Works

Predict probability pp and threshold tt per pixel, where pp is text heat and tt is the local cutoff. The binary map is b^=1/(1+exp⁡(−k(p−t)))\hat{b} = 1 / (1 + \exp(-k(p - t))) with sharpness k=50k = 50, where large kk nears a hard step but stays differentiable. Pixels with p>tp > t survive.

Worked example

A faint stroke has p=0.46p = 0.46 with learned t=0.42t = 0.42. Since 0.46−0.42=0.040.46 - 0.42 = 0.04, b^=1/(1+exp⁡(−50×0.04))=1/(1+exp⁡(−2))≈1/1.135≈0.88\hat{b} = 1 / (1 + \exp(-50 \times 0.04)) = 1 / (1 + \exp(-2)) \approx 1 / 1.135 \approx 0.88, so it survives. A fixed 0.5 cutoff deletes it because 0.46<0.50.46 < 0.5. A noise pixel with p=0.38p = 0.38 and t=0.42t = 0.42 gives b^≈0.12\hat{b} \approx 0.12 and stays out.

Watch Out For

Letting thresholds collapse to zero

Without supervision the map drifts down and everything passes. The symptom is full-page blobs. Supervise tt inside text borders and clip it to a sane band such as 0.2 to 0.7.

The Quick Version

  • DBNet predicts heat pp plus local threshold tt per pixel.
  • Binarization b^\hat{b} with k=50k = 50 stays differentiable for training.
  • Fixture heat 0.71 over threshold 0.42 survives while fixed 0.5 erases faint ink.
  • Adaptive cutoffs fit receipts, signs, and dense lines together.
  • Supervise and clip tt or the map floods.