Brick marking
A barcode that has to survive the kiln
- Year
- 2023
- Type
- Marking & Identification
- Material
- Brick
- Format
- R&D
- Technology
- ML / Computer Vision
- Reading
- 5 min

Translated from Russian.
In 2023 we investigated whether every brick could be marked right in the clay: a code pressed into the wet blank on the forming line, carried through drying and firing, and read by an ordinary phone camera. The study ended in a well-grounded decision not to take it into production — and that is a result too.
The task
The customer needed every brick marked individually, without stickers: an imprint in the clay itself while the blank is still soft.
The main difficulty is clear from the start. After forming, the clay column dries and goes into the kiln; the clay shrinks and warps, and the code warps with it — the bars change size and shape. Yet the code must be read with an ordinary phone, on the shop floor, in poor light, with shadows and dirt on the surface.
Many doubted the idea would work. The study went ahead all the same: a decision should rest on test results, not on forecasts.
First attempt: Code128
We started with the standard linear Code128. It was rolled onto the wet clay column right on the line; we printed reference sheets at different scales and built in an allowance for shrinkage.




After drying and firing the code could not be read. Code128 stores data in the widths of bars and gaps, and the clay distorts exactly the width: a narrow bar spreads into a wide one, and the code loses its meaning.
Choosing a format: RM4SCC
The next step was choosing a format. We compared about a hundred encoding methods against two requirements:
- as much error-correction headroom as possible — the code deforms heavily as it dries;
- reliable reading at low contrast, in shadows and with dirt.
RM4SCC fit best — the Royal Mail postal code used to sort letters.
Each symbol consists of four bars. The bars differ only in height and position relative to the centre line: short in the middle, up, down or full height. Bar width and the gaps between them carry no data, so the deformation of the clay does not change the meaning of the code.
In every symbol exactly two bars go up and exactly two go down. If one bar of the four cannot be read, but its position is known and the other three are recognised correctly, it can be restored.
Prototype on the line
The code was applied the same way as Code128: a roller with the code in relief rolls over the wet clay column.


Out of the kiln the brick came with bloom, cracks and dirt on the surface — recognition had to cope with that.
Recognition
For RM4SCC we tested three models in sequence:
- The first marked each symbol with its own colour to split the code into groups of four bars. This approach did not work.
- The second read the whole code: an image in, a string of symbols out.
- The third worked at the level of individual bars: it determined the type of each bar, CTC combined the results into a string, and symbols were assembled from groups of four bars.
The models were trained on synthetic data: the code on brick and stone textures with shifts, tilt and shape distortions.



The last symbol of an RM4SCC code is a check symbol: it is computed from all the others and shows whether the code was read correctly. We also used it to repair damaged codes. If a symbol was not recognised, CTC put the [UNK] marker in its place, and the position of the gap was known exactly — that is why CTC was needed. The allowed symbols were then substituted into that place by brute force, checking the check symbol each time: on a match the code counted as repaired.
After experiments with models, image correction and code recovery, we narrowed the model’s task: it only finds the boundaries of the marking, while an algorithm normalises the image and decodes the bars. In tests this combination proved the most reliable.

This is how reading with a phone camera looked:

Results
The study confirmed:
- linear Code128 does not suit an imprint in clay: deformation destroys data stored in bar widths;
- RM4SCC, where data is stored in the height and position of bars, survives drying and firing and can be read by a phone camera;
- the most reliable approach is the pairing “the model finds the marking — an algorithm normalises and decodes”; the check symbol allows damaged codes to be repaired.
The customer’s decision
Item-level marking did not go into production. The customer chose ordinary batch labelling: a sticker with a DataMatrix code on each batch. The work remained a research project.

