Detector24
Recreational & Medical Drugs Detector
ImageRestricted Content

Recreational & Medical Drugs Detector

Detect drugs and paraphernalia in images: cannabis, pills, syringes, and controlled substances. Enforce platform policies and marketplace compliance.

Accuracy
94.5%
Avg. Speed
5.0s
Per Request
$0.0060
API Name
drugs-detection

Bynn Recreational & Medical Drugs Detector

The Bynn Recreational & Medical Drugs Detector identifies and locates drug-related content in images, including cannabis, pills, syringes, and drug paraphernalia. This model is critical for platforms enforcing drug-related content policies and regulatory compliance.

The Challenge

Drug-related content presents complex moderation challenges. Platforms must prevent illegal drug sales and glorification of substance abuse while allowing legitimate content—medical information, harm reduction education, news coverage, and legal cannabis content in jurisdictions where permitted.

The regulatory landscape varies dramatically by region. Cannabis is legal in some jurisdictions, criminal in others. Prescription medication content may be educational or may indicate illegal sales. Drug paraphernalia has both illicit and legitimate uses. Platforms operating globally need detection that identifies drug-related content accurately, enabling region-appropriate policy enforcement rather than blanket bans.

In physical security applications, drug detection through CCTV enables real-time monitoring of sensitive environments. Schools can detect drug use or dealing on campus. Transit authorities can monitor stations and vehicles. Workplaces with safety-critical operations can identify policy violations before they endanger others. Correctional facilities can detect contraband. Early detection enables intervention before situations escalate.

Model Overview

When provided with an image, the detector analyzes the visual content to identify drugs, drug paraphernalia, and related items. The model uses advanced object detection with instance segmentation, providing both the location of detected items and pixel-level masks that precisely outline each detection.

Achieving 94.5% accuracy, the model can detect a wide variety of controlled substances including cannabis plants and products, pills and medications, syringes, and various drug paraphernalia.

How It Works

The model employs open-vocabulary object detection technology, allowing it to recognize drug-related items based on learned visual patterns. For each detected item, the system returns:

  • Bounding box coordinates: The rectangular region containing the detected object
  • Confidence score: A probability value (0.0-1.0) indicating detection certainty
  • Class name: The specific type of drug-related item detected
  • Segmentation mask: A pixel-level PNG mask outlining the exact shape of the detected object

Response Structure

The API returns a structured response containing:

  • num_detections: Total count of drug-related items detected in the image
  • detections: Array of detection objects, each containing:
    • bbox: Bounding box coordinates {x1, y1, x2, y2}
    • score: Detection confidence (0.0-1.0)
    • class_name: Type of drug-related item
    • mask_png: Base64-encoded PNG segmentation mask
  • image_size: Original image dimensions {width, height}

Detected Classes

The model can identify the following drug-related items:

Pills & Medications

  • Pill, capsule, tablet, medicine, medication
  • Prescription bottle, pill bottle
  • Person taking pills

Cannabis & Marijuana

  • Cannabis, cannabis plant, cannabis leaf
  • Marijuana, marijuana plant, marijuana leaf, hemp plant
  • Marijuana joint, marijuana cigarette, cannabis joint
  • Rolled cigarette, blunt, weed

Drug Paraphernalia

  • Syringe, hypodermic needle
  • Bong, smoking pipe

Hard Drugs

  • Cocaine, drug powder
  • Crystal meth, meth, heroin
  • Generic drug

Performance Metrics

Metric Value
Detection Accuracy 94.5%
Average Response Time 5000ms
Max File Size 20MB
Supported Formats GIF, JPEG, JPG, PNG, WebP

Use Cases

  • Social Media Moderation: Detect and flag posts promoting or displaying drug use
  • Marketplace Compliance: Prevent illegal drug sales on e-commerce and classified platforms
  • Youth Protection: Filter drug-related content from platforms used by minors
  • Advertising Safety: Ensure ads are not displayed alongside drug-related content
  • Healthcare Monitoring: Identify potential substance abuse content for intervention programs
  • Law Enforcement Support: Assist in identifying drug-related imagery for investigative purposes

Known Limitations

Important Considerations:

  • Prescription vs. Recreational: The model cannot distinguish between legitimate prescription medications and illicit drug use
  • Legal Cannabis: In jurisdictions where cannabis is legal, detections may not indicate policy violations
  • Lookalike Items: Some legal items (vitamins, herbal supplements) may visually resemble drugs
  • Partial Visibility: Heavily occluded or partially visible items may have lower detection confidence
  • Context Limitations: The model detects visual presence without understanding intent or legality

Disclaimers

This model provides probability scores, not definitive identification of illegal activity.

  • Screening Tool: Use as part of a broader content moderation strategy, not as the sole decision factor
  • Human Review: All flagged content should be reviewed by trained moderators before action is taken
  • Legal Context: Drug laws vary significantly by jurisdiction; detections should be evaluated within local legal frameworks
  • Not Evidence: Detection results should not be used as legal evidence without additional verification

Best Practice: Combine detection results with human review and legal expertise for optimal content moderation outcomes.

API Reference

Version
2601
Jan 3, 2026
Avg. Processing
5.0s
Per Request
$0.006
Required Plan
trial

Input Parameters

Open-vocabulary object detection with segmentation. Detects objects using text prompts.

image_urlstringRequired

URL of the image for object detection

Example:
https://example.com/image.jpg

Response Fields

Object detection results with bounding boxes and segmentation masks

num_detectionsinteger

Number of objects detected

Example:
3
detectionsarray

Array of detected objects

Array Item Properties:
bboxobject

Bounding box {x1, y1, x2, y2}

{"x1":100,"y1":150,"x2":300,"y2":400}
scorefloat

Detection confidence (0.0-1.0)

0.95
class_idinteger

Class index

0
class_namestring

Detected object class name

person
mask_pngstring

Base64-encoded PNG segmentation mask

data:image/png;base64,...
image_sizeobject

Original image dimensions

Example:
{ "width": 1920, "height": 1080 }

Complete Example

Request

{
  "model": "drugs-detection",
  "image_url": "https://example.com/image.jpg"
}

Response

{
  "success": true,
  "data": {
    "num_detections": 2,
    "detections": [
      {
        "bbox": {
          "x1": 100,
          "y1": 150,
          "x2": 300,
          "y2": 400
        },
        "score": 0.95,
        "class_id": 0,
        "class_name": "person",
        "mask_png": "data:image/png;base64,iVBORw0KGgo..."
      },
      {
        "bbox": {
          "x1": 400,
          "y1": 200,
          "x2": 600,
          "y2": 450
        },
        "score": 0.87,
        "class_id": 1,
        "class_name": "car",
        "mask_png": "data:image/png;base64,iVBORw0KGgo..."
      }
    ],
    "image_size": {
      "width": 1920,
      "height": 1080
    }
  }
}

Additional Information

Rate Limiting
If we throttle your request, you will receive a 429 HTTP error code along with an error message. You should then retry with an exponential back-off strategy, meaning that you should retry after 4 seconds, then 8 seconds, then 16 seconds, etc.
Supported Formats
gif, jpeg, jpg, png, webp
Maximum File Size
20MB
Tags:drugscontrolled-substancesage-restrictedsegmentation

Ready to get started?

Integrate Recreational & Medical Drugs Detector into your application today with our easy-to-use API.