Giter Site home page Giter Site logo

nguyenanhtuan1008 / mlops_videoanomalydetection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/mlops_videoanomalydetection

0.0 1.0 0.0 18.56 MB

Operationalize a video anomaly detection model with Azure ML

License: MIT License

Python 99.48% Shell 0.52%

mlops_videoanomalydetection's Introduction

Video Anomaly Detection - with Azure ML and MLOps

Build Status

The automation of detecting anomalous event sequences in videos is a challenging problem, but also has broad applications across industry verticals.

The approach followed in this repository involves self-supervised training deep neural networks to develop an in-depth understanding of the physical and causal rules in the observed scenes. The model effectively learns to predict future frames in the video in a self-supervised fashion.

The trained model can then be used to detect anomalies in videos. As the model tries to predict each next frame, one can calculate the error in the model's prediction. If the error is large, it is likely that an anomalous even occurred.

The approach can be used both in a supervised and unsupervised fashion, thus enabling the detection of pre-defined anomalies, but also of anomalous events that have never occurred in the past.

Post on LinkedIn (includes video)

Example scenarios

The following snapshots are also links to video demonstrations.

Unsupervised Approach:

Video of unsupervised anomaly detection

Supervised Approach:

Video of unsupervised anomaly detection

Learning Goals

You will learn:

  1. How to adapt an existing neural network architecture to your use-case.
  2. How to prepare video data for deep learning.
  3. How to perform hyperparameter tuning with HyperDrive to improve the performance of your model.
  4. How to deploy a deep neural network as a webservice for video processing.
  5. How to post-process the output of a Keras model for secondary tasks (here, anomaly detection).
  6. How to define a build pipeline for DevOps.

Pre-requisites

Skills

  1. Some familiarity with concepts and frameworks for neural networks:
  2. Knowledge of basic data science and machine learning concepts. Here and here you'll find short introductory material.
  3. Moderate skills in coding with Python and machine learning using Python. A good place to start is here.

Software Dependencies

  • Various python modules. We recommend working with a conda environement (see config/environment.yml and Documentation).
    • We recommend you begin by installing Miniconda.
    • Also consider running the following command to update you conda base image: conda update -n base -c defaults conda
    • Then, you could run: conda env create -f config/environment.yml
  • If you are using a DSVM:

Hardware Dependencies

A computer with a GPU, for example a Linux Azure VM. Compare VM sizes and prices). If you don't know what to choose, we recommend the Standard NC6, the most affordable VM with a GPU.

You could create a VM in the Azure Portal.

Dataset

UCSD Anomaly Detection Dataset

Agenda

The recommended first step is to clone this repository.

Getting Started

  1. Data Preparation - Download and prepare data for training/testing.
  2. Azure ML Configuration - Configure your Azure ML workspace.
  3. AML Pipelines - Automate data preparation, training, and re-training.
  4. Deployment - How to deploy your anomaly detection as a webservice on AKS.

Deep-dive

  1. Model Development - Understand model architecture and training.
  2. Fine Tuning - Perform transfer learning with pretrained model onnew data.
  3. Hyperparameter tuning - Tune hyperparameters with HyperDrive.
  4. Anomaly Detection - Use Model errors for detecting anomalies.

Contribute

We invite contributions to this repository. The preferred method would be to fork this repository and to create a pull request.

References / Resources

Troubleshooting

Missing cuda libraries

We noticed that tensorflow might be looking for the wrong the of cudatoolkit.

You might see the following error:

Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory

We found that it helps to look at which version of these libraries you have installed, and pin the version of cudatoolkit to the version that tensorflow is looking for. E.g. above, TF is looking for 10.0, so we pinned the version of the cudatoolkit to 10.0 in config/environment.yml.

mlops_videoanomalydetection's People

Contributors

jpe316 avatar andrejpk avatar microsoftopensource avatar msftgits 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.