Detecting Filling Defects in Cosmetic Products with Computer Vision

In the cosmetics industry, quality is not a detail — it is the product.
A poorly filled bottle, a cream below the declared level, or a visible air bubble can undermine customer trust and damage a brand’s reputation.
Today, AI-powered Computer Vision is transforming quality control, making it more accurate, scalable, and automated than ever before.
Why Is Fill-Level Control So Critical?
In the beauty world, packaging is part of the experience. An inconsistent fill level can lead to:
-
Customer complaints and returns
-
Regulatory issues
-
Brand reputation damage
-
Waste and rework costs
Manual inspections, besides being slow and prone to human error, are not sustainable on high-speed production lines.
This is where Computer Vision with AI comes in.
What Is Computer Vision in Quality Control?
Computer Vision is a branch of artificial intelligence that enables systems to “see” and interpret images or video.
In industrial environments, high-resolution cameras installed along the production line capture images of products, while Deep Learning algorithms analyze each unit in real time.
The goal? Automatically identify anomalies such as:
-
Fill level too low or too high
-
Presence of air bubbles
-
Non-uniform filling
-
Leakage or overflow around the bottle neck
How Does Filling Defect Detection Work?
Image Acquisition
Industrial cameras capture images of the product immediately after filling.
Pre-processing
The system normalizes lighting, contrast, and orientation to ensure consistency.
AI Analysis
Deep Learning models — often based on Convolutional Neural Networks (CNNs) — analyze:
-
The upper liquid boundary
-
Comparison with an ideal fill threshold
-
Abnormal patterns within the content
Automated Decision
If a defect is detected, the system can:
-
Trigger an alert
-
Activate an automatic rejection mechanism
-
Log data for statistical analysis
All of this happens in milliseconds.
Key Technologies Used
-
2D and 3D vision systems for more accurate volumetric measurements
-
Controlled lighting (backlight or structured light) to enhance liquid-level detection
-
AI frameworks such as TensorFlow and PyTorch for model training
-
Integration with industrial PLC and MES systems
Benefits for Cosmetic Manufacturers
-
Higher Accuracy
Significant reduction of false positives and false negatives compared to manual inspection.
-
Speed
100% product inspection, even on high-throughput production lines.
-
Traceability
Data collection for predictive analysis and continuous improvement.
-
Cost Reduction
Fewer rejects, fewer returns, less manual intervention.
Challenges to Consider
It’s not entirely plug-and-play. Common challenges include:
-
Variations in packaging transparency
-
Reflections on glossy bottles
-
Differences in product viscosity
-
The need for well-balanced datasets during model training
An effective AI system requires a solid data collection phase and continuous performance monitoring.
Practical Use Case
Imagine a filling line for transparent facial serum bottles:
-
The camera detects the liquid level
-
The AI model identifies air bubbles exceeding a defined threshold
-
The system automatically rejects defective units
-
Data is logged to identify recurring issues in the filling machine
Result: consistent quality and full process control.
The Future: Toward Predictive Quality Control
The next step is not just detecting defects — but predicting them.
By integrating Computer Vision, AI, and production data analytics, manufacturers can:
-
Identify patterns that anticipate filling errors
-
Optimize process parameters in real time
-
Reduce downtime and unplanned maintenance
This shifts quality control from reactive to intelligent and adaptive.
Conclusion
The adoption of AI-powered Computer Vision for detecting filling defects in cosmetic products is no longer futuristic — it is a concrete competitive advantage.
In a market where aesthetics and perceived quality are essential, automating inspection means protecting the brand, improving efficiency, and ensuring that customers receive a flawless product.
Want to know more? Contact us at info@metalya.it