Machine vision and AI streamline pharmaceutical quality assurance processes

Machine Learning


December 5, 2025

Machine vision is particularly well-suited for use in artificial intelligence (AI) because large amounts of images are readily available as training data in production environments. South African pharmaceutical company Aspen has seized on this opportunity. I’m trying to leverage the benefits of machine vision in combination with deep learning.

The company, which operates in the healthcare and pharmaceutical industries, also has a presence in Europe, where the ingredients of the formulation must be measured, mixed and filled into ampoules. “Our goal was to automate the inspection of ampoules for possible foreign objects. Quality assurance of pharmaceutical products is very important. Therefore, it was essential that the new solution matched, and ideally exceeded, the detection rate of previous processes that required inspection by human operators,” explained Michael Dennis, Manager of Operation Vision Industriel.

Vincent Trombetta, Automated Visual Inspection Specialist at Aspen, continued: “It was clear that such a task could only be automated using deep learning technology. For implementation, we relied on the consulting services of MVTec Software GmbH. Since the machine vision solution for the inspection machine was already implemented in MVTec HALCON, it made sense to use the services directly from the manufacturer.”

The plastic ampoule is first produced, in this case blown, then filled and finally sealed. As all these operations are carried out in one machine, the process is highly hygienic and is carried out under cleanroom conditions to further minimize the risk of contamination.

Once the ampoules are filled and sealed, they are transported to the inspection and packaging area where they are checked for defects. Previously, this process required manually checking the ampoule and fill level for problems and for foreign objects in the liquid. The big challenge here is that the ampoule contents can contain bubbles, which are very difficult for the human eye to distinguish from foreign objects. Detecting particles suspended within a vial is not always easy. It may lie on its side, sink to the bottom, or become opaque due to the viscosity of the liquid. Therefore, manual inspection was very time consuming and costly. “As the inspection has to be done visually, it was clear that the process could only be implemented with machine vision and no other technologies were available. We also had to adapt to the particularly demanding verification processes applied in the pharmaceutical industry. This allows the new system to test ampoules at the required speed, while at the same time ensuring the highest precision and robustness,” says Michael.

The new system uses a total of 12 cameras that comply with the industry standard GigE Vision. Proper lighting is also important to make particles clearly visible. Machine vision runs on industrial PCs. On the software side, the deep learning machine vision solution is based on MVTec HALCON. Because Aspen’s application conditions are very challenging, deep learning had clear advantages over classical rule-based methods. Traditional machine vision techniques are unable to find a set of rules that are robust and flexible enough to detect defects.

In practice, test vials are currently placed manually on the conveyor belt where the inspection system is located. The 12 cameras are arranged to take a total of up to 14 images of each ampoule from different stations. When there are a large number of images, there are images in which particles are not visible but can be seen by changing the angle, which is useful for inspection using deep learning. Also note that a particle is only identified as such if it is found in a certain number of images. This reduces the number of false positives. Once the image is captured, it is sent to the MVTec HALCON. There, checks are performed using various machine vision techniques, and deep learning is used for foreign object detection. In addition to inspecting liquid particles, other inspection tasks are also performed in parallel. The system checks whether the fill level is correct, the color is correct, and the closure complies with specifications. Classic machine vision techniques such as matching and blob analysis are used for these tasks, providing robust results and reducing processing time for appropriate applications. At the end of the inspection, it is clearly determined whether the ampoule is OK or NO.

Both production lines are currently in operation. “Our goal was to develop an application that reflected the current state of machine vision technology. It was clear that we also wanted to use deep learning to extend our internal knowledge. With the support of our colleagues at MVTec, we were able to significantly improve our error detection rate and reduce false negative results,” Vincent concluded. The company plans to implement further automation based on machine vision in the future.


Contact details and archives…



Source link