Overview

Behavior Analytics microservice does streaming analytics of vision inference metadata and produces insights in the form of time series metrics and alerts. These timeseries metrics and alerts can be retrieved using the Analytics Web API microservice. It provides rich situational awareness about the environment monitored by camera.

Input

  1. Message stream of per frame vision metadata which includes detected object bounding box. This is published by Deepstream component over Redis stream.

  2. Tripwire, ROI and Alert rules configurations

Output

  1. Counts timeseries metrics for FOV, Tripwires and ROIs

  2. Alerts based on configured Alert rules

Behavior Analytics modules

  • Field of View (FOV): Counting of people in the camera field of view

  • Tripwire (Tripwire): Counting of people crossing across a configured tripwire line segments

  • Region of Interest (ROI): Counting of people in the configured region of interest

FOV

Field of View represents the full camera view. FOV analytics module can track movement of People within the full field of view and provides time series metrics, and alerts related to it.

FOV Occupancy Counts

FOV occupancy is counted for each 1-second time interval. It can queried using API for a specific time range and optionally aggregated to a higher unit of time like minutes, hours and days.

FOV Occupancy Alerts

Alerts are specific event of interest regarding occupancy of FOV. Alert rules define the conditions which needs to be meet for the Alert to be raised.

FOV Occupancy Alert Rules

Alert rules define the conditions which needs to be meet for the Alert to be raised.

Following are the types of Alert rules supported for FOV.

Increment Alert rule

Raise alert after a certain number people have entered or exited the FOV. This is tracked separately for enter/exit. The count of people used as a threshold and is configurable.

Occupancy Alert rule

Raise alert after number people in the FOV exceed certain threshold. The count of people used as a threshold is configurable.

Occupancy Threshold Switch Alert rule

Raise alert after a number people occupying the FOV switch above or below a configured threshold. The count of people used as a threshold is configurable. The alert is only published when the occupancy count surpasses a threshold or falls below the threshold.

Tripwire

Tripwire is a defined as a sequence of line segments and is used for counting people crossing it from either direction. Tripwire analytics module can track movement of People across the tripwire and provides time series count metrics, and alerts related to it.

Tripwire Crossing Counts

Tripwire crossing from both directions (enter/exit) are counted for each 1-second time interval.It can queried by API for a specific time range and optionally aggregated to a higher unit of time like minutes, hours and days.

Tripwire Crossing Alerts

Alerts are specific event of interest. Alert rules define the conditions which needs to be meet for the Alert to be raised.

Tripwire Crossing Alert Rules

Alert rules define the conditions which needs to be meet for the Alert to be raised.

Following are the types of Alert rules supported for Tripwire.

Increment Alert rule

Raise alert after a number people crossing the tripwire exceed certain threshold. This is tracked separately for each direction (enter/exit). The count of people used as a threshold is configurable.

Flowrate Alert rule

Raise alert when the rate of people crossing the tripwire per second exceed certain threshold over a period of time. This is tracked separately for each direction (enter/exit).

The rule is configured using two parameters.

  • Rate of people crossing per second.

  • The time interval in seconds over which the rate of crossing is maintained.

ROI

ROI represents the defined region of interest inside the camera field of view. ROI analytics module can track movement of People within the configured ROI and provides time series count metrics, and alerts related to it.

ROI Occupancy Counts

ROI occupancy is counted for each 1-second time interval. It can queried by API for a specific time range and optionally aggregated to a higher unit of time like minutes, hours and days.

ROI Occupancy Alerts

Alerts are specific event of interest regarding occupancy of ROI. Alert rules define the conditions which needs to be meet for the Alert to be raised.

ROI Occupancy Alert Rules

Alert rules define the conditions which needs to be meet for the Alert to be raised.

Following are the types of Alert rules supported for ROI.

Increment Alert rule

Raise alert after a certain number people have entered or exited the ROI. This is tracked separately for enter/exit. The count of people used as a threshold and is configurable.

Occupancy Alert rule

Raise alert after a number people occupying ROI, exceed certain threshold for a given interval of time. The count of people used as a threshold is configurable.

Occupancy Threshold Switch Alert rule

Raise alert after a number people occupying the ROI switch above or below a configured threshold. The count of people used as a threshold and is configurable. The alert is only published when the occupancy count surpasses a threshold or falls below the threshold.

Architecture

The system is designed using event driven microservices architectural pattern. Messaging system is used for loose coupling between components. Stream processing of vision metadata performed in real-time. Separate components are there for analytical computation and serving of results.

Components

The system is decomposed into following application level components implemented as microservices.

Behavior Analytics

This component is responsible for

  • Consume the vision metadata produced by DeepStream component over Redis stream channel.

  • Tracks movement of people and measures occupancy (FOV, ROI) and crossings (Tripwire) counts.

  • Persist counts in Redis timeseries module.

  • Execute Alert rules and determines if alerts are to be published

  • Publish Alerts to Redis stream channel.

  • Maintain the state of each detected object (Person). Performs smoothening of trajectory.

  • Publish Trajectory to Redis stream channel.

Analytics Web API

This component is responsible for:

  • Providing REST API to retrieve the stored counts in Redis timeseries.

  • Persist the alerts in SQLite DB and provide REST API to retrieve them.

  • Persist the vision metadata in file system and provide REST API to retrieve them.

  • Persist the trajectory in file system and provide REST API to retrieve them.

  • Provide API to create,update and query configuration of Alert Rules, Tripwire and ROI.

  • Persist the configuration information in SQlite DB.

  • Publish configuration changes over Redis stream channel for informing Analytics component of changes.

Redis

  • Redis timeseries module is used to store timeseries counts.

  • Redis stream is used for asynchronous communication with DeepStream and inter component communication.

Sqlite DB

  • Stores configuration for Alert rules, Tripwire and ROI

  • Stores Alerts

File System

  • Stores vision metadata and trajectories

Documentation Organization

The rest of the documentation is organized as below:

Description of various Metropolis Analytics modules can be found in the respective sections:

Field of view (FOV) API Guide: Field of view (FOV) overview and API Guide.

Tripwire API Guide: Tripwire overview and API Guide.

Region of Interest (ROI) API Guide: Region of Interest (ROI) overview and API Guide.

Metadata API Guide: Perception metadata overview and API Guide.

Behaviors API Guide: Behavior (trajectory) overview and API Guide.

Deployment Configuration: Deployment configuration.

API Specification: API Specification.