Skip to main content

A network intrusion detection system using Chain of Thought, knowledge graphs and GraphSAGE

Project description

CoT-KG Network Intrusion Detection using Knowledge Graph and GraphSAGE

This project implements a network intrusion detection system using Chain of Thought (CoT), knowledge graphs and GraphSAGE model on the CICIDS2017 dataset. The Chain of Thought approach is used to enhance the knowledge graph construction and improve the interpretability of the detection process.

Key Features

  • Chain of Thought (CoT) enhanced knowledge graph construction
  • GraphSAGE-based network intrusion detection
  • Interpretable AI techniques for explaining detection results
  • Integration of domain knowledge with machine learning

Data Download and Preparation

The CICIDS2017 dataset is used in this project. Follow these steps to download and prepare the data:

  1. Clone this repository:
git clone https://github.com/chenxingqiang/cotkg-network-intrusion-detection.git
cd cotkg-network-intrusion-detection
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Run the data download script:
python src/download_data.py

This script will:

  • Download the MachineLearningCSV.zip file from the CICIDS2017 dataset

  • Check the integrity of the downloaded file

  • Extract the contents to the data/raw/ directory

Note: The download might take some time as the file is about 224MB.

  1. After running the script, the data will be available in the data/raw/MachineLearningCVE/ directory.

Installation

To install the required dependencies, run:

pip install -r requirements.txt

Usage

After preparing the data, you can run the main script to train and evaluate the model:

python src/main.py

This script will:

  • Load and preprocess the data
  • Perform feature engineering
  • Construct the knowledge graph
  • Train the GraphSAGE model
  • Evaluate the model
  • Generate explanations for the predictions

Note

The raw data files are large and are not included in the git repository. They will be downloaded when you run the download_data.py script. If you need to share the project, others can use the same script to download the data.

Author

Chen Xingqiang Hanghzou Turing AI Co.,Ltd. Email: chen.xingqiang@iechor.com

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

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

cotkg_network_intrusion_detection-0.1.1.tar.gz (56.9 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file cotkg_network_intrusion_detection-0.1.1.tar.gz.

File metadata

File hashes

Hashes for cotkg_network_intrusion_detection-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b8822ee247466d1f5d54adf6ac8b9bceda71ff7788c39be80fba59823f059b55
MD5 5731589f558026b124a406c989395259
BLAKE2b-256 2711e79d3bef3fe83e1e7089685f18e57656f62df016b6dae7d55155787d93d8

See more details on using hashes here.

File details

Details for the file cotkg_network_intrusion_detection-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cotkg_network_intrusion_detection-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8dc6cc8f678d343ecdea0a7210a7fcfd280702ed1a2439a31adfe78de11da20f
MD5 61f99b659c3de7621507dae6981ec7f0
BLAKE2b-256 beca92fc7a2a90910bdb42e8c490812ac88f755734dc85814bd3032584c8c35a

See more details on using hashes here.

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