Foreign Object Detection Technology for Glass Bottles: Precisely Identifying Impurities to Safeguard Product Quality and Safety
In the food, pharmaceutical, and cosmetic industries, glass bottles are widely used as packaging materials due to their high chemical stability and excellent barrier properties. However, during production or filling, foreign objects such as metal fragments, glass shards, hair, or fibers may become mixed into the bottles, affecting product quality and potentially posing a serious threat to consumer health. Therefore, foreign object detection in glass bottles has become a mandatory part of quality control in modern production lines. This article will systematically introduce the core technologies, algorithm innovations, and industry applications of foreign object detection to help you choose a suitable detection solution.
I. Core Technological Path of Foreign Object Detection
Foreign object detection in glass bottles mainly relies on two types of technologies: machine vision inspection and X-ray inspection. The former is suitable for transparent or semi-transparent containers, while the latter can penetrate various materials and detect foreign objects with higher densities.
1. Machine Vision Inspection: Dynamic Imaging and Algorithm Analysis
Machine vision inspection acquires images of the glass bottle through a camera and uses digital image processing algorithms to identify foreign objects. Traditional inspection methods (such as manual lighting inspection) are susceptible to human fatigue and light interference. Modern vision systems improve accuracy through the following methods:
• Rotational Dynamic Detection: The glass bottle is rotated around its central axis, and a high-speed camera continuously captures multiple frames of images. By comparing the positional changes of defect points in adjacent images, inherent damage to the bottle (such as scratches) and foreign objects inside the bottle are distinguished. For example, a crack at the bottle neck moves synchronously with the bottle body during rotation, while foreign objects inside the bottle will show a positional shift due to relative motion with the liquid.
• Multi-Light Source Imaging: Combining backlighting and sidelighting enhances the contrast between foreign objects and the background. For example, for small glass fragments at the bottle neck, sidelighting can clearly outline the bottle neck, while backlighting highlights the shadows of internal foreign objects.
• Adaptive Algorithms: Employing edge detection (such as the Robert operator), threshold segmentation, and contour analysis techniques, the size and shape of foreign objects are accurately located.
2. X-ray Inspection: Penetration Recognition and Intelligent Diagnosis
X-ray inspection is based on imaging the differences in the absorption of X-rays by different substances. Foreign objects with higher density (such as metal, glass, and pebbles) absorb more X-rays and appear as dark areas in grayscale images, while liquids or pastes appear as light backgrounds. The advantages of this technology include:
• Enhanced detection of transparent packaging: For transparent containers such as glass bottles, X-ray equipment can integrate a side-emitting light source module. This enhances the interface between the bottle's outline and its contents through reflected light signals, preventing the missed detection of foreign objects at the interface (such as glass fragments at the bottle opening).
• Noise reduction for liquid products: Liquid flow can easily cause signal fluctuations and false alarms. The new X-ray machine slows down the flow rate through a U-shaped buffer channel and uses Fourier transform to filter low-frequency flow noise, retaining the high-frequency signals generated by foreign objects, significantly reducing the false detection rate.
• AI deep learning: The equipment trains tens of thousands of sample images using a convolutional neural network (CNN) to learn the grayscale and morphological characteristics of foreign objects and products. For example, metallic foreign objects have regular edges and dark grayscale, while glass fragments are irregular and semi-transparent. The system compares the image with the model in real time, triggering an alarm when the matching degree exceeds a threshold (e.g., 95%).
II. Innovative Detection Method for High-Viscosity Products
For high-viscosity products such as gels and creams, the traditional rotation-stop method fails because the foreign object cannot generate a significant relative displacement with the bottle. A recent patented technology proposes a multi-frame image dynamic analysis algorithm that effectively solves this problem:
1. Image Acquisition and Positioning: Rotate the glass bottle and acquire multiple frames of frontal views, selecting two adjacent frames (e.g., frame N and frame N+1).
2. Defect Trajectory Prediction: Extract the coordinates of the minimum bounding rectangle of the defect in the first frame image. Based on the bottle's rotation radius and angle, predict its position in the next frame.
3. Overlap Determination: Calculate the area overlap between the predicted position and the actual defect position. If the overlap is below a preset threshold (e.g., 80%), it indicates that the defect and the bottle are not moving synchronously, and is determined to be a foreign object inside the bottle; otherwise, it indicates bottle damage.
This method, by quantifying motion deviation, improves the detection accuracy of foreign objects in high-viscosity products to over 0.1mm, reducing the false alarm rate by over 30%.
III. Industry Application Scenarios and Performance Requirements
Different industries have varying requirements for detection accuracy and speed, necessitating the selection of appropriate technologies based on product characteristics:
• Pharmaceutical Industry: Oral liquids, injections, and other pharmaceutical products require the detection of metallic foreign objects larger than 0.08mm or glass fragments larger than 0.1mm. X-ray equipment with automatic compensation functions can adapt to changes in liquid temperature and density, ensuring detection stability.
• Food and Beverage Industry: Liquid products such as juices and milk need to address air bubble interference. X-ray machines eliminate low-frequency flow signals through filtering modules and can achieve continuous detection at a rate of 80-120 bottles per minute.
• Cosmetics Industry: Products such as face creams and gels require differentiation between bottle neck debris and contents. Combining machine vision rotation detection with X-ray interface enhancement technology enables comprehensive coverage.
IV. Technological Development Trends and Challenges
Future glass bottle foreign object detection technology will evolve towards intelligence and integration:
• Adaptive Learning Systems: AI models can be continuously optimized through incremental learning, adapting to the identification of new types of foreign objects.
• Multi-sensor fusion: Combining X-ray, visible light, and infrared signals enhances robustness in complex scenarios.
• Standardization challenges: Significant differences in glass bottle specifications across China necessitate the development of flexible algorithms adapted to various bottle types.
Conclusion
Foreign object detection in glass bottles is a core component of ensuring product safety. Machine vision and X-ray technology each have their advantages; companies should choose the appropriate solution based on product material, foreign object type, and production line speed. For highly viscous products or transparent packaging, innovative detection algorithms combining multi-frame dynamic analysis and signal enhancement are becoming key to improving accuracy and efficiency. With the deep integration of AI and multi-sensor technologies, foreign object detection will continue to evolve towards greater intelligence and reliability, strengthening the defenses for quality control.

