Every where in the pharmaceutical world, one of the most important criteria is quality assurance. Not only must all products be manufactured according to specifications, the filling and packaging of product must also adhere to strict requirements laid down by the pharmaceutical organisation and the various governing bodies .
In the filling and packaging process in particular, it is imperative for the manufacturing line to check for broken or partially formed tablets and capsules. The correct number of tablets or gel capsules must also be counted before they are filled into containers.
Pharma Packaging System, a company in England that specialises in packaging systems for the pharmaceutical industry, was one specialist that had to critically take into account these requirements when it decided to develop a range of electronic counting and packaging systems that can be deployed as either stand-alone units or as part of an integrated packaging line.
To ensure quality standards can be guaranteed on any production line at any pharmaceutical manufacturing plant, Pharma Packaging System turned to Machine Vision and partnered MVTec to create a vision-based inspection system that can count and detect partially formed and broken tablets and capsules.
Machine Vision was determined to be superior to other applications as it can acquire images for processing, and accurately analyse various characteristics for decision making. When deep learning is deployed, an algorithm is employed and told to learn what to look for with respect to each specific class. In turn, sample images can be analysed and the descriptive features for each object can be automatically worked out.
MACHINE VISION FOR QUANTIYT CHECKS AND DEFECTS INSPECTION
In partnering Pharma Packaging System for the design of its counting and packaging systems, MVTec designed a solution that ensured accuracy in quantity checks and defects inspection.
For the carrying out of quantity checks, the system assigned tablets and capsules to be placed into feed trays. As the tablets and capsules leave the feed trays, they are passed through high speed infrared optical sensors that count the products in free fall before they are guided into individual bottles.
Data from the sensor is then fed into a computer system which counts the number of tablets that have been deposited into each bottle. The bottle is then indexed through the system, and is either accepted or rejected, depending on whether it has been filled correctly.
For the defects inspection process to check for broken or partially formed tablets, MVTec mounted three high resolution advanced Basler cameras above each of the feed trays at the counting and bottling station.
A dark field lighting system is also developed to enable images of the matt surface of the tablets or capsules to be imaged effectively. Images of the tablets or capsules on the feed tray are then transferred to a dedicated computer where they are processed using MVTec HALCON image processing software.
With this, HALCON can analyze the images of the tablets to determine the length, width, area, completeness, and verify their color, so as to determine whether small particles or half tablets might be present, and whether the tablet is the correct colour.
If a tablet is identified as defective by the vision system, the computer system running the vision system software will flag the tablet as defective and send a fail signal to the computer system performing the counting function. The container will then be rejected from the line after it leaves the bottling machine.

Adding to the robustness of this solution:
- The system uses a local adaptive thresholding technique to separate desirable foreground image objects from the background.
- As the tablets may be touching one another as they move down the tray, Erosion and Dilation operators in the HALCON toolset are deployed to digitally separate the tablets before determining their measurement and colour.
- With this solution, only good products are discharged for further processing.
Recently, the success of this solution caught the attention of a large UK tablet manufacturer, and the system was installed at its production plant, with the capability to inspect up to 10,000 tablets per minute.
IS MACHINE VISION WITH HALCON DEEP LEARNING POSSIBLE IN OTHER PRODUCTION LINES?
Today, machine vision systems along with deep learning are widely used in many industries, enabling an increasing number of applications that were not possible before, as well as improving the performance of existing applications significantly.
In particular in the field of data classification, deep learning is a very efficient technology, especially when parameters cannot be clearly defined. This results in product identification, sorting, measurement, visual quality checks and inspection being executed at extremely fast speed, and at high accuracy.
Furthermore, MVTec works with most vision cameras, and can extend the power of traditional machine vision in Pharmaceutical Manufacturing and Food and Beverage industry, as well as in automotive and semiconductor production.
Wonder how this is done?
Come, discover how classification and character recognition challenges can be effectively solved with the power of Halcon Deep Learning at the LINXDays Southeast Asia 2021 Webinar.
All Webinar participants are entitled to an exclusive ‘Halcon Orientation Training’ worth $800, which comes with a 1-month trial of Halcon and immediate hands-on training.
Sign Up Now!