Skip to content

Anomaly Transformer is an AI-driven system for detecting irregular patterns in time-series data. Using Transformer attention, reconstruction loss, and association discrepancy, it identifies anomalies with precision. The project provides CSV upload, interactive graphs, and a simple UI for exploring abnormal trends in sequence data.

Notifications You must be signed in to change notification settings

koustub1412/Transformer-for-Anomaly-Detection-in-TimeSeries-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ˆ TimeSeries Anomaly Transformer

TimeSeries Anomaly Transformer is a full-stack AI system designed to detect anomalies in time-series data using a custom-built Transformer architecture. Users can upload CSV datasets, visualize anomalies, and explore detected abnormal points through an interactive UI.


πŸš€ Features

  • πŸ€– Transformer-based Anomaly Detection
  • 🧠 Association Discrepancy + Anomaly Attention Mechanism
  • πŸ“Š Real-time Graph Visualization
  • πŸ“ CSV Dataset Upload Support
  • πŸ” Highlights Exact Anomaly Locations
  • ⚑ Backend-powered anomaly scoring
  • 🌐 React-based modern UI

🧩 Tech Stack

Layer Technology
Frontend React, Chart.js
Backend Express.js
Model Python (NumPy, Matplotlib, PyTorch)
Core Logic Transformer, Gaussian Kernel, Minimax Strategy
Dataset Bitcoin (2018–2024) CSV

πŸ“ Folder Structure

TimeSeries-Transformer/
β”œβ”€β”€ backend/                # Node + Express API
β”‚   β”œβ”€β”€ server.js
β”‚   β”œβ”€β”€ routes/
β”‚   └── controllers/
β”‚
β”œβ”€β”€ model/                  # Python Transformer Models
β”‚   β”œβ”€β”€ simple_transformer.py
β”‚   β”œβ”€β”€ pytorch_transformer.py
β”‚   β”œβ”€β”€ transformer_no_libs.py
β”‚   β”œβ”€β”€ anomaly_attention.py
β”‚   └── preprocess.py
β”‚
β”œβ”€β”€ frontend/               # React UI
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ FileUploader.js
β”‚   β”‚   β”‚   β”œβ”€β”€ GraphView.js
β”‚   β”‚   β”‚   └── AnomalyList.js
β”‚   β”‚   β”œβ”€β”€ App.js
β”‚   β”‚   └── index.js
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”‚
β”œβ”€β”€ datasets/
β”‚   β”œβ”€β”€ BTC_1D.csv
β”‚   β”œβ”€β”€ BTC_4H.csv
β”‚   β”œβ”€β”€ BTC_15M.csv
β”‚   └── BTC_1H.csv
β”‚
└── README.md

πŸ”§ Setup Instructions

🐍 Python Model Setup

cd model
python -m venv venv
venv\Scripts\activate     # Windows
pip install -r requirements.txt

Run model:

python simple_transformer.py

🌐 Frontend (React)

cd frontend
npm install
npm start

πŸ”Œ Backend (Express)

cd backend
npm install
npm start

πŸ‘₯ Contributors

@koustub1412 Team Members β€” NGIT

About

Anomaly Transformer is an AI-driven system for detecting irregular patterns in time-series data. Using Transformer attention, reconstruction loss, and association discrepancy, it identifies anomalies with precision. The project provides CSV upload, interactive graphs, and a simple UI for exploring abnormal trends in sequence data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published