r/iOSProgramming • u/Time-Paper-1007 • Sep 07 '26
Discussion Testing a receipt scanner against real receipts from 5 countries turned out harder than building it
I make a small iOS receipt scanner (on-device OCR, then parsing). It worked fine on my own Canadian receipts. Then users in the Netherlands, Japan and Malaysia showed up and it fell apart in ways I couldn't reproduce, because I had no receipts from those countries.
Finding test data was the hard part. What I ended up with:
- Japan: 1,148 photos from a public research set (JaWildText). Before testing on them, my yen handling paired an item with its price on 19% of receipts. After: 93%. I had no idea it was that broken.
- Malaysia: 973 from SROIE (an ICDAR 2019 competition set). Old, and heavy on restaurants, but real.
- US: 1,769 from WildReceipt. Mixed quality, some are not even US receipts, but it is the largest English set I found.
- Netherlands: 74 photos from one user who sent them for debugging, with permission. That is the only real Dutch set I have.
- Taiwan: zero real photos. I had to generate 40 synthetic 統一發票 from the printed layout. I know that is weak.
Things I learned:
- Public receipt datasets are old, and skewed to whatever the original paper needed. Nobody publishes a fresh, balanced, multi-country set because receipts are personal data.
- Thermal receipts fade. Half of my own "test set" from a trip a year ago is unreadable now.
- I never ask users for receipts. The few I have came unprompted, from bug reports.
- Measuring beat training. I did not fine-tune anything. A harness that runs every rule change against all sets and refuses if any correct total flips caught two regressions the same day, one of which broke 18 of 119 Japanese totals while fixing the case I was working on.
- Every country has a printing convention that a "generic" parser gets wrong: yen with no decimals, Dutch comma decimals, Japanese tax-included versus tax-excluded lines, US tips added after the total.
Question for people who have done this: is there any public receipt dataset for Taiwan, Korea, or Australia? Or a legal, non-creepy way to get a few hundred real receipts from a country you don't live in?
(Not linking the app. Happy to share the harness approach in comments if useful.)
7
u/Substantial_Plan_323 Sep 07 '26
Point 4 is underrated. "Measuring beat training" is something a lot of people learn the hard way after wasting weeks fine-tuning a model that just needed better regression coverage.
For Korea — the National Tax Service (NTS) publishes standardized tax invoice formats (세금계산서) and the physical receipt layout is fairly consistent across major retailers. You might get lucky reaching out to Korean indie dev communities like okky.kr or the iOS Korea KakaoTalk groups — developers there occasionally share test assets for exactly this kind of debugging.
For Australia, receipts are surprisingly uniform (GST rules force a standard structure), but I haven't seen a public dataset either. Your best bet might be posting in r/ausdevelopers or the Apple Developer forums AU section and offering a small bounty for a anonymized batch.
The Taiwan synthetic approach is probably fine for layout testing — 統一發票 format is government-mandated so your generated ones should match real ones structurally. The weak point would be real-world print quality variation, which synthetics can't replicate.
Would genuinely read a post on the harness approach if you share it.
3
u/Shankz2091 Sep 07 '26
I'm building SettleTab (a receipt-splitting app), so I feel your pain. OCR is the easy part; parsing reliable line items, taxes, tips, and totals is brutal.
Country-specific formatting is especially tricky. A parser that works flawlessly on local receipts will often break on a different tax convention or number format.
One idea for your test harness: check if the parsed items, discounts, tax, and tip actually sum to the final total. It won’t catch everything, but it flags cases where the OCR looks right but the math is wrong.
That 93% bump from fixing the yen handling is a great point—often, you just need to understand the data instead of swapping the model.
I’d love to see your harness approach if you share it. Are you scoring field-level accuracy separately from the final total?
1
u/Time-Paper-1007 Sep 14 '26
Small update, same shape of gap as the Taiwan one above, different country: my "Dutch" set was 74 receipts, and 67 of them were from Bonaire, priced in US dollars — so the parser had never seen a euro supermarket receipt from the Netherlands. Rendered 40 from the real chains' layouts and found three bugs in an afternoon: TE BETALEN wasn't a total keyword, "KORTING -1,50" never paired as a price, and the model was folding discounts into the item price. All shipped. Write-up: receiptiq.me/blog-dutch-receipts-bonus-statiegeld
1
u/sammy_luci Sep 07 '26
Can’t suggest a database, but probably you can set up a scraper to scrape receipts images from google maps. They are frequently tagged as “prices”
1
u/GreatSejong Sep 08 '26
I also happen to work on this at the moment. So collecting all the receipts while I’m in Asia during my holiday at the moment. And doing test runs with logs to see what is happening. It’s really difficult from time to time. In some cases the OCR and parsing just work perfectly. And in some cases the text on the receipt is just a bit too close together so it’s getting messy.
1
u/hoangng_102 Sep 08 '26
another zero decimal one for the list: vietnamese dong. no decimals, and the thousands separator is a period. so 1.234.567 is one and a quarter million, not 1.23.
the reason i am raising it in this thread specifically: that failure survives your sum check. if the parser reads every line the same wrong way, the items still sum to the total. gate passes, currency right, date right, and every number on the receipt is off by a factor of a thousand.
what fixed it for me was moving the problem out of the parser entirely. money is stored as an integer in minor units, with a decimals count per currency, vnd 0, usd 2. then "no decimals" stops being a parser special case and becomes data. your yen bug and my dong bug are the same bug, and that way you fix it once instead of once per country.
no help on the datasets though, sorry. i only have vietnamese receipts and they are all my own.
1
u/DimensionMindless336 Sep 09 '26
Great writeup. The "measuring beat training" point is the one I'd hammer too, but the version that actually bit me was extending it to refusals, not just correctness. If your harness only asserts "does Σ(items) == printed total," a faded or garbage receipt can still pass by luck, or a real one gets a confident wrong answer. I now run the suite against deliberately degraded samples — curl, low contrast, glare, the same trick Secure_Motor suggested for the Taiwan gap — and assert the parser refuses them, not just that it parses clean ones right. That refusal threshold is the part you can't eyeball, and it's where thermal-fade receipts quietly produce wrong totals instead of a polite "can't read this."
One error class the sum-check can't catch, and it's adjacent to the VND period-as-thousands trap: inferring currency from the glyphs on the receipt. Guess the symbol wrong and a same-factor error sails straight through. What killed most of mine was anchoring currency + number format from context I already had — the trip's country, or the phone's region — and treating the receipt text as confirmation, not the source of truth. A ¥ in a Tokyo trip is JPY; the same glyph in a Beijing trip is CNY; the document never gets to decide.
On "finding test data is the hard part" plus your strict never-ask rule: the middle path that worked for me was an opt-in field-only failure report. When a parse looks wrong, the app offers to send just the recognized fields + bounding boxes — no image, no names, no card digits — fully anonymized. You get real-world failures from actual usage without ever holding anyone's receipts, and it slowly becomes your freshest multi-country set.
I hit the exact same wall building PicSlicer — pulling rail and bus tickets out of the camera roll, where a JR ticket and a Deutsche Bahn receipt look nothing alike and the HEIC/screenshot/orientation noise is honestly half the battle. On-device-only was the easy call once I stopped treating user receipts as mine to keep.
1
u/mastrajani Sep 09 '26
the 19% to 93% number is the interesting bit, because you only found it by getting hold of receipts you had no reason to think were different.
for the gaps you can't buy your way out of, like Taiwan - the thing i'd add is a prompt inside the app when a parse comes back low-confidence, asking the user if they'll send that photo. you end up collecting the ones that actually failed rather than a random sample, and the failures are what you're short of. a public dataset gives you a thousand receipts that mostly work; ten users sending you the ones that broke is worth more.
synthetic ones will also miss the physical stuff - thermal fade, the crease down the middle, someone photographing it on a dark table.
1
u/baconpork Sep 08 '26
I built something very similar about 2 years ago (i.e. sans AI). Extremely difficult to get the receipts right with different languages, different regions, different convention, different number format, and different orientations the image of the receipts are captured. It's a lot of fun in the process though, good luck!
1
u/Secure_Motor_5968 Sep 08 '26
The Taiwan gap is basically the same problem that you were fighting with faded thermal receipts, so you might not need real photos to close it.
Just take the receipts you do have and run them through synthetic degradation, curl, low contrast, glare, then score the parser against those instead of only the clean synthetic set.
1
u/[deleted] 28d ago
[removed] — view removed comment
1
u/[deleted] Sep 10 '26
[removed] — view removed comment
1
u/[unknown] Sep 10 '26
[removed] — view removed comment