songdo / AnomalyDetect

Anomaly detection for time series

Home Page:localhost:8000

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recognition of sharp outbursts on the graph

Before recognition, the series undergoes preprocessing in the form of a Holt-Winters smoothing, and dividing each co- ordinate by a burst factor. Since the data are discrete, a formula for detecting strong oscillations on a graph, such as:



The time series is represented as a function of x (t), where t is the time of the coordinate, and in this case the index in the array, the time series is represented by the formula:



Neural network: a fully connected perceptron with three layers and architecture:

  • x -> w1 -> relus -> w2 -> relu -> w3 -> softmax
  1. Input size: 100
  2. First hidden size: 55
  3. Seconds hidden size: 1024
  4. Output size: 2 (anomaly or not anomaly)

Loss function: cross entropy for softmax

Loss function optimization: stochastic gradient descent of Adam Network training: Method of back propagation error

Quick start

make docker_build && make docker_up

Dependencies

For server:
For network train:

Server api


GET /

Server test.
RESPONSE:

{
    "server": "Server start in 8080 port."
}

GET /test

Get network weights, model load test.
RESPONSE:

{
    'w1': {
        'w1: [],
        'b1: []
    },
    'w2': {
        'w2: [],
        'b2: []
    },
    'w3': {
        'w3: [],
        'b3: []
    }
}

POST /analyze

To analyze a segment or segments on the anomaly.
REQYEST BODY:

{
    "series": [
        {
            "value": 1,
            "timestamp": 1514238804
        },
        {
            "value": 1,
            "timestamp": 1514238804
        }
    ]
}

RESPONSE:

{
    "results": [
        {
            "anomaly": true,
            "start": 1514238804,
            "end": 1514238804
        },
        {
            "anomaly": false,
            "start": 1514238804,
            "end": 1514238804
        }
    ]
}

About

Anomaly detection for time series

localhost:8000


Languages

Language:Python 98.2%Language:Makefile 1.8%