Cookie defect detection

Global cookie market size is increasing constantly (in 2020 it reached $30.6 billion and is forecasted to grow up to $44 billion by 2026). To increase the amount of production manufacturers are searching for ways of improving efficiency and decreasing costs. Incorporating computer vision systems into the cookies production lines allows producers not only to improve product quality, increase efficiency and minimize costs, but also reduce waste, avoid recalls or safety issues, improve customer satisfaction and build customer trust and loyalty.

Computer vision solutions can be applied to inspect the dough depositing process to check that the cookies are properly aligned and the correct amount of dough is deposited for each cookie. Also, in the process of baking undercooking and overcooking can be prevented. One of the most important stages of cookie quality control is defects detection. It’s crucial to detect damages, deformations, misalignments, missing pieces, and contaminations to prevent the distribution of defective products to consumers.


Computer vision cookie defect detection is used in food industry to identify abnormalities in cookies during the manufacturing process, detect defects which can be unacceptable for the packaging process (like the wrong shape or size), minimize product recalls and reduce safety issues.


Computer vision solutions for cookie defects detection (compared against manual inspection methods) bring numerous benefits to cookie producers including increased speed and efficiency of the manufacturing process, more consistent detection results, improved accuracy (especially if the defects are not too significant or small), decreased production cost, reduced waste and others. Thus, computer vision solutions for cookie defects detection help manufacturers to produce high-quality, safe, and consistent products.


To detect cookie defects computer vision solutions are integrated into production lines. Industrial cameras and image recognition software are used. A pipeline of cookie defect detection includes the following steps:

  • Image acquisition. High-resolution cookies images are acquired by industrial cameras in using specially designed lighting;
  • Preprocessing. Contrast normalization, filtering, resizing, and noise removal filters are applied to the acquired image;
  • Feature extraction. Usually the texture, shape and color are extracted to improve defects identification process;
  • Defect detection and classification. In this step, machine learning algorithms compare cookie features to normal and defective samples and then classify them into good or defective classes. If necessary, the number and type of defects are identified.

This pipeline can be customized for the specific applications in different industries and companies. The speed of the algorithms is affected by camera settings, speed of the production line, available computation resources, and other factors.

The types of cookies that can be inspected for defects using computer vision include chocolate chip cookies, oatmeal cookies, sugar cookies, shortbread cookies, peanut butter cookies, macarons, biscotti and other types. Depending on the cookie size, shape, and texture different cookies are required for different types of inspections.By analyzing the images of cookies over time, additional machine learning algorithms can be used to identify trends and patterns in defect occurrence and suggest root causes of defects, reaction plans, and maintenance procedures.

Types of cookies defects

  • Damages (cracked or broken cookies, chipped or dented cookies, crooked cookies);
  • Deformations (misshapen cookies, uneven edges, inconsistent shape, flat or overly thin cookies);
  • Inconsistent texture cookies;
  • Discoloration;
  • Burnt cookies, burnt edges, overly browned cookies, overbaked or underbaked cookies;
  • Misalignment defects (off-center cookies, overlapping cookies, unevenly spaced cookies, stuck-together cookies);
  • Cookies with missing or excessive amounts of dough, chocolate chips, oatmeal, cream, or peanut butter;
  • Missing cookies, underfilled cookies, overfilled cookies;
  • Incomplete or incorrect decoration of cookies;
  • Contaminated cookies, cookies with foreign objects in them.


In general, defect detection accuracy using computer vision exceeds 90%. The accuracy depends on complexity and visibility of the defects, the quality, size and resolution of the images, and the computing power available. Our model’s accuracy in tests delivered 96.4% accuracy.

Our cookie defect detection solutions can inspect thousands (up to 100,000) of cookies per hour.

Start working with Data Monsters

Submit your application, and our team will get in touch with you soon.

There are many ways to partner with Data Monsters. Find the right fit for you.
Partner with us