Vision Field Notes

Designing Alert Rules: Schedules, Cooldowns and Escalation

Detection produces events. Alerts are what humans see. The gap between the two is where many video analytics projects succeed or fail. A perfect detector with badly designed alerts overwhelms people with messages until they mute the channel. A mediocre detector with well-designed alerts can still be useful, because the rules filter, group and route what matters.

This article covers the design of the rule layer that sits between detections and people.

Separate events from alerts

Keep two concepts apart:

Store every event, whether or not it triggers an alert. Events are your audit trail and your data for tuning. You can review them later, change the rules, and replay history to see what the new rules would have done. If you only store alerts, you cannot tune anything.

Flow diagram: detections go to confirm, then events, then rule (scope, schedule, stream health, cooldown, severity), then alert. Events also flow down to an event store for audit and replay; alerts flow down to delivery with queue, retry, rate limit and escalation.
Caption: Events are stored whether or not they become alerts; only the rule layer decides when to interrupt a person.

What a rule should contain

A useful rule definition has these parts:

Part Example
Condition Person inside zone "loading dock"
Confirmation Present for at least N seconds
Schedule Only between closing time and opening time, in local time
Scope Which cameras and zones
Cooldown Do not repeat for the same zone for M minutes
Severity Low, medium, high
Destination Which channel or person
Escalation If not acknowledged within T minutes, notify the next level

Writing rules as data (a config or database row) rather than code makes them reviewable and lets non-engineers adjust them under change control.

Schedules

Many alerts only make sense in a time window: a restricted area after hours, a safety rule during a shift, a machine that must not run unattended. Points to get right:

Cooldowns and de-duplication

Without a cooldown, one person standing in a zone creates an alert every second. A cooldown suppresses repeats after the first alert for a defined time. Think about what the key of the cooldown should be:

Cooldown length is a trade-off. Too short and messages pile up. Too long and a new, different event gets hidden behind the old one. One approach is to suppress repeats but still escalate if the condition persists, for example, send a reminder only if the situation continues beyond a larger threshold.

Timeline from 22:00 to 23:40 with four rows: presence in zone, events, alerts without cooldown (10 markers) and alerts with a 15 minute cooldown (4 alerts plus one reminder, 5 messages), with grey bars showing each cooldown window.
Caption: Repeated events during one long stay become 10 messages without a cooldown and 5 with a 15-minute cooldown plus a reminder for a condition that persists. Illustrative timeline.

Also consider grouping: if ten cameras report the same type of problem within a minute, such as a network fault or a lighting change that confuses the detector, send one grouped message rather than ten. A burst across many cameras at once is more often a system problem than ten separate real events, and it is worth flagging as such.

Absence rules

Some of the most valuable rules are about something not happening: "no one has been at the front desk for 20 minutes", "the conveyor has not moved", "the delivery truck did not arrive by 06:00". They are also the riskiest, because a broken camera or stalled pipeline produces exactly the same data as an empty scene: no detections.

To make absence rules safe:

  1. Require a healthy-stream signal first. If the stream is stale, frozen or blind, the rule state is "unknown", not "absent".
  2. Raise a separate system alert for the unhealthy stream, so someone fixes the root cause.
  3. Use a window long enough to ride out normal gaps, such as a person walking out of view briefly.

See Handling RTSP Dropouts: Reconnects and Health Checks for the health signals.

Confirmation and false-alarm control

Confirmation windows turn noisy per-frame detections into stable conditions. Require the condition to hold for a few seconds, or in N of the last M frames, before an event is created. More methods are in Reducing False Alarms in Production Video Analytics. Do the filtering before the alert rule, so rules operate on clean events.

Severity and escalation

Not every event deserves a phone call. Define severity levels with agreed meanings:

Escalation means that if nobody acknowledges within a set time, the system tries the next person or group. This needs acknowledgement tracking: the alert has a state (new, acknowledged, resolved), a person who acknowledged it, and a time. Without these, you cannot tell whether anyone saw it.

Keep high severity rare. If most alerts are high, none of them are.

Make alerts self-explanatory

A person receiving an alert at night should not have to log in to understand it. Include:

The snapshot is the single most useful element. It lets the receiver judge in seconds whether to act. Think about privacy when you decide what to attach and who can see it; see Privacy and Ethics in Camera Analytics.

Delivery must be reliable

An alert system that silently fails is worse than none, because people assume they are covered. Practical measures:

Test rules like code

Rules have bugs. Build a replay harness: feed recorded events or clips through the rule engine and check the outputs against expectations. Include edge cases: events across midnight, a daylight saving change, a stream dropping mid-event, two zones triggering at once, the cooldown expiring exactly as a new event arrives. Review the alert history after any rule change, and keep the old version so you can roll back.

Finally, review usage. Ask the people who receive alerts which ones they act on and which they ignore. Rules that nobody acts on should be changed or removed.

Checklist

Next steps: see Zone Intrusion and Dwell Time Alerts for producing events, and Scaling Video Analytics to Hundreds of Camera Streams for running this at volume.