Traceability is the key term when it comes to packaging pharmaceuticals. Pharmaceutical manufacturing facilities produce huge volumes of medications, some of which are generic, some are name-brand and some are unbranded. Each individual vial or bottle must be tracked as it passes through the packaging process. Traceability, in some instances, is even applied at the level of individual tablets, which are marked and tracked through the production facility.
Machine vision is used to track medicines passing along a packaging line via data matrix labelling. ‘The reason for providing 100 per cent inspection is quite clear,’ states Gregory Hollows, director of machine vision solutions at Edmund Optics. ‘These packaging lines handle a variety of different medications and there could be potentially very damaging consequences if one medication is mixed in with a batch of a different drug.’
Edmund Optics, a company with headquarters in Barrington, NJ, US, providing optics, imaging and photonics solutions, has implemented vision equipment on pharmaceutical packaging lines. One of the projects it has been involved in was to set up an inspection system to identify and track 20-100ml glass vials containing injectable medicines.
The vials are often unlabelled when they exit the production line and are boxed and sent to another location to be labelled at a later date, but are identifiable from 2D data matrix codes implanted in the caps. Some codes will have a colour, but often the vials are marked simply by ablating the metal cap material. A vision system was set up in the production line to read the codes, sometimes in combination with an additional numbering system. ‘From lighting and a camera and optical standpoint, engineering a vision system that can acquire an accurate read on round, reflective caps is difficult to achieve – especially when the production machines have limited space,’ says Hollows.
According to Hollows, one of the biggest challenges that vision integrators can have in the pharmaceutical industry, along with many other industries, is the limited space available for vision equipment. ‘The less space the more difficult it is to capture balanced, well lit, crisp images across a given area,’ he says. As the distances between camera and object become shorter, it becomes more difficult, in terms of illumination and optics, to see the very oblique angles. In addition, data matrix codes are small and the depth of contrast very slight. Providing adequate lighting can be problematic; there can be dark spots where vials enter and exit the inspection area, and glare or shadows from other bottles.
The speed at which the vials travel is another challenge for a vision system, notes Hollows: ‘The ideal solution would be to push the bottles up out of the line to view them at a different level where there’s more space, but that’s not possible when vials are moving at 200 to 300 parts per minute.’
Generally, the ideal setup is for the camera to be directly in front of the object, providing a controlled field of view of reasonable size in relation to the distance. However, Hollows says that the viewing angles will change as the vial rotates, which leads to a compressed aspect ratio of the mark. This complicates the vision setup, because the camera is essentially always positioned at an angle. Therefore, multiple cameras are often deployed. Software packages are available that can remove the skew from the curvature and can combine multiple images to achieve an accurate read.
Resolving power
Ingo Boesnach, product manager for mvImpact software at imaging components provider Matrix Vision, states that when setting up inspection systems on pharmaceutical production lines, ‘the field of view must be big enough to measure the size of the largest packages but, at the same time, the spatial resolution must be good enough to read the smallest data matrix codes’.
Matrix Vision’s mvBlueLynx-X smart camera is suited to these kinds of applications. The image is processed inside the intelligent camera by mvImpact+ software, which also provides the ability to read pharmaceutical codes of different countries and different companies, such as PZN, MSI, Italian Pharmacode (Minsan), Plessey, etc.
Reading small data matrix barcodes in a large field of view was one of the challenges US-based packaging systems provider, Matrix Systems and Solutions, had to deal with when commission by a global chemical manufacturer in France to provide a system for traceability. The system installed was a three-tier solution designed to associate individual bottles to a case and then the case to a pallet, all via data matrix labelling.
The production line operates at 300 to 400 bottles per minute. Bottles are serialised and pass onto an accumulation table to be packed into boxes by a robot. As bottles are aggregated and packaged, machine vision is used to read all of the data matrix codes printed on top of the bottles in each box to ensure consistency of the product.
Some of the boxes were 2ft long by 1.5ft wide – which, as Daniel Hare, vice president at Matrix Systems and Solutions points out, is a very large field of view for a small element data matrix barcode to handle.
Vision is used to associate bottles with the box to ensure consistency of product. Even illumination is provided with an LED framelight and data matrix codes on each bottle are verified using a Prosilica GE4900 16 Megapixel camera.
Matrix Systems and Solutions experimented with various different components and methodologies. The Prosilica GE4900 16-Megapixel camera from Allied Vision Technologies had the advantage over other lower resolution cameras and vision sensors of being able to capture an image of an entire box without needing to use multiple cameras and stitch a number of images together. ‘This is a high-speed application and synchronising four cameras to trigger as boxes are travelling down the line, aggregate the data, ensure there are no doubles, and finally make a pass/fail decision, is difficult to achieve,’ comments Hare. ‘The challenges with using four cameras are keeping them all focused; the overlap has to be set up in such a way so as not to read the same code twice, and communication must be maintained between them. Being able to use one camera greatly simplifies the setup and it is really the only way to go, not just in terms of making it work, but engineering a sustainable system.’
Complex imaging algorithms were used to handle any skew in data matrix codes, any distortions on the outer edges of the image caused by the 50mm wide-angle lens, and also in any movement in the image from vibrations on the packaging line. A further issue to overcome was illumination: ‘How do you evenly illuminate a field of view that big and not get a substantial amount of reflection that would blind the camera in certain hotspots?’ asks Hare. To overcome this, Matrix Systems and Solutions engineered an LED framelight providing diffuse light to evenly illuminate the entire box. The Prosilica camera was embedded in the centre of the light.
Reducing false negatives
If resolution is not high enough when inspecting products over these large fields of view, noise levels and resolution losses from the geometric compression due to the skew in the image can start to affect data integrity. Hollows at Edmund Optics states that to overcome this, vision integrators will, in many cases, need to over specify and use cameras and lenses providing much higher resolution than is strictly necessary in a controlled environment, to guarantee an accurate read.
‘If the system can’t read the mark the vial is rejected,’ Hollows says. ‘The wrong thing going out is absolutely unacceptable, but false negatives are a real problem too and pharmaceutical companies, especially for generic medicines, operate on very tight margins and can’t afford to throw product away.’ For expensive, high-end medications, a high reject rate can be extremely costly. One of the methods pharmaceutical companies can employ for reducing waste product from rejects, is to recycle vials on a second, slower line to provide greater opportunity for the inspection system to get an accurate read.
To illustrate the importance of an effective inspection system for minimising the number of false rejects, Hollows comments: ‘If one per cent of vials are rejected due to false negatives on a line that processes 300 bottles per minute, that equates to 180 bottles per hour. On 10 lines, that’s 43,200 bottles per day, if you assume 24-hour manufacturing, for one per cent variation.’ Therefore, improving the vision system to reduce the amount of false rejects from two per cent to one, or even half a per cent, increases the throughput by 43,200-64,800 units a day. Hollows speculates further by suggesting: ‘If it costs $2 to manufacture each bottle – that’s $86,400 a day – and, if the factory operates 250 days a year, the total cost is more than $21m per year for a one per cent variation.’
Taking these types of figures into consideration, a high-end system, which can increase the cost of installation by $80,000 to $150,000 for 10 four-camera systems, is worth the capital outlay if it reduces false reads by one per cent. ‘Safety is always the primary concern for pharmaceutical companies, but reducing false negatives ranks a close second,’ Hollows says.
Checking the presence of labels on high-speed production lines. Image courtesy of Cognex.
The additional advantage to increasing resolution is reducing the likelihood of missing a bad part. However, Hollows notes the regulatory standards for pharmaceuticals in the US and Europe are so stringent that companies often don’t have a lot of choice in inspection system performance in this regard.
Aesthetic applications
The other side to pharmaceutical packaging involves more standard packaging applications, such as using vision to ensure labels are the right colour and are positioned correctly. Vision is also used to make sure barcodes on packages can be easily scanned when delivered to hospitals and pharmacies.
The pharmaceutical industry is also concerned with the exact size of boxes in order to optimise storage, as Boesnach of Matrix Vision points out. Boesnach feels the pharmaceutical industry is moving from using laser scanners to industrial cameras, as a camera allows an image of the entire box to be captured, which can be used for a number of different tasks as well as traceability, including recording the size of the box and checking for open or damaged packages.
OTE Group, based in the Netherlands, has implemented Cognex Checker to ensure both the production code and label are present on bottles of its hydrating, cleaning and lubricating fluids, which it manufactures for the lens care market. As well as the company’s three product lines, OTE delivers more than 100 private labels to customers with their own brands and handles more than 250 different labels on its production lines.
Netherlands-based Cognex partner, Digitron, provided OTE with the vision sensor solution. Three Checkers were installed on the packaging line checking the presence of a code printed on the bottom of each bottle and the presence of the label. The vision sensor is taught to recognise labels and an external trigger uses the reflection of light to detect their presence.
These types of packaging application might not require high-end vision systems to provide accurate inspection. ‘Certain systems can tolerate some weak links, depending on what the application is,’ comments Hollows of Edmund Optics. Guaranteeing accurate reads of data matrix codes on vial caps, however, requires much higher-end equipment to provide a robust vision solution.