Skip to content

Vbhhacl/advanced-anomaly-detection-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Advanced Anomaly Detection System (AADS)

An end-to-end Machine Learning pipeline designed to monitor real-time data streams and flag statistical irregularities. This system integrates a predictive model with a REST API and a simulation dashboard to visualize anomaly detection as it happens.


πŸ—οΈ System Architecture

The project is divided into four core components:

  • Model Trainer (train_model.py): Script to preprocess data and train the detection algorithm.
  • Inference Engine (anomaly_api.py): A Flask/FastAPI backend that serves the trained model via REST endpoints.
  • Real-time Simulator (realtime_simulator.py): A script that generates synthetic data streams to test the model's limits.
  • Web Dashboard: Located in templates and statics, providing a visual representation of the data flow and anomaly spikes.

πŸ“ˆ Real-Time Monitoring Output

The system evaluates incoming values and assigns a classification based on the learned decision boundary.

Sample Detection Logs:

Timestamp Data Value Status Label
21:55:06 -0.7259 βœ… Normal model=0
21:55:04 0.0103 βœ… Normal model=0
21:55:03 -5.3221 🚨 Anomaly model=1
21:55:02 5.4508 🚨 Anomaly model=1

πŸš€ Quick Start

1. Environment Setup

Clone the repository and initialize a virtual environment:

git clone https://github.com/Vbhhacl/advanced-anomaly-detection-system.git
cd advanced-anomaly-detection-system
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

2. Install Dependencies

pip install -r requirements.txt

3. Execution

First, ensure the model is trained, then start the API and Simulator:

python train_model.py
python anomaly_api.py
python realtime_simulator.py

πŸ“‚ Project Structure

β”œβ”€β”€ statics/             # CSS and JS for the dashboard
β”œβ”€β”€ templates/           # HTML templates
β”œβ”€β”€ anomaly_api.py       # API for model serving
β”œβ”€β”€ anomaly_model.pkl    # Serialized ML model
β”œβ”€β”€ realtime_simulator.py # Data stream generator
β”œβ”€β”€ requirements.txt     # Project dependencies
β”œβ”€β”€ train_model.py       # Model training logic
└── .gitignore           # Version control exclusions

πŸ› οΈ Tech Stack

  • Language: Python 3.x
  • ML Libraries: Scikit-Learn, NumPy, Pandas
  • API Framework: Flask / FastAPI
  • Frontend: HTML5, CSS3, JavaScript

Author: Vbhhacl

About

πŸš€ Real-time anomaly detection system using Machine Learning (Scikit-Learn). Features a Flask API, live data simulator, and a dynamic web dashboard for instant threat visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors