Anomaly detection analysis and labeling tool, specifically for multiple time series (one time series per category)

Overview

taganomaly

Anomaly detection labeling tool, specifically for multiple time series (one time series per category).

Taganomaly is a tool for creating labeled data for anomaly detection models. It allows the labeler to select points on a time series, further inspect them by looking at the behavior of other times series at the same time range, or by looking at the raw data that created this time series (assuming that the time series is an aggregated metric, counting events per time range)

Note: This tool was built as a part of a customer engagement, and is not maintained on a regular basis.

Click here to deploy on Azure using Azure Container Instances: Deploy to Azure

Table of contents

Using the app

The app has four main windows:

The labeling window

UI

Time series labeling

Time series

Selected points table view

Selected points

View raw data for window if exists

Detailed data

Compare this category with others over time

Compare

Find proposed anomalies using the Twitter AnomalyDetection package

Reference results

Observe the changes in distribution between categories

This could be useful to understand whether an anomaly was univariate or multivariate Distribution comparison

How to run locally

using R

This tool uses the shiny framework for visualizing events. In order to run it, you need to have R and preferably Rstudio. Once you have everything installed, open the project (taganomaly.Rproj) on R studio and click Run App, or call runApp() from the console. You might need to manually install the required packages

Requirements

  • R (3.4.0 or above)

Used packages:

  • shiny
  • dplyr
  • gridExtra
  • shinydashboard
  • DT
  • ggplot2
  • shinythemes
  • AnomalyDetection

Using Docker

Pull the image from Dockerhub:

docker pull omri374/taganomaly

Run:

docker run --rm -p 3838:3838 omri374/taganomaly

How to deploy using docker

Deploy to Azure

Deploy to Azure Web App for Containers or Azure Container Instances. More details here (webapp) and here (container instances)

Pull the image manually

Deploy this image to your own environment.

Building from source

In order to build a new Docker image, run the following commands from the root folder of the project:

sudo docker build -t taganomaly .

If you added new packages to your modified TagAnomaly version, make sure to specify these in the Dockerfile.

Once the docker image is built, run it by calling

docker run -p 3838:3838 taganomaly

Which would result in the shiny server app running on port 3838.

Instructions of use

  1. Import time series CSV file. Assumed structure:
  • date ("%Y-%m-%d %H:%M:%S")
  • category
  • value
  1. (Optional) Import raw data time series CSV file. If the original time series is an aggreation over time windows, this time series is the raw values themselves. This way we could dive deeper into an anomalous value and see what it is comprised of. Assumed structure:
  • date ("%Y-%m-%d %H:%M:%S")
  • category
  • value
  1. Select category (if exists)

  2. Select time range on slider

  3. Inspect your time series: (1): click on one time range on the table below the plot to see raw data on this time range (2): Open the "All Categories" tab to see how other time series behave on the same time range.

4.Select points on plot that look anomalous.

  1. Click "Add selected points" to add the marked points to the candidate list.

  2. Once you decide that these are actual anomalies, save the resulting table to csv by clicking on "Download labels set" and continue to the next category.

Current limitations

Points added but not saved will be lost in case the date slider or categories are changed, hence it is difficult to save multiple points from a complex time series. Once all segments are labeled, one can run the provided prep_labels.py file in order to concatenate all of TagAnomaly's output file to one CSV.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Comments
  • The UI gets no response after running for a while

    The UI gets no response after running for a while

    User-System: MacOS 10.15 Deployment: deployed on Azure Container with the docker image Chrome: 80.0.3987.149 (Official Build) (64-bit) Problem: The UI get stuck after out of focus for a while. Detail: I uploaded a 11M size file and tried to analyze the time series. After running for a while (switch to other workspaces or browser tabs), I found the UI got no response, and the bug can be reproduced. When I clicked the tab buttons, there's no response, and the error message in console is

    shinyapp.js:288 Uncaught TypeError: Cannot read property 'readyState' of null
        at ShinyApp.$sendMsg (shinyapp.js:288)
        at ShinyApp.sendInput (shinyapp.js:140)
        at InputBatchSender.$sendNow (input_rate.js:220)
    
    Screen Shot 2020-03-24 at 6 20 28 PM
    opened by qqdaiyu55 8
  • How to label anomaly points if these points are not consecutive ?

    How to label anomaly points if these points are not consecutive ?

    Hi, very nice work !

    And here is a problem. How to label anomaly points if these points are not consecutive ?

    When I use this tool, I can only draw one rectangle on the showing plot. So, if the anomalous points are not consecutive, it is not supported for me to draw multiple rectangles to embrace all these points.

    How to solve that ?

    opened by ZJUguquan 5
  • ERROR: An error has occurred. Check your logs or contact the app author for clarification.

    ERROR: An error has occurred. Check your logs or contact the app author for clarification.

    Run with docker container:

    docker run -p 80:3838 -d --name=test omri374/taganomaly
    

    It's report this error:

    ERROR: An error has occurred. Check your logs or contact the app author for clarification.
    

    image

    bug 
    opened by jagerzhang 2
  • When docker run, an error occurs.

    When docker run, an error occurs.

    Run with docker container:

    docker run -p 3838:3838 taganomaly

    error:

    R version 3.5.1 (2018-07-02) -- "Feather Spray"
    Copyright (C) 2018 The R Foundation for Statistical Computing
    Platform: x86_64-pc-linux-gnu (64-bit)
    
    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.
    
    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.
    
    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    
    > shiny::runApp('/root/app')
    Loading required package: shiny
    Loading required package: shinythemes
    Loading required package: DT
    
    Attaching package: ‘DT’
    
    The following objects are masked from ‘package:shiny’:
    
        dataTableOutput, renderDataTable
    
    Loading required package: dplyr
    
    Attaching package: ‘dplyr’
    
    The following objects are masked from ‘package:stats’:
    
        filter, lag
    
    The following objects are masked from ‘package:base’:
    
        intersect, setdiff, setequal, union
    
    Loading required package: ggplot2
    Loading required package: gridExtra
    
    Attaching package: ‘gridExtra’
    
    The following object is masked from ‘package:dplyr’:
    
        combine
    
    Loading required package: shinydashboard
    
    Attaching package: ‘shinydashboard’
    
    The following object is masked from ‘package:graphics’:
    
        box
    
    Loading required package: parsedate
    Loading required package: devtools
    Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
      there is no package called ‘devtools’
    Installing package into ‘/usr/local/lib/R/site-library’
    (as ‘lib’ is unspecified)
    Error in contrib.url(repos, type) :
      trying to use CRAN without setting a mirror
    Calls: <Anonymous> ... ..stacktraceon.. -> install.packages -> grep -> contrib.url
    Execution halted
    

    When entering "docker ps -al" command:

    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
    508c691d33fe        taganomaly          "R -e shiny::runApp(…"   44 seconds ago      Exited (1) 42 seconds ago                       adoring_khayyam
    

    What is the cause?

    opened by limhwanhee 1
  • Add missing dependency lixml2-dev for R package devtools

    Add missing dependency lixml2-dev for R package devtools

    The command

    R -e "install.packages('devtools', repos='http://cran.rstudio.com')"
    

    results in

    ------------------------- ANTICONF ERROR ---------------------------                                                                                                                                        
    Configuration failed because libxml-2.0 was not found. Try installing:                                                                                                                                      
     * deb: libxml2-dev (Debian, Ubuntu, etc)                                                                                                                                                                   
     * rpm: libxml2-devel (Fedora, CentOS, RHEL)                                                                                                                                                                
     * csw: libxml2_dev (Solaris)             
    

    Solution: The container's Debian 9 does not contain libxml2-dev. After adding it to the dependencies the image builds without errors and the container runs as expected.

    opened by wildgarden 1
  • Adding Microsoft SECURITY.MD

    Adding Microsoft SECURITY.MD

    Please accept this contribution adding the standard Microsoft SECURITY.MD :lock: file to help the community understand the security policy and how to safely report security issues. GitHub uses the presence of this file to light-up security reminders and a link to the file. This pull request commits the latest official SECURITY.MD file from https://github.com/microsoft/repo-templates/blob/main/shared/SECURITY.md.

    Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.

    opened by microsoft-github-policy-service[bot] 0
Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
USAD - UnSupervised Anomaly Detection on multivariate time series

USAD - UnSupervised Anomaly Detection on multivariate time series Scripts and utility programs for implementing the USAD architecture. Implementation

null 116 Jan 4, 2023
Code for the paper "TadGAN: Time Series Anomaly Detection Using Generative Adversarial Networks"

TadGAN: Time Series Anomaly Detection Using Generative Adversarial Networks This is a Python3 / Pytorch implementation of TadGAN paper. The associated

Arun 92 Dec 3, 2022
LightLog is an open source deep learning based lightweight log analysis tool for log anomaly detection.

LightLog Introduction LightLog is an open source deep learning based lightweight log analysis tool for log anomaly detection. Function description [BG

null 25 Dec 17, 2022
Official PyTorch implementation of MX-Font (Multiple Heads are Better than One: Few-shot Font Generation with Multiple Localized Experts)

Introduction Pytorch implementation of Multiple Heads are Better than One: Few-shot Font Generation with Multiple Localized Expert. | paper Song Park1

Clova AI Research 97 Dec 23, 2022
LogDeep is an open source deeplearning-based log analysis toolkit for automated anomaly detection.

LogDeep is an open source deeplearning-based log analysis toolkit for automated anomaly detection.

donglee 279 Dec 13, 2022
(JMLR'19) A Python Toolbox for Scalable Outlier Detection (Anomaly Detection)

Python Outlier Detection (PyOD) Deployment & Documentation & Stats Build Status & Coverage & Maintainability & License PyOD is a comprehensive and sca

Yue Zhao 6.6k Jan 3, 2023
Streaming Anomaly Detection Framework in Python (Outlier Detection for Streaming Data)

Python Streaming Anomaly Detection (PySAD) PySAD is an open-source python framework for anomaly detection on streaming multivariate data. Documentatio

Selim Firat Yilmaz 181 Dec 18, 2022
A Python Library for Graph Outlier Detection (Anomaly Detection)

PyGOD is a Python library for graph outlier detection (anomaly detection). This exciting yet challenging field has many key applications, e.g., detect

PyGOD Team 757 Jan 4, 2023
Demo project for real time anomaly detection using kafka and python

kafkaml-anomaly-detection Project for real time anomaly detection using kafka and python It's assumed that zookeeper and kafka are running in the loca

Rodrigo Arenas 36 Dec 12, 2022
Official PyTorch code for WACV 2022 paper "CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows"

CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows WACV 2022 preprint:https://arxiv.org/abs/2107.1

Denis 156 Dec 28, 2022
Official PyTorch implementation of CAPTRA: CAtegory-level Pose Tracking for Rigid and Articulated Objects from Point Clouds

CAPTRA: CAtegory-level Pose Tracking for Rigid and Articulated Objects from Point Clouds Introduction This is the official PyTorch implementation of o

Yijia Weng 96 Dec 7, 2022
Cockpit is a visual and statistical debugger specifically designed for deep learning.

Cockpit: A Practical Debugging Tool for Training Deep Neural Networks

Felix Dangel 421 Dec 29, 2022
Code for 'Single Image 3D Shape Retrieval via Cross-Modal Instance and Category Contrastive Learning', ICCV 2021

CMIC-Retrieval Code for Single Image 3D Shape Retrieval via Cross-Modal Instance and Category Contrastive Learning. ICCV 2021. Introduction In this wo

null 42 Nov 17, 2022
An unofficial personal implementation of UM-Adapt, specifically to tackle joint estimation of panoptic segmentation and depth prediction for autonomous driving datasets.

Semisupervised Multitask Learning This repository is an unofficial and slightly modified implementation of UM-Adapt[1] using PyTorch. This code primar

Abhinav Atrishi 11 Nov 25, 2022
Time-series-deep-learning - Developing Deep learning LSTM, BiLSTM models, and NeuralProphet for multi-step time-series forecasting of stock price.

Stock Price Prediction Using Deep Learning Univariate Time Series Predicting stock price using historical data of a company using Neural networks for

Abdultawwab Safarji 7 Nov 27, 2022
This is the offical website for paper ''Category-consistent deep network learning for accurate vehicle logo recognition''

The Pytorch Implementation of Category-consistent deep network learning for accurate vehicle logo recognition This is the offical website for paper ''

Wanglong Lu 28 Oct 29, 2022
Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders

Modeling Category-Selective Cortical Regions with Topographic Variational Autoencoders

null 1 Oct 11, 2021
Single-stage Keypoint-based Category-level Object Pose Estimation from an RGB Image

CenterPose Overview This repository is the official implementation of the paper "Single-stage Keypoint-based Category-level Object Pose Estimation fro

NVIDIA Research Projects 188 Dec 27, 2022
PyTorch implemention of ICCV'21 paper SGPA: Structure-Guided Prior Adaptation for Category-Level 6D Object Pose Estimation

SGPA: Structure-Guided Prior Adaptation for Category-Level 6D Object Pose Estimation This is the PyTorch implemention of ICCV'21 paper SGPA: Structure

Chen Kai 24 Dec 5, 2022