AI-Driven Bread Counting: Automating Bakery Production Lines with Computer Vision
99.9% Accuracy in Automated Bread Counting: Processing 1,000,000 Units Daily

Summary
Clients. Bakeries, bread-making enterprises, bakeries, bakeries and retail chains that produce various types of bread and bakery products.
Task. Organise the recognition and counting of bread at different stages of production and product movement.
Result. CamContador video counters operate successfully, recognising and counting a million units of bread and bakery products every day.
Situation
Bakeries often experience shortages of manufactured products. The reason lies in the human factor. Unaccounted product losses often resulting in internal shrinkage that remains undetected by standard security measures. Because of this, businesses suffer unexpected losses, use more raw materials, and cannot keep accurate records of manufactured products.
The most obvious way to minimise such situations is to install CCTV. However, this does not solve the problem completely. Even if cameras are installed in all possible locations, this will not provide 100% protection against shortages.
It is another matter when the video surveillance system is integrated with the accounting system. If cameras are placed at key points in production, it is possible to count the number of products at each of them. And if a shortage occurs, it is possible to determine when it occurred and identify the person responsible.
Video cameras are often already installed above ovens and conveyor belts. All that remains is to teach them not only to film, but also to count products. This is the kind of request we receive from bread factories and bakeries.
Challenge
Install a video counter to monitor the quantity of products manufactured. Filming should be carried out from different angles and at different stages of production. Important filming points: dough entering the oven, finished products leaving the oven, and transportation of bakery products on the conveyor belt.
Solution
Unlike counting eggs or cans, counting bread is more complicated. Bakeries and bread factories usually produce not one but several varieties of bread and bakery products. The same ovens are used, but the products that come out of them differ in appearance.
A general count of products does not always solve the customer’s problem. A simple sum of bread produced per shift or per day is not very informative. Customers usually want to know the exact quantity of each type of product produced.
The difficulties, however, do not concern counting, but rather recognising bakery products.
For example, 12 varieties of similar bread pass through a single production line. To identify them correctly, you need 100 photos with examples of each variety and a long time to train the video counter. But even after that, it is difficult to recognise products of the same shape with 100% accuracy if they differ only in the colour of the crust.
Below, we describe other nuances that arise when counting bread and how we deal with difficulties in projects.
AI Bread Counter at a Bakery Production Line
The examples of angles shown by the customer before the start of the project were not suitable for counting bread. The camera was positioned far away, and there was a lot of unnecessary stuff in the frame.
Then the camera was rotated so that the conveyor belt would fit better into the frame. This angle was now suitable for use. After that, we used software to zoom in and crop the frame for the video counter.
Here’s what happened in the end.



The footage shows that sometimes bread piles up on the conveyor belt. This problem is common in bread-baking facilities. A video counter cannot look under a loaf of bread and count how many products are hidden underneath it. Neither can a human being.
To ensure that the bread counting system works correctly, the customer installed a simple bar above the conveyor. It stops the bread travelling on the second tier and drops it onto the belt. Thanks to this simple solution, there are no piles in the counting area and the products are counted without errors.
Bread Production Counting Challenges
The customer uses two production lines, which differ in their operating principles.
The first line carries various products: croissants, puff pastries, rolls, bread. A video camera is installed above. The task was to teach the camera to recognise and count baked goods.
The products move from top to bottom in the frame. The platform on which the bakery products are placed moves quite quickly. The CamContador video counter must recognise and count them while they are visible in the frame.
This project counts both raw dough pieces sent to the oven and finished products coming out of the oven.


The second line is a traditional conveyor belt. Products are placed on it after baking and moved on to packaging.
The problem was that four types of similar bread are baked on this line. They are visually almost indistinguishable: all round and golden brown. The CamContador video counter could not determine their characteristic differences. However, the algorithm is not to blame here: even a human being would not be able to cope with such a task.
Among the four types of bread, there was only one that could be easily recognised. Unlike the others, it had sprinkles on top. The other three types were indistinguishable from each other.




In order to solve the problem, the customer decided to reposition the camera and bring the shooting angle closer.
Now the camera was filming not the oven, but the conveyor belt onto which the bread fell from the oven. However, the idea did not work. The video counter still could not tell the difference between the three similar types of bread.

As a result, we combined three types of bread into one. Now the video counter distinguishes between two types of products: bread with sprinkles and regular bread. The customer agreed with this solution.
This situation is a telling example of the limitations of our video counter. If the products are indistinguishable from one another, the visual recognition algorithm will not be able to determine their type. This problem only affects recognition. The product counter will work perfectly in any case.
Counting Bread on Conveyor Belts Using Computer Vision
The company produces three types of bread. All types are the same shape but differ slightly in colour. The customer wanted to count the finished bread without recognition.
We installed a video counter and configured the counting. The camera is positioned close to the conveyor belt, and the products are clearly visible, so there were no major difficulties with the project.

Video-Based Bread Counter in Bakery Production
The customer uses two production lines. The task was to organise the counting of finished bread as it came out of the ovens. The cameras were already installed.
First line. In our practice, this was a unique case. The customer was unable to assemble a computer according to the technical recommendations. Therefore, we deployed the video counter on an old PC without a video card.
Counting without a video card is an exception to the rule. It became possible due to the excessively slow speed at which bread comes out of the oven. The products appear in the frame very slowly.
We reduced the frame size to 290 × 90 pixels, lowered the neural network parameters, and set the frame rate to 5 frames per second. This stream does not place a heavy load on the system, and the processor’s power is sufficient to process it.
Result: the video counter works with high accuracy even with these settings.

The second line is located in another workshop. The video stream from its camera is processed by another computer. Here, when configuring the video counter, we encountered specific counting difficulties.
Sometimes factory employees would enter the shooting area. They would block the products and interfere with the shot. Once, the algorithm even mistook an employee’s head for bread and counted it along with the finished products.

Sometimes smoke would appear in the oven. This is nothing unusual in production, but if the smoke is too thick, it will cover the bread and may interfere with counting.
The system detects such interference and sends it to the customer and us for verification.

The CamContador video counter synchronises with the accounting system. The customer downloads reports on the quantity of items counted over any period of time. Any language can be set up for data output. Below is an example of a daily report in the customer’s language.

AI Recognition and Counting at a Bread Factory
For this project, the customer wanted to recognise and count six types of bread. The products differ in packaging and weight.
Thanks to different packaging, products are easily identified and counted. Although the bread itself is the same shape, this does not matter. Recognition is based on coloured packaging, and the video counter works without errors.

Bread Counter at Every Stage of Bakery Production
For this project, the customer monitored the entire bread production cycle. Cameras filmed key points in the production process: from the dough coming out of the dough dividers to the packaging of the finished products.
There were seven cameras in total, and we installed a video counter in each one. Bread recognition was not required.
Thanks to the fact that cameras record each stage, the customer can perform end-to-end counting of products and control the quantity of manufactured goods.
Due to an unfavourable shooting angle, counting errors occurred in two areas. In these areas, the counter’s accuracy was 98%, but the customer does not plan to reposition the cameras. This level of accuracy is sufficient for their purposes.
The entire technological process can be seen in the video camera footage below.






Industrial Bread Counter for Bakery Facilities
In this project, the customer wanted to understand where the shortage was occurring. The task was to count the finished products.
We set up a bread counter on the conveyor belt. The camera was suspended above the belt, and from this angle it was easy to count the finished products.

Then, however, it turned out that it was too late to count here. The bread disappears before it reaches the conveyor belt. Therefore, it is necessary to find earlier angles for shooting and counting.
The customer considered several options and settled on the very first stage. They chose the moment when the baker places the dough pieces into the baking tins. This is the first stage of production where humans appear. Before that, machines do all the work, and there is no room for errors.
The customer reinstalled the camera and we started counting again. Only now it was no longer bread itself, but dough.


Results
Most often, customers install cameras at three key control points: the dough entrance to the oven, the bread exit from the oven, and the conveyor belt for transporting products. The video counter successfully counts and recognises bread varieties at any stage of production.
The accuracy of the calculation of bread is 99.9%.
The counter launch period without specifying the type of bread is 1–2 days. If product recognition is required, the project will take approximately one month.
Team. CamContador usually has one engineer working on the project. The customer has a technical specialist who grants access, configures cameras, and solves technical problems at the production site.
| Parameter | Detail |
|---|---|
| Daily Capacity | Over 1,000,000 units |
| Accuracy Rate | 99.9% |
| Hardware Requirement | Standard IP Cameras + PC (GPU recommended) |
| Integration | Real-time ERP / Accounting Software sync |
| Object Types | Raw dough, baked bread, packaged products |
Ready to eliminate counting errors in your facility? Get a free pilot assessment for your production line.