AI-powered machine vision automates quality inspection in the pharmaceutical industry

Medical Supplies & Pharmaceutical | HALCON | Blob Analysis | Deep Learning | Matching

The pharmaceutical company Aspen is improving the quality inspection of filled ampoules with the MVTec HALCON machine vision software and the consulting and technical support services provided by MVTec. With deep learning methods, the company has significantly increased accuracy and efficiency in its automated inspection process within the pharmaceutical industry.

Automated ampoule inspection with MVTec HALCON
The ampoules are automatically transported to the inspection process. (©Aspen)

How can quality assurance in the pharmaceutical industry be reliably automated?

In the healthcare and pharmaceutical industry, precise quality inspection is essential to ensure consistent product safety. Aspen therefore sought to automate its manual visual checks of medical ampoules. Until recently, employees examined each ampoule individually for foreign particles – a slow, costly, and error-prone approach.

“Our goal was to automate the inspection of ampoules for possible foreign particles. Quality assurance of pharmaceutical products is extremely important. Therefore, it was essential that the new solution matched – or even surpassed – the detection rates of the previous process,” says Mickael Denis, Manager Operationnel Vision Industrielle. Aspen recognized the potential of machine vision. By adopting AI-based deep learning technologies, the company achieved the required detection accuracy.

At the Notre-Dame-de-Bondeville site, ampoules are produced using the BFS (blow, fill, seal) process under clean-room conditions. Although this production method is highly hygienic, foreign particles must still be identified with absolute reliability. To meet strict regulatory requirements, Aspen implemented a solution based on MVTec HALCON, supported by MVTec’s experienced Customer Services team.

What challenges does MVTec HALCON solve in the automated inspection process?

The new automated inspection process uses twelve industrial cameras that comply with the industry standard GigE Vision. Each ampoule is captured up to 14 times from different angles because foreign particles are often barely visible, may settle on the sides or bottom, and can easily be mistaken for shadows, bubbles, or reflections. Capturing multiple images significantly increases robustness and accuracy.

Image processing takes place on an industrial PC running MVTec HALCON, a standard software for machine vision that offers more than 2,100 operators. Aspen uses HALCON’s deep-learning-based Semantic Segmentation to reliably distinguish harmless bubbles from true contaminants.

In addition to particle detection, the machine vision system analyzes cosmetic defects, verifies fill levels, identifies color deviations, and inspects closure quality. Rule-based technologies such as matching and blob analysis are used for these tasks. They complement deep learning technologies, offering both high robustness as well as the speed required for routine quality inspection tasks – a major step forward in production automation for the pharmaceutical industry.

Why were MVTec’s software and technical expertise essential for success?

This demanding application could not have been implemented successfully without the technical and conceptual expertise of MVTec’s Customer Services team. Due to the high complexity, Aspen collaborated closely with MVTec’s specialists.

“The task was certainly one of the most challenging we have ever faced. This was particularly true when it came to preparing the images for training. We at MVTec were called in to assist with conceptual preparation, process implementation, and documentation,” explains Patrick Ratzinger, Project Manager at MVTec.

His team of experts analyzed, refined, and merged the labeled images to develop a high-performance neural network tailored to Aspen’s needs. Using the MVTec Deep Learning Tool, they prepared datasets made up of defect-free and intentionally manipulated ampoules. Multiple training runs enabled the comparison of different models and improved the network’s robustness.

“It was clear that such a task could only be automated using deep learning technologies. For the implementation – which required a great deal of expertise – we relied on the consulting services provided by MVTec,” adds Vincent Trombetta, Automatic Visual Inspection Expert at Aspen.

The collaboration provided Aspen not only with an advanced machine vision application, but also with essential know-how about data preparation, labeling, and the correct interpretation of deep learning results. Combining MVTec HALCON with MVTec’s technical consulting demonstrates the value of integrating powerful machine vision software with hands-on industry support.

Quality inspection application for pharmaceutical industry
Setup of the automated testing application: On the left, inspection is performed using machine vision; on the right, pressure testing is performed to check whether the ampoules are correctly sealed. (©Aspen)

What added value does Aspen gain from automated machine vision inspection?

Since implementing the new system, Aspen has benefited from an automated inspection process that combines speed, stability, and precision. Error detection rates have increased significantly, and false-negative results have been substantially reduced. As a result, the company has improved both product quality and overall production efficiency.

This project demonstrates how machine vision and deep learning elevate production automation in the pharmaceutical industry. With MVTec HALCON and expert technical support from MVTec’s Customer Services team, Aspen can continue to scale, validate, and optimize its quality inspection processes – setting a strong example of digital transformation in the healthcare and pharmaceutical industry.