Pill counter: Automating real-time pill detection and quality control

HealthTech
Pill counter solution
About the project

In industries such as pharmaceuticals, healthcare, and manufacturing, even minor inspection errors can lead to costly recalls and safety risks. To help businesses prevent such issues, Honeycomb Software’s engineers developed an AI-powered real-time object detection and classification prototype that identifies pills, distinguishes their types, and detects anomalies on the spot, illustrating how computer vision can automate manual checks and ensure product integrity.

The same approach can be tailored for defect detection, visual monitoring, and safety assurance, helping companies achieve higher quality standards and operational efficiency.  

Technologies and tools we used
Python logo
Python
Image 27 - Pill counter: Automating real-time pill detection and quality control
OpenCV
FastAPI
FastAPI
WebSocket logo
WebSocket
Python logo
Python
Image 28 - Pill counter: Automating real-time pill detection and quality control
OpenCV
FastAPI
FastAPI
WebSocket logo
WebSocket
Python logo
Python
Image 29 - Pill counter: Automating real-time pill detection and quality control
OpenCV
FastAPI
FastAPI
WebSocket logo
WebSocket
Challenges

In pharmaceutical production, precision is paramount. A single miscounted pill, misidentified medication, or foreign object in packaging can disrupt the entire supply chain. Traditional quality inspection methods rely heavily on manual control, which is time-consuming, prone to fatigue, and difficult to scale.

Honeycomb Software set out to create an AI-driven inspection solution to demonstrate how automated visual systems can reduce human error, enhance traceability, and ensure consistent product quality in real-time.

The solution

Our team designed a complete computer vision system, covering both software and physical hardware components. The engineers not only developed the AI model and interface but also built the physical prototype, including the camera mount and surface module, to simulate real-world inspection conditions.

The system analyzes live video streams from the mounted camera to detect, classify, and count pills automatically, providing immediate and visual feedback through an intuitive dashboard.

Custom 3D-printed device by Honeycomb Software with a modified low-cost camera for optimized focal length.
Core capabilities
  • Real-time pill recognition and classification: Detects multiple pill types by shape (round, capsule, oval, etc.) and color.
  • Automated counting and visual breakdown: Displays total count, type distribution, and real-time results via the live dashboard.
Dashboard view of a pill-counting system with an ML model detecting pill shapes and types in real time.
Core capabilities
  • Anomaly detection: Instantly identifies foreign objects.
  • Integrated physical prototype: Custom-built structure ensures stability, optimal lighting, and realistic data capture for computer-vision testing.
AI-powered prototype detecting pills and mixed objects
Core capabilities 
  • Single-model architecture: Optimized for high accuracy and minimal latency, ensuring smooth real-time detection without data storage.
  • Scalable design: Modular setup easily adapts to manufacturing, healthcare, or logistics pipelines.
Close-up of a 3D-printed Honeycomb Software device component designed in-house.
Core capabilities 

By combining hardware engineering and AI expertise, Honeycomb Software delivered a fully functional end-to-end solution, from model training and UI design to physical assembly and testing.

The results

The system achieved high accuracy in detecting and classifying multiple pill types, instantly identifying anomalies and processing continuous video streams on the spot. This demonstrated how computer vision can transform quality control into a faster, safer, and more reliable process.

By automating manual inspection and integrating real-time AI inference, the prototype proved the efficiency of Honeycomb Software’s approach to AI engineering, model optimization, system integration, and the ability to deliver lightweight, production-ready AI architectures that help organizations boost accuracy, ensure compliance, and accelerate decision-making across various business environments.

Get in touch with us!

    Thank you for reaching out!

    We’ll review your message and get back to you soon.

    In the meantime, feel free to explore our case studies or submit another request.