Skip to main content

A framework for evaluating intrusion detection systems for IoT botnets.

Project description

Python

IDS Evaluation Framework

A comprehensive, modular, and configurable framework for evaluating Machine Learning-based Intrusion Detection Systems (IDS).

evaluation_pipeline

Features

  • Modular Plugin Architecture: Easily extend the framework with custom IDS models, metrics, and adversarial attacks
  • Flexible Data Pipeline: Load, preprocess, and split datasets with configurable preprocessing steps and feature selection
  • Multiple Evaluation Modes: Support for intra-dataset, cross-dataset, and k-fold cross-validation evaluation
  • Comprehensive Metrics: Built-in static metrics (accuracy, F1, precision, recall, ROC-AUC, etc.) and runtime metrics (CPU, RAM, training time)
  • Adversarial Robustness Testing: Evaluate model robustness against adversarial attacks (FGSM, noise perturbation, junk data injection)
  • Reproducible Results: Hash-based output organization ensures consistent experiment tracking
  • Flexible Deployment: Run natively with Python or via Docker

Installation

Prerequisites

  • Python 3.13+
  • uv (recommended) or pip

Native Installation

# Install dependencies (uv should be in your $PATH)
uv sync

# Verify installation
uv run ids-eval version

Docker Installation

# Configure environment variables
cp .env.example .env
# Edit .env to set your data paths

# Run via Docker Compose
docker compose run --rm ids-eval version

A pre-built Docker image is available on Docker Hub: niklassandhu/ids-eval-framework:latest

Quick Start

1. Create a Configuration File

Copy the example configuration and adjust it to your needs:

cp examples/run_config/example.config.yml examples/run_config/my_config.yml

2. Prepare Your Data

Run the data preparation pipeline:

uv run ids-eval dataset <run_config>

3. Run Evaluation

Execute the evaluation pipeline:

uv run ids-eval evaluate <run_config>

Usage

CLI Commands

The framework provides two main commands:

Command Description
ids-eval dataset <config.yml> Run dataset pipeline
ids-eval evaluate <config.yml> Run evaluation pipeline

Evaluation Flags

Flag Description
--train-only Only train models, skip testing phase
--force-train Force retraining, ignore saved models
--force-model Load saved models without config hash validation
--clear-checkpoints Clear evaluation checkpoints before running

Makefile Targets

make dataset CONFIG=<config.yml>          # Run dataset pipeline
make evaluate CONFIG=<config.yml>         # Run evaluation pipeline
make docker-dataset CONFIG=<config.yml>   # Run dataset pipeline via Docker
make docker-evaluate CONFIG=<config.yml>  # Run evaluation via Docker
make help                                 # Show all available targets

Configuration

The framework uses YAML configuration files. See run_config/example.config.yml for a fully documented example.

Key Configuration Sections

  • general: Run name, paths, random seed
  • data_manager: Dataset loading, preprocessing, feature selection, train/test split
  • evaluation: IDS models, metrics, adversarial attacks

Output Structure

All outputs are organized in hash-based directories for reproducibility:

out/
├── processed_datasets/<hash>/    # Preprocessed datasets
├── saved_models/<hash>/          # Trained models
└── reports/<hash>/               # Evaluation reports
    ├── config.yaml               # Configuration used
    ├── dataset_report.yaml       # Dataset statistics
    ├── ids_report.yaml           # Detailed evaluation results
    └── evaluation_summary.yaml   # Aggregated summary

The configuration hash is displayed at startup:

Your config hash is: a1b2c3d4

Plugin Development

The framework supports four types of plugins:

Plugin Type Directory Base Class
IDS Models plugin_ids/ AbstractIDSConnector
Static Metrics plugin_static_metric/ AbstractStaticMetric
Runtime Metrics plugin_runtime_metric/ AbstractRuntimeMetric
Adversarial Attacks plugin_adversarial/ AbstractAdversarialAttack

See the existing plugins in each directory for implementation examples.

Development

make setup      # Install dependencies
make test       # Run tests
make lint       # Check code style
make format     # Format code

BibTeX entry

Please cite this project using the following bibtex entry:
Generic badge

@inproceedings{}

License

See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ids_evaluation_framework-0.2.0.tar.gz (62.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ids_evaluation_framework-0.2.0-py3-none-any.whl (80.7 kB view details)

Uploaded Python 3

File details

Details for the file ids_evaluation_framework-0.2.0.tar.gz.

File metadata

  • Download URL: ids_evaluation_framework-0.2.0.tar.gz
  • Upload date:
  • Size: 62.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ids_evaluation_framework-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c6feb9cab303e84145c363f411d0c78daab0d43354cc93ac4f3b12f5021aef78
MD5 b222a9a96b13b321cfb6a6f2352246a8
BLAKE2b-256 4ef6642fb220b731bc61d500e4fd4777337cd075b317ca6c7206202211090cb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ids_evaluation_framework-0.2.0.tar.gz:

Publisher: ci.yml on niklassandhu/ids-evaluation-framework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ids_evaluation_framework-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ids_evaluation_framework-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b260aa3fa88b35c6648412a6f1b15d15b4651e162ff4cad94ef4e3de28fc24e2
MD5 d285acaa3fe54d7c6d5229ef9f617e38
BLAKE2b-256 e0850f67c47e8d0230d22ed78465b9850306b08fab77a6ce3025fe888f10090d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ids_evaluation_framework-0.2.0-py3-none-any.whl:

Publisher: ci.yml on niklassandhu/ids-evaluation-framework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page