Giter Site home page Giter Site logo

d41sys / can-ae-transformer-ids Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 0.0 18.11 MB

Source code for paper "Multi-Classification In-Vehicle Intrusion Detection System using Packet- and Sequence-Level Characteristics from Time-Embedded Transformer with Autoencoder"

Python 4.37% Jupyter Notebook 95.63%
autoencoder car-hacking ids in-vehicle-network transfromers

can-ae-transformer-ids's Introduction

CAN-AE-Transformer-IDS

This is source code for paper "Multi-Classification In-Vehicle Intrusion Detection System using Packet- and Sequence-Level Characteristics from Time-Embedded Transformer with Autoencoder"

Journal: Knowledge-Based Systems

Link: https://doi.org/10.1016/j.knosys.2024.112091

Data Preprocessing

Car Hacking dataset

CUDA_VISIBLE_DEVICES=0 python3 splitDataIntoSession.py --window_size=29 --strided=29 --attack_type=chd > data_preprocessing_chd.txt

ROAD Fabrication dataset

CUDA_VISIBLE_DEVICES=0 python3 splitDataIntoSession.py --window_size=15 --strided=15 --attack_type=road_fab --indir=./road/fab_dataset --outdir=./road/fab_multi/TFRecord > data_preprocessing_roadfab.txt

ROAD Masquerade dataset

CUDA_VISIBLE_DEVICES=0 python3 splitDataIntoSession.py --window_size=15 --strided=15 --attack_type=road_mas --indir=./road/mas_dataset --outdir=./road/mas_multi/TFRecord > data_preprocessing_roadmas.txt

Train test split

Car hacking dataset

CUDA_VISIBLE_DEVICES=1 python3 trainTestSplit.py --data_path=./data/CHD --window_size 29 --strided 29 --rid 1

ROAD dataset

CUDA_VISIBLE_DEVICES=1 python3 trainTestSplit.py --data_path=./data/fab_dataset --window_size 15 --strided 15 --rid 1
CUDA_VISIBLE_DEVICES=1 python3 trainTestSplit.py --data_path=./data/mas_dataset --window_size 15 --strided 15 --rid 1

Train

ROAD masquerade dataset

CUDA_VISIBLE_DEVICES=2 python3 new_trainer.py --indir=./road/mas_multi/TFRecord_w15_s15/1/ --window_size=15 --batch_size=32 --type=road_mas --mode=cb --tse=True --epoch=150 --ver=2

ROAD fabrication dataset

CUDA_VISIBLE_DEVICES=2 python3 new_trainer.py --indir=./road/fab_multi/TFRecord_w15_s15/1/ --window_size=15 --batch_size=32 --type=road_fab --mode=cb --tse=True --epoch=300 --ver=2

Params

--indir, type=str | Data path input

--window_size, type=int | Window size (15 for ROAD and 29 for CHD)

--type, type=str | Dataset type: chd or road

--epoch, type=int | Epoch value

--batch_size, type=int | Batch size value

--lr, type=float | Learning rate

--mode, type=str | cb or ae (the ways of using AE)

--tse, type=bool | Using tse

--ver, type=str | Version value

Citation

If you use this code for your research, please cite our paper.

@article{LE2024112091,
title = {Multi-classification in-vehicle intrusion detection system using packet- and sequence-level characteristics from time-embedded transformer with autoencoder},
journal = {Knowledge-Based Systems},
volume = {299},
pages = {112091},
year = {2024},
issn = {0950-7051},
doi = {https://doi.org/10.1016/j.knosys.2024.112091},
url = {https://www.sciencedirect.com/science/article/pii/S0950705124007251}}

can-ae-transformer-ids's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

can-ae-transformer-ids's Issues

DATASET QUESTION

Is the data set used as a query a public data set CAR-HACKING DATASET?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.