Code Monkey home page Code Monkey logo

brad's Introduction

BRAD: Bandwidth Reduction with Anomaly Detection

Modern compression techniques leverage a learned representation over an image distribution to more efficiently encode redundant spatial context for a sample. Video content is also generally redundant in time.

This work implements online training of convolutional autoencoders to learn a nonstationary image distribution in streaming video. Then, we perform anomaly detection by thresholding the autoencoder's reconstruction loss, which we regard as an anomaly score.

anomaly_detected

Setup

Adapt the included config.ini to suit your needs.

The demo uses OpenCV so you can configure the video sources with:

  • a webcam index (0,1 or /dev/video0)
  • an RTSP url
  • other URIs recognized by cv2.VideoCapture() (.mp4 or .mkv containers)

To affect model recency bias, consider changing:

  • the model learning rate (smaller rates --> less recency bias)
  • the time window length (smaller windows --> greater recency bias)

To explore different network architectures, change the net_arch parameter. This should be a list of 3-tuples organized as:

  • First entry - No. of Filters (Output dim)
  • Second entry - Size of Convolutional Kernel (assumed square)
  • Third entry - Size of Pooling (assumed square)

Dependencies

This repo requires opencv and tensorflow:

pip install -r requirements.txt

Running the Demo

Set the config to reflect your video sources and model preferences before running:

python3 visual_anomaly_detection_demo.py

A network is instantiated for each video source according to preferences set in the config.ini.

Online training begins and normal/anomaly classes along with the reconstruction loss will be streamed to stdout according to the configured threshold (by default 5 sigma deviation from moving average).

References

brad's People

Contributors

smellslikeml avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.