Detector24
Weapons Detector
ImageStandard Moderation

Weapons Detector

Detect firearms, knives, and weapons in images automatically. AI-powered threat detection for platform safety, security screening, and compliance.

Accuracy
95.8%
Avg. Speed
5.0s
Per Request
$0.0060
API Name
weapons-detection

Bynn Weapons Detector

The Bynn Weapons Detector identifies and locates weapons in images, including firearms, knives, and other potentially dangerous items. This model is critical for platforms prioritizing user safety and content policy enforcement.

The Challenge

Weapons in images present immediate safety concerns. Threatening posts showing firearms may precede real-world violence. Marketplaces struggle to prevent illegal weapon sales. Schools and workplaces need to identify potential threats before they escalate. Yet weapons appear in countless legitimate contexts—hunting photos, historical content, video game screenshots, news coverage.

Platforms need detection that identifies weapons accurately while understanding that presence alone doesn't indicate threat. A holstered firearm in a sport shooting context differs from a weapon pointed at the camera. Kitchen knives in cooking content are benign; the same knife in a threatening context is not. Effective moderation requires both detection and the contextual information to make appropriate decisions.

In physical security, weapons detection transforms CCTV from passive recording to active threat prevention. Real-time analysis of camera feeds at airports, schools, retail stores, and public venues can detect firearms or knives before attacks occur—triggering immediate lockdowns, alerting law enforcement, and potentially stopping tragedies before they unfold. Every second of early warning saves lives.

Model Overview

When provided with an image, the detector analyzes the visual content to identify weapons and threatening objects. 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 95.8% accuracy, the model can detect a wide variety of weapons including firearms (handguns, rifles, shotguns), bladed weapons (knives, swords, machetes), and other threatening items like crossbows, tasers, and explosives.

How It Works

The model employs open-vocabulary object detection technology, allowing it to recognize weapons 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 weapon 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 weapons 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 weapon
    • mask_png: Base64-encoded PNG segmentation mask
  • image_size: Original image dimensions {width, height}

Detected Classes

The model can identify the following weapons:

Firearms

  • Gun, firearm, weapon
  • Rifle, shotgun
  • Pistol, revolver, handgun
  • Bullet

Bladed Weapons

  • Knife, dagger
  • Sword, machete
  • Spear

Other Weapons

  • Baseball bat, axe, hammer
  • Crossbow, taser
  • Grenade

People & Activities

  • Person holding gun, person pointing gun
  • Person with knife, person with weapon
  • Armed person

Performance Metrics

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

Use Cases

  • Platform Safety: Detect weapons in user-generated content to enforce community guidelines and protect users
  • Social Media Moderation: Identify posts containing weapons that may violate platform policies
  • Marketplace Compliance: Prevent illegal weapon sales on e-commerce platforms
  • Threat Detection: Support security workflows by identifying potentially threatening imagery
  • Gaming & Media Classification: Categorize content containing weapons for age ratings
  • Brand Safety: Prevent brand advertisements from appearing alongside weapon-related content

Known Limitations

Important Considerations:

  • Toy Weapons: Realistic toy weapons, airsoft guns, or prop weapons may be detected as real weapons
  • Context Limitations: The model cannot determine legality, ownership status, or intent
  • Artistic Content: Weapons in artwork, video games, or historical imagery may be flagged
  • Partial Visibility: Heavily concealed or partially visible weapons may have lower detection confidence
  • Kitchen vs. Threatening: Kitchen knives in culinary contexts may be detected

Disclaimers

This model provides probability scores, not definitive threat assessment.

  • Screening Tool: Use as part of a broader safety strategy, not as the sole decision factor
  • Not Threat Assessment: Detection of a weapon does not indicate intent or threat level
  • Human Review: All weapons detections should be reviewed by trained moderators or security personnel
  • Legal Context: Weapon laws vary by jurisdiction; detections should be evaluated within local legal frameworks
  • Emergency Response: This tool is not a replacement for professional security services or law enforcement

Best Practice: Combine detection results with human review, contextual analysis, and appropriate security protocols for optimal safety 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": "weapons-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:weaponsfirearmssafetysegmentation

Ready to get started?

Integrate Weapons Detector into your application today with our easy-to-use API.