This page is being translated by your browser

Translation can break parts of Roboflow. If something stops working, turn translation off and reload the page.

Detection · Pharma & Semiconductor

Capsule inspection: Datasets & Models

Automated visual inspection of pharmaceutical capsules to catch defects like cracks, dents, and color variations on the production line. Uses object detection to flag non-conforming units before packaging.

Capsule inspection example
1M+
developers
16k
organizations
50B
inferences

Capsule inspection

This detection workflow analyzes images from line cameras or vision stations to locate and classify defects in individual pharmaceutical capsules as they move through production. Trained on a capsule defect dataset, it flags issues such as cracks, dents, discoloration, missing halves, and foreign particles so non-conforming units can be removed before packaging.

Try it out

Powered by general detection model

Run on custom image

Drop an image here or click to upload

Detecting classes:

Why automate capsule inspection

Manual capsule inspection is slow, inconsistent, and difficult to scale to the throughput required in pharma manufacturing, where operator fatigue leads to missed defects and inconsistent reject rates. In a regulated environment, missing a cracked or contaminated capsule carries real compliance and recall risk. Automating with computer vision gives you consistent, repeatable inspection at line speed, with a full audit trail of every unit and defect flagged. It frees skilled operators from repetitive checks and lets you tighten quality thresholds without slowing production.

Key benefits

A detection model catches subtle defects across high volumes with uniform criteria, reducing escaped defects and false rejects while maintaining traceability for quality documentation. It integrates with the cameras and PLCs already on your packaging lines and scales from a single station to plant-wide deployment. Starting from an existing capsule defect dataset and a model like RF-DETR shortens the path from prototype to validated inspection.

How to use it

  1. Upload an image: Drop any photo into the widget above to try capsule inspection for free, right on this page.
  2. Preview instant results: The model detects capsule, cracked capsule, dented capsule, discolored capsule, empty capsule within seconds and returns an annotated image with structured predictions, so you can immediately see how well it works. Adjust the detection classes and re-run until the results fit your scenario.
  3. Like what you see?: With a free Roboflow account, you can deploy this workflow with the Serverless Cloud API, customize it in your workspace, or train RF-DETR on your own images for production accuracy.
  4. Get started for free: No code or training data required to begin: upload, review the results, and make it part of your stack in a single click.
Recommended model

Recommended model for capsule inspection

RF-DETR is state of the art for real-time object detection, instance segmentation, and keypoint detection, with higher accuracy and lower latency than comparable models, and it's Apache 2.0 licensed. When you're ready to build a production model for capsule inspection, fine-tune it on your own labeled images, then deploy to a Serverless Cloud API endpoint.

Train your own model
Roboflow Agent

Not sure where to start?

Describe your Capsule Inspection project to Roboflow Agent.

Agent