Skip to content
Interface language: English
Audit / Signal

Reading barcodes: an AI model or a dedicated decoder?

Separate barcode decoding, OCR and catalogue search when evaluating an identifier-reading process.

Article language: English

Illustration of two people at a table before a large circular structure and mountains.
In this article

A simple comparison can help check whether a result depends on visible print: prepare one label with the symbol visible and the digits covered, and another with digits but no symbol. Calling both “barcode reading” hides the difference in method. We do not conduct that image test here; we establish what it should resolve.

Before comparing, establish the expected result from an independent reference. Remove or mark other clues in the image and metadata that could reveal the number. Keep the original and both variants. A correct answer from a model alone does not prove that it decoded the symbol: it may have used other information.

A barcode encodes data in a particular symbol. Adjacent text may present it to a person, while a product name may only come from a catalogue. A model that can describe a label is not necessarily the right tool for each stage. An attractive description of a package is not permission to correct its identifier.

Establish the required result first

Consider a fictional decorative-paper wholesaler. An employee photographs a package and wants the correct catalogue record. The label has a collection name, format, internal number and product code. The name can be transcribed correctly while a package of a different format is selected. The symbol can also be decoded correctly without a match in the company's current catalogue.

Acceptance should distinguish the decoder result, meaning the symbol's decoded contents, from text recognised by OCR and from the database record found. OCR means optical character recognition. These results can complement one another, but their origins should not be mixed in a single “product recognised” field.

GS1 describes human-readable interpretation (HRI) as human-readable information corresponding to data encoded in the carrier. It also notes that parentheses marking application identifiers in that representation are not encoded in the carrier. Reading the print and decoding the symbol therefore require appropriate interpretation of the format, even where their data are related.

The process may allow both routes as separate methods. If the symbol is illegible, reading the text may help the employee, but do not present it as successful decoding. Retain the result's source in the report so that the method and the kind of material on which it worked can be assessed later.

What if decoder and OCR return different strings? First distinguish presentation differences from different data. The parentheses described above may belong to presentation, but a different digit requires explanation. Do not choose a result because it looks familiar. At the wholesaler, an employee can compare both readings with the label; the system should retain the discrepancy until it is resolved.

OCR quality control before AI (in Polish) covers character accuracy and association with the image. A barcode also requires identifying the symbol type and its representation rules. A firmer instruction to “read carefully” is not enough when the job calls for another kind of tool.

A decoder needs an appropriate scope

For comparison, choose a tool that supports the symbol types in the company's materials. EAN, Code 128 and Data Matrix are not interchangeable names for any image containing data. Acceptance needs to establish permitted formats and the output of the particular library or service version.

The ZXing README lists supported one- and two-dimensional formats and describes the project's maintenance mode. It is an example of a specialised library with a defined scope, not a recommendation of any old application with a similar name. Version and deployment choices need separate checks.

The test set should include a readable symbol, a rotated symbol, glare and a no-read case. Add only conditions corresponding to actual photographs. A readable flat label on a light background does not establish performance on a curved package with glossy film. Retain the original, prepared image and tool version.

Where a label contains several codes, establish which one is needed. A package may have a manufacturer's symbol and a separate internal code. Automatically choosing the first recognised result may not suit the employee's task. The response should retain the type and position of the decoded symbol when the tool provides them.

If the user selects the relevant image area, record that choice too. A result from a crop should not later appear to represent all codes on the package. With two readable symbols, acceptance must establish both readings' accuracy and selection of the correct catalogue number. This is separate from merely establishing that the library found something.

No read should remain no read. A text-generating model can suggest a plausible string, but that does not make it the contents of a damaged symbol. An appropriate next step may be a new photograph, reading the print or manual checking. The criterion depends on the identifier's role in the process.

Separate file retrieval failure from a successfully executed test with no recognised code. If the material never reached the decoder, its result does not describe label readability. Lack of support for a symbol format does not establish that the code is defective. First determine whether the task was within the tool's scope.

Do not record these different states as identifier “0”. An empty response, an unsupported format and a failure have different causes and next steps. Give each a separate status outside the field containing decoded data. Otherwise a search system may receive an artificial number and a report may treat a failure as an ordinary test with no product found.

Aeneia conceptual photography

A valid structure does not confirm the whole product

GS1 describes the check digit as a way to check number integrity and explains that the meaning of a whole GTIN, a product identifier, requires database information. Checking format and establishing product identity are separate steps. A valid check alone does not provide the name, variant or confirmation of what is inside the photographed package.

Do not automatically correct the last digit because a reading fails the check. That can create a new formally valid string that does not match the label. Retain the raw reading and verification result. If the system suggests candidates for manual checking, present them as suggestions with an identifiable basis.

Leading zeroes are part of the identifier's representation. When passing it between tools, do not treat it as an ordinary number for arithmetic. Preserve the specified textual representation and agreed transformation rules. A spreadsheet showing a shorter string can conceal a change that later reaches the catalogue query.

Assign data preparation rules to a specific format. “Remove everything except digits” is not a safe general recipe for every symbol reading. The wholesaler may use internal identifiers containing letters alongside product numbers. Keep the input and the value prepared for lookup separately so the transformation can be reconstructed. Preparation must not silently replace a reading by guessing another identifier.

Verified by GS1 provides certain information about the company associated with an identifier and product data when available. It is an additional source for checking catalogue identity, not the decoding itself or an inspection of a particular package's contents.

In the fictional wholesaler, the next step is comparison with the package record: the correct paper, format and number of sheets in the offered set. If no record exists, the system should show the decoded identifier and the absence of a match. Substituting a similar collection name would create an appearance of success without confirming the right product.

Search begins after reading

Embeddings can find similar meaning but do not replace an exact part number (in Polish). An identifier read from a label should therefore undergo the agreed exact check. A nearest catalogue record may help an employee, but it needs a separate label and confirmation.

For hybrid search combining two rankings (in Polish), also accept-test identifier handling. A lexical result based on an exact string should not lose significance merely because another record has a very similar description. The combination method must fit a task where a one-digit difference may identify another item.

Visual product search (in Polish) provides a different basis again. Similarity between photographs may narrow the catalogue but cannot repair an unread number. Retain whether a suggestion comes from appearance, recognised text or decoding so the user knows what remains to be checked.

A product-type identifier need not distinguish every physical unit. Two packages with the same offer code are not necessarily one object photographed twice. When counting distinct objects in photographs (in Polish), a separate basis is needed to distinguish units. Do not automatically merge every identical number into one object.

An Aeneia Audit review can address how AI is used, how data flows and what risks arise in this process. Its scope is agreed before work starts. If you need a decoder selected or technically assessed, separately establish who will do that work and on what terms.

The report should show the route to the correct record

For each test, retain the image, symbol type, reading method, resulting string and subsequent check. For a manual decision, add the selected result and reason. Overwriting the field alone would remove the earlier discrepancy even though it explains the employee's involvement. Retain what is needed to resolve the task. If a report contains only the final paper name, it cannot show where an identifier was substituted or why a correct code did not find a record.

Compare methods on the same materials and against appropriate criteria: a decoder on the symbol contents read, OCR on characters and search on the correct record. Cost and time for the whole route can also be assessed if relevant to the decision. Do not choose a method merely for returning some text quickly.

The proposed report should separately show exact reads, wrong reads and no-read attempts. For each, retain the expected answer established from a reference sample. Do not remove difficult photographs from the denominator merely because the tool returned no result. An honest stop limits error risk but does not increase the number of correctly decoded labels.

Before testing, define the unit: images, symbols or attempts for a given method. Report all planned attempts, each metric’s denominator and reasons for exclusions. Show retrieval failures and unsupported formats separately; do not hide them among no-read results. Difficult images that reached the tool and fall within its scope remain in the comparison even when no result is returned. For multiple symbols, report reading accuracy separately from choosing the correct catalogue number.

You can also record how many packages an employee ultimately matched to the right record and how many needed manual help. That is a whole-process result, including catalogue availability. It avoids blaming a decoder for a missing database record or crediting it with a manually transcribed number. This separation helps decide whether the next improvement concerns images, the tool or product data.

In our example, a correctly handled attempt ends with the right record or a recognisable stop for checking. No read remains no read, not successful decoding credited to the library. Such a separated process can stop an error before another paper is selected. An answer containing many digits is not by itself a reason to send it onward.

Aeneia / Aeneia editorial

Editorial article. Source links are included in the text.

About Aeneia

Brands we have worked with

  • L’Oréal
  • Garnier
  • Netflix
  • Carrefour
  • Warner Bros. Discovery
  • Biedronka
  • HBO Max
  • Wolt
  • Żabka
  • COSRX
  • Embassy of China in Poland
  • Mixa
Aeneia / Initium

From knowledge to a decision

Tell us what you want to put in order. We will agree on where to start.

Contact Aeneia

We partner with and use solutions from:

  • Google
  • OpenAI
  • Microsoft
  • Stripe
  • Anthropic
  • Linear