Match Game: Machine Vision Verifies Printed Codes at 800 Cans Per Minute

Current and Upcoming Food Traceability Legislation Requires that Food-Processing Companies Have Systems in Place to Provide a Trail of Information that Follows Each Food Item Through the Supply Chain

By Russ Butchart, Puffin Automation

One of our clients, a food processor, fills an average of 800 cans per minute with a wide range of products such as vegetables, fruit and soup. An important challenge for the company is to ensure that the code printed on the bottom of each can matches the product in the can.

Current and upcoming food traceability legislation requires that food-processing companies have systems in place to provide a trail of information that follows each food item through the supply chain. To ensure food safety and efficient recalls, manufacturers must be able to identify and locate any item in that supply chain, and quickly trace it back to its source and forward to its destination.

To achieve this, many companies are in the process of implementing 2D barcodes, vision systems and image-based ID readers to ensure the safety of the supply chain.

Many food canners use a "bright stacking" process. Bright stacking is the storing of uncased cans without labels, commonly on pallets in a warehouse after sterilization and cooling. The only indication of what's inside each can is a text code on the end of it, so when the time comes to put the label on the can, a vision system checks the code on the end of the can to make sure the right label is applied, and then verifies that the can contents and label match.

Also Read: Link Machine Vision and SCADA

The food processor in this application decided to begin reading the code on the bottom of each can to be sure that it's readable and matches the contents of the can. The goals were to prevent mislabeled products from reaching customers, prevent accidental product mixing on the line, and prevent shipping of mixed products to customers. The code is inspected directly after the canning process and then again just before the label is applied.

These goals were achieved with the installation of a machine vision system that reads the code on the can in just 60 ms—enough time to reject cans with incorrect or unreadable codes. The vision system uses pattern-matching to orient the code regardless of radial position, and then optical character recognition reads the code and matches it against the product being produced on the line.

Application Challenges

The greatest challenges in the application are the high speed of the line, the fact that the code can be oriented in any radial position on the can as it moves down the line, and the varying finish of the cans, which can range from dull to bright and can include watermarks. The food processor asked Puffin Automation in Eden Prairie, Minnesota, to find a way to print the code, read the code and reject cans with incorrect or unreadable codes. This was our first project with this customer because it previously used periodic manual/operator inspection.

"We had to locate the four-character code in the radial direction, then read it within the 75-millisecond spacing between parts," says Darin Berg, partner at Puffin Automation. "We needed an exceptionally fast camera that could determine the radial position of the code quickly, and then provide a near-100% read rate, despite inevitable distortion of characters and variation in the background."

Puffin Automation selected a Cognex In-Sight 5600 series vision system, which is the company's fastest. In-Sight vision systems use PatMax, a geometric pattern-matching technology for part and feature location. PatMax dramatically improves the ability to find objects despite changes in angle, size and shading. It learns an object's geometry using a set of boundary curves that are not tied to a pixel grid, and it then looks for similar shapes in the image without relying on specific gray levels. Image resolution is 640 x 480 VGA for this process.

In-Sight vision systems also offer the OCRMax optical-character-reading tool. OCRMax segments a string of alphanumeric characters into individual regions that each contain one letter or number. The OCR tool achieves high read rates, even when reading distorted, touching and variably spaced characters or characters printed on uneven or reflective surfaces that cause lighting variations and background noise (Figure 1).

"What makes OCRMax unique in the industry is that it can read very challenging text, but is very simple to use," states Cognex's Ron Pulicari, marketing manager for the Americas. "The first step is to draw a region, kind of like using an image crop tool, around the characters you wish to read. OCRMax then automatically segments each character it finds. If the text is too hard to read—if, for example, the characters are touching, or they're too poorly printed to make out—OCRMax allows you to modify the automatic segmentation if necessary to properly segment the characters. After that, you just train your characters by simply typing in the text that OCRMax is looking at. Once you've trained the characters, you have the option of providing fielding information to further improve accuracy. Fielding essentially allows you to tell OCRMax if it should expect numbers, letters or both in certain parts of the text."

Berg adds, "Cognex is the preferred vision sensor at this facility. The new OCRMax tool provided a robust solution, so there wasn't any need to evaluate other brands and options."

The Plan of Inspection

The goals were to prevent mislabeled products from reaching customers, prevent accidental product mixing on the line, and prevent shipping of mixed products to customers. The code is inspected directly after the canning process and then again just before the label is applied.

The cans come into the inspection station in single file. An inkjet printer is manually set up to print the code on each can, and also print fiducials around the product code. A photo eye detects each can and sends a signal to the PLC, which in turn commands the vision system to acquire an image of the bottom of the can. The PatMax pattern-matching algorithm detects the fiducials, and uses them to determine the radial orientation of the can.
 
The OCRMax tool then performs pre-processing and image correction to correct for changing light conditions, and filters out background noise in the image. "Puffin Automation engineers used the segmentation rules in the OCRMax tool to train the system to recognize the font printed on the cans," Berg says. "They also used classification and fielding to improve read accuracy based on knowledge of what characters were likely to appear in each digit of the code. Classification is used to specify the probability of a specific digit being certain characters. For example, a digit might be much more likely to be the letter ‘B' rather than the number ‘8.' Fielding is used to specify whether each character is allowed to be a letter or a number or either."

Sixty-Millisecond Reads

Within 60 milliseconds, the vision system acquires the image on the bottom of the can, locates the code and performs optical character recognition. The OCRMax tool returns not only the value of each character, but also the certainty of each character on a scale from 1 to 100. "Our engineers configured the software, so that if one or more characters do not achieve a 60% score, or if any character is incorrect, then the code fails," Berg explains. "If all four characters pass with a 60% score, then the code is verified. The vision system sends the inspection results to the inspection system PLC."

When a code is not readable, Berg says the bad can is tracked using photo eyes for a few can spaces to the servo reject kicker. Each time the first photo eye is triggered, a number is added to a buffer in the inspection system PLC, and each time the second photo eye is triggered, a number is removed from the buffer. Then, when the bad can hits the servo reject kicker station, the inspection system PLC activates the servo reject kicker to remove the can. A third photo eye located just after this station checks to make sure the can was removed.

The user interface displays the number of passes and fails, and displays the image of the last bad code. The operator can easily switch to another screen that displays index, test and home buttons for the servo reject kicker, along with alarms and error messages. The fully adjustable vision system enclosure can be quickly resized in every axis to run all the various can sizes. The operator sets the vision system to the correct height based on a scale (Figure 2).

"Currently, operators manually enter the can code to be inspected into the inspection system," Berg says. "Future plans will have the can code loaded automatically over the plant network."

The PLC connects to the In-Sight vision system using Ethernet and digital I/O. Digital I/O delivers pass-fail results from the vision system to the PLC because it provides the highest possible speed. Ethernet is used to transfer the can code from the PLC to the camera.

Reliability Achieved

The food processing industry is putting increasing emphasis on traceability in the supply chain. Food and beverage manufacturers can use OCR to check that product descriptions and tracking have been printed on the product, that the label matches the product and that the correct characters are printed clearly for customer safety and brand management. The food processor in this application used OCR to make immediate improvements in productivity, product documentation and supply chain management. The food processor now has two of these systems in operation at its plant and six more are on the way. The systems have demonstrated the ability to consistently identify and reject cans with the wrong code or with an unreadable code. The customer now typically can enjoy a best-case fail rate of 0.01%. One big key to the success of this application was the use of a vision system with the speed and accuracy to handle the requirements of this application, as well as the flexibility to adapt to the plant's entire production with very fast changeover.  

Russ Butchart is a partner at Puffin Automation, based in Eden Prairie, Minnesota. Learn more about the firm at www.puffinautomation.com.