The cap is the last component to be placed on the container and, at the same time, the one that guarantees everything described above. A defective closure can lead to leaks, microbiological contamination, or loss of carbonation in carbonated beverages. In addition, it is the first part of the product that the consumer touches.
On production lines exceeding 30,000 or 40,000 units per hour, visual inspection by an operator is simply unfeasible. That is why cap inspection using machine vision has become a standard in the packaging industry.
The objective of a cap inspection system is to verify 100% of containers in-line, without stopping production. Its function is threefold: detect deviations, reject non-conforming containers, and record data for traceability.

What defects can a cap inspection system detect?
A properly configured cap inspection system covers five families of defects.
Geometric and positional defects
These are the most common defects and directly affect container tightness:
- Missing or misplaced cap: the container arrives without a closure or with the cap simply resting on top.
- Crooked, tilted, or cross-threaded cap (crooked cap / skewed cap): the threads do not engage properly and the seal fails, even though the container may appear to be closed.
- Incorrect insertion height: a cap that is too high indicates insufficient tightening; one that is too low may indicate excessive pressure, which can deform the neck or closure.
Tamper-evident seal and ring integrity
The tamper-evident ring shows consumers that the container has not been opened. The system detects broken bridges before consumption, partial breaks, or rings that are hanging loose. These defects can lead to customer complaints even when the product itself is in perfect condition.

The current challenge: tethered cap inspection
European Union legislation requires caps on plastic bottles of up to 3 litres to remain attached to the container. This requires verification of:
- The plastic hinge: complete, with no cuts or deformation.
- Cap interference: ensuring that the cap does not interfere with filling or threading.
- Complete closure in compliance with sustainability regulations, despite the more complex geometry.
Surface and injection defects
These originate during cap manufacturing and include flash, microcracks, missing material, deformations, and, in metal caps or aerosols, dents. Since these defects are small and often have low contrast, they require high-resolution imaging and diffuse or low-angle lighting.
Marking and coding inspection (OCR/OCV)
The system reads (OCR) and verifies (OCV) the batch number, expiry date, or DataMatrix codes printed on the top or side of the cap, checking that they are both legible and correct. An illegible code can compromise the traceability of an entire batch.

How does an in-line cap inspection system work?
The cap inspection system is installed downstream of the threader or capper and operates on the moving conveyor. Four stages can be considered:
- Detection and triggering: a distance or photoelectric sensor detects each container and triggers the cameras.
- Lighting and image capture: several cameras capture the cap from different positions to cover the entire cap. This stage is usually complemented by appropriate lighting to achieve higher resolution of the different areas being inspected.
- Analysis: the software performs all the relevant quality measurements, such as height and geometry, while AI models classify each image within a few milliseconds.
- Rejection and recording: a blower or pusher removes defective units, while the system stores the image and rejection reason to analyze trends and root causes.
Machine Vision vs. Artificial Intelligence (Deep Learning) for Cap Inspection
Traditional machine vision is based on programmed rules: contrast thresholds, edge measurements, or comparison against a reference pattern. It is fast, accurate, and highly reliable for stable geometric measurements, such as cap height or presence. Its limitations become apparent when the defect is variable or the environment changes: reflections on metal caps, different colors, condensation, or the hinge of a tethered cap can generate false rejects and require parameters to be continuously readjusted.
Deep Learning learns from labeled images of good and defective parts. It recognizes complex anomalies, such as microcracks, partially broken tamper-evident rings, or irregular flash, while tolerating the natural variability of the product. It also simplifies format and product changes.
The most robust architecture is a hybrid approach: traditional machine vision for measuring and verifying dimensions, combined with convolutional neural networks (CNNs) to classify complex cosmetic defects.

Combined inspection: Cap and Fill Level Check
Integrating both inspections into a single station makes it possible to use the same image capture to check both the closure and the fill volume. Using backlighting, the system sees the liquid contour against the light and measures its height. This is the natural solution for transparent containers, such as PET bottles or clear glass. It detects underfilled and overfilled containers, while also being able to distinguish foam in carbonated beverages. For opaque containers, it can be complemented with X-ray or infrared sensors.
This combined inspection reduces line space and equipment costs and also makes it possible to correlate defects: a low fill level together with an improperly tightened cap often indicates a problem in the filler or capping head. All of this can be achieved without adding production stoppages or additional rejection points.
Industries where cap inspection is critical
Food and Beverage
In PET bottles, glass containers, cartons, and jugs for water, soft drinks, oils, dairy products, and spirits, the system ensures tightness, preserves carbonation, and protects food safety at high production speeds. It also verifies batch and expiry-date coding required for traceability.
Pharmaceutical and Cosmetics
Dropper bottles, child-resistant (CRC) closures, and dispensing pumps require a perfect seal for patient safety and regulatory compliance. In luxury cosmetics, flawless aesthetic finishes are also required, with no scratches or marks. DataMatrix code reading is essential for serialization compliance.
Chemical, Household Products and Aerosols
In detergents, lubricants, and aerosols with integrated actuators or dispensers, a defective closure can cause hazardous substance leaks during transportation or use. Controlling safety closures helps prevent household accidents and costly claims.
Across all these industries, cap inspection using machine vision and AI protects consumers, reduces waste, and strengthens brand reputation with every unit produced.
Practical Applications and Solutions Developed by ATRIA
At ATRIA, we have a team capable of developing customized automation and machine vision applications, from algorithm development to plant integration.
Some representative projects include:
- INSPEC: detection of cracks and surface defects in stamped automotive components using neural networks, with a detection rate of over 90% for the defects of interest.
- Seat Assembly Inspection: a camera and laser depth sensor mounted on a collaborative robot, with a proprietary convolutional neural network-based algorithm to verify five critical points.
- SEPARA and SIARA: machine vision and Deep Learning for identifying plastic containers, cans, and cartons in waste-sorting plants.
This experience in surface defect detection, assembly verification, and container variability is directly applicable to cap inspection.
Would you like to learn more about cap inspection? Contact us!