From Computer Vision to Real-World Impact: Bottle Fill-Level Inspection System

Опубликовано: 25 Июнь 2026
на канале: FIRAS TLILI
26
0

In many production lines, a simple mistake—like an underfilled or empty bottle—can lead to wasted resources, customer dissatisfaction, and costly recalls.
So I built a real-time Bottle Fill-Level Inspection System that uses computer vision to automatically detect whether bottles on a conveyor belt are FILLED or EMPTY—with high accuracy, robustness, and explainability.
🔍 What makes this system powerful?
This isn’t just a basic classifier—it’s a multi-layered vision pipeline designed to perform reliably in real industrial environments:
✅ Ultralytics YOLO26 Instance Segmentation
Each bottle is precisely detected and segmented at the pixel level, ensuring accurate region analysis even with overlapping or partially occluded bottles.
✅ Persistent Object Tracking
Each bottle gets a unique ID across frames, enabling:
Stable classification over time
Accurate counting
Reduced flickering predictions
✅ Advanced Fill-Level Analysis
Instead of guessing, the system analyzes the internal structure of each bottle using multiple signals to detect the actual liquid boundary.
🧪 Multi-Technique Detection (Core Innovation)
To overcome real-world variability (lighting, reflections, transparency), I implemented four independent detection strategies:
🔸 HSV Saturation Profiling
Liquid regions tend to have stronger saturation → detects the first consistent high-saturation band.
🔸 Edge Density Analysis
The liquid surface creates a sharp structural boundary → detected using CLAHE + Canny edge density peaks.
🔸 Brightness Gradient Detection
Air vs liquid causes a sudden intensity shift → captured via vertical gradient analysis.
🔸 Simulated Near-Infrared (IR)
Liquid absorbs IR and appears darker → approximated using weighted RGB transformation.

🧠 Majority Voting = Robust Decisions
Each method votes independently.
✔ Final classification = majority agreement (≥ 2/4)
✔ Liquid level = median of agreeing detections
✔ Confidence shown as [votes/4]
👉 This dramatically reduces false positives and makes the system resilient to:
• Reflections on glass
• Label interference
• Lighting inconsistencies
🔧 Hardware Flexibility
The system works with:
• Standard RGB cameras 🎥
• Optional Near-IR cameras for higher reliability
With IR:
• Liquid detection becomes significantly more stable
• Less sensitivity to ambient lighting
• Better performance on transparent containers
🧩 Engineering Challenges Solved
Some of the key real-world problems addressed:
⚠️ Glass transparency and reflections
⚠️ Similar color between liquid and background
⚠️ Motion blur on conveyor belts
⚠️ Inconsistent lighting conditions
👉 Solved through signal fusion + temporal smoothing + segmentation precision
🎯 Applications
• Beverage production lines 🥤
• Food & liquid packaging 🏭
• Smart factories / Industry 4.0
#computervision #ai #deeplearning #yolo #automation #industry40 #machinelearning #smartmanufacturing #innovation #opencv