Skip To The Main Content

Could A.I. Optimize Visual Inspection?

Visual inspection is a challenging stage in the pharmaceutical manufacturing process. This is especially true for products with difficult characteristics, such as highly viscous parenteral solutions where air bubbles cannot be completely eliminated, making it problematic to differentiate them from particles. Those cases usually require long development and optimization times for vision algorithms before achieving a balanced operational level of detection versus false reject rates.

Artificial Intelligence has the potential of shortening this development period and optimizing the desired results more quickly—a classic win-win situation for both pharmaceutical manufacturers and patients, who ultimately receive high-quality products.

There are many successful automated inspection techniques on the market that enable very high detection rates, such as individual spin units to prepare the product before inspection, high resolution digital cameras and the static division light transmission method. Nevertheless, in some cases the combination of dense solutions with small containers does not promote the movement of particles, which leads to reduced detection probability. Moreover, agglomerations or other types of inherent morphological features that are similar to particles and bubbles resembling glass particles can cause false rejection of good containers. And every single false reject is one too many, particularly for high-cost products. A.I. applications have the potential of further increasing detection rates and decreasing the number of false rejects in difficult products like dense and bubbly solutions.

While many pharmaceutical producers and machine manufacturers are considering the use of A.I., reservations about implementation and validation are keeping most companies from using these applications in real production environments. In parallel, machine vision software companies are already offering deep learning vision tools as part of their portfolio. Hence, it is not always necessary for manufacturers of automated vision inspection machines to develop their own deep learning algorithms or neural networks. In fact, the existing solutions only require moderate software modifications. Additionally, an upgrade of the vision computers with higher processing power can be realized with graphic processing units (GPUs), which are widely available in the gaming industry.

When it comes to validation, in contrast to many other industries, the deep learning model must be “frozen” once the development phase is finalized. It must be static and can no longer change to make it version-controlled for validation. A recent discussion paper published by the U.S. FDA about the regulatory framework for Software as a Medical Device (SaMD) provides a good reference for application in areas different from pharmaceutical production (1).

No “One-Size-Fits-All” approach

Typically, a one-size-fits-all approach will not work when using deep learning for visual inspection. Instead, the first step should consist of a preassessment based on a large number of diverse images from reference samples. For example, this could be images of good units with bubbles, different stopper positions, products and fill volumes for body inspection and various types of particles intrinsic to the process. Based on the available image data, offline verification studies provide the basis for the integration of deep learning models into the existing software. In the second step, a customer-specific project should be defined with parameters such as product, existing machinery, expectations and timeline.

Figure 1 compares the standard recipe development and validation (left) to the deep learning method (right): the principle process does not change, and the recipe parameters are still validated according to GMP requirements. The only changes are the tool used to develop the process and the required hardware. As mentioned above, even the hardware only changes slightly: Deep learning requires PCs with GPUs capable of processing complex and massive amounts of data. In a deterministic deep learning model, small packages are trained up to a certain “level of intelligence” and then frozen. This is especially important regarding validation, regulatory approval and inspection.

Deep Learning versus Standard Image Processing

Figure 1     Standard and Deep Learning image processing

(Deep Learning Development and Qualification in Automated Vision Inspection Technology for Parenteral Pharmaceutical Drug Products / Jorge Delgado, Amgen Manufacturing Limited)

A.I. a Potential Trendsetter

USP <1790> Visual Inspection of Injections specifies that “validation of the automated inspection equipment should be based on comparison with the compendial manual inspection process with an expectation that alternative inspection methods demonstrate equivalent or better performance.” This is definitely true for the current state of deep learning in visual inspection. A.I. could potentially become a trendsetter for the pharma industry as it improves the current practice of visual inspection.


  1. “Proposed Regulatory Framework for Modifications to Artificial Intelligence/Machine Learning (AI/ML)-Based Software as a Medical Device (SaMD).” U.S. FDA, Nov. 5, 2019

About the Authors

Andreas GrossAndreas Gross is a Global Product Manager at Syntegon. He has more than ten years of experience in the processing and packaging industry.

PDA Members Save Substantially