Detection Best Practices
This guide covers proven patterns for designing effective Anava detections, common mistakes to avoid, and strategies for different use cases.
Core Principles
1. Single Responsibility
Each skill should do one thing well.
| Good | Avoid |
|---|---|
| "Weapon Detection" | "Security Everything" |
| "PPE Compliance" | "Safety and Security Combined" |
| "Queue Monitor" | "All Operations Tracking" |
Why: Focused skills have:
- Better accuracy
- Clearer prompts
- Easier troubleshooting
- More actionable alerts
2. Appropriate Triggers
Match triggers to your detection needs.

3. Contextual Prompts
Include relevant context in your prompts.
Basic (Less Effective):
Detect people in this image.
Contextual (More Effective):
You are monitoring a warehouse loading dock. During business hours
(7am-5pm), employees and delivery drivers with visible badges are
authorized. After hours, the area should be empty.
Analyze this image and determine if anyone present appears
unauthorized based on location, attire, and behavior.
Detection Patterns by Use Case
Security: Intrusion Detection
Skill: After-Hours Intrusion
Prompts:
Context: "Secured facility, empty after hours"
Focus: "Unauthorized presence, entry attempts"
Objects:
- Person (stateful)
- Open Door (stateful)
Questions:
- "Is anyone present?" (bool)
- "Signs of forced entry?" (bool)
Profile:
Trigger: Motion or AOAS Person
Schedule: Outside business hours
TTS: Enabled with warning message
Security: Weapon Detection
Skill: Weapon Detection
Prompts:
Context: "Public area requiring safety monitoring"
Focus: "Visible weapons of any type"
Objects:
- Weapon (stateful, high priority)
- Firearm (stateful)
- Knife (stateful)
Questions:
- "Type of weapon detected?" (string)
- "Threat level?" (string: none/low/medium/high/critical)
Profile:
Trigger: AOAS Person or Motion
Schedule: 24/7
Confirmation Threshold: 80%
TTS: Immediate warning
Safety: PPE Compliance
Skill: PPE Compliance
Prompts:
Context: "Construction site requiring hard hat and vest"
Focus: "Missing safety equipment"
Objects:
- Hard Hat (stateful)
- Safety Vest (stateful)
- Safety Glasses (stateful)
Questions:
- "All PPE present?" (bool)
- "Missing items?" (set: hard hat, vest, glasses, none)
Profile:
Trigger: AOAS Person
Schedule: Work hours only
TTS: Friendly reminder if PPE missing
Operations: Queue Monitoring
Skill: Queue Length Monitor
Prompts:
Context: "Retail checkout area"
Focus: "Queue length and wait times"
Objects:
- Person (count only, not stateful)
Questions:
- "Number in queue?" (int)
- "Estimated wait?" (string)
- "Queue acceptable?" (bool, threshold: ≤8 people)
Profile:
Trigger: Schedule (every 60 seconds)
Schedule: Store hours
TTS: None (operations only)
Operations: Delivery Monitoring
Skill: Delivery Verification
Prompts:
Context: "Receiving dock for verified deliveries"
Focus: "Package handling and verification"
Objects:
- Person (stateful)
- Package (stateful)
- Vehicle (stateful)
Questions:
- "Is delivery in progress?" (bool)
- "Proper handling observed?" (bool)
Profile:
Trigger: AOAS Vehicle + Manual
Schedule: Receiving hours
Anti-Patterns to Avoid
Anti-Pattern 1: Kitchen Sink Skill
Problem: Skill tries to detect everything.
# DON'T DO THIS
Skill: All Security
Objects:
- Person
- Vehicle
- Weapon
- Fire
- Package
- Animal
- Badge
- Uniform
# 20+ more...
Why It Fails:
- Prompts become unfocused
- Many false positives
- Hard to tune
- Slow analysis
Solution: Create separate focused skills.
Anti-Pattern 2: Vague Prompts
Problem: Prompts lack specific guidance.
# DON'T DO THIS
Prompt: "Look at this image and tell me what's happening"
Why It Fails:
- Inconsistent responses
- Misses important details
- Hard to integrate with VMS
Solution: Specific, structured prompts with clear outputs.
Anti-Pattern 3: Wrong Trigger Type
Problem: Using Motion when Object Analytics available.
| Scenario | Bad Choice | Good Choice |
|---|---|---|
| Person detection | Motion | AOAS Person |
| Vehicle detection | Motion | AOAS Vehicle |
| Perimeter breach | Motion | AOAS Line Crossing |
Why It Fails:
- More false positives
- Higher costs
- More noise to filter
Solution: Use most specific trigger available.
Anti-Pattern 4: No Pre-filter
Problem: Every trigger goes to full analysis.
Why It Fails:
- High costs in busy areas
- Unnecessary processing
- Longer response times
Solution: Enable pre-filter for high-traffic scenarios.
Anti-Pattern 5: All Objects Stateful
Problem: Every object emits ONVIF events.
# DON'T DO THIS
Objects:
- Person (stateful)
- Bag (stateful)
- Chair (stateful)
- Table (stateful)
# VMS flooded with events!
Why It Fails:
- VMS overwhelmed
- Important events lost in noise
- Action rules become complex
Solution: Only make actionable objects stateful.
Skill Organization Strategies
By Location
Skills:
├── Entrance - General Security
├── Parking - Vehicle Monitoring
├── Warehouse - Safety Compliance
└── Office - Access Control
By Priority
Skills:
├── Critical: Weapon Detection
├── High: Intrusion Detection
├── Medium: PPE Compliance
└── Low: Queue Monitoring
By Function
Skills:
├── Security
│ ├── Weapon Detection
│ └── Intrusion Detection
├── Safety
│ ├── PPE Compliance
│ └── Hazard Detection
└── Operations
├── Queue Monitoring
└── Occupancy Tracking
Tuning Decision Tree
When detections aren't working well:

Performance Optimization
Reduce Analysis Costs
| Strategy | Impact | When to Use |
|---|---|---|
| AOAS triggers | High | Camera supports AOAS |
| Pre-filter | High | High-traffic areas |
| Schedule limits | Medium | Time-bound needs |
| Lower resolution | Low | Basic detection only |
Reduce False Positives
| Strategy | Impact | Trade-off |
|---|---|---|
| Specific triggers | High | May miss edge cases |
| Higher confidence | Medium | May miss true positives |
| Better prompts | High | Requires iteration |
| Pre-filter | High | Adds latency |
Reduce Response Time
| Strategy | Impact |
|---|---|
| Skip pre-filter (for critical) | Faster but more cost |
| Lower resolution | Faster upload/process |
| Simpler prompts | Faster analysis |
Testing Your Detections
Test Checklist
- True positives detected correctly
- True negatives not triggering
- Edge cases handled
- ONVIF events emitting
- VMS rules triggering
- TTS playing (if configured)
- Performance acceptable
Test Methodology
-
Baseline Test
- Normal activity, no detection
- Verify no false positives
-
Positive Test
- Simulate target scenario
- Verify correct detection
-
Edge Case Test
- Partial visibility
- Poor lighting
- Multiple objects
-
Stress Test
- High activity period
- Multiple simultaneous events
Related Topics
- Detections Overview - Understanding the Detection model
- Tuning & Optimization - Reduce false positives
- Skills Reference - Complete skills documentation
- Profiles Reference - Trigger configuration