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/chen/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.0.tar.gz (13.7 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.0.tar.gz.

File metadata

File hashes

Hashes for cotkg_network_intrusion_detection-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd8f2c515037e7b8416853f03242fd93f84d8fc74b883a4fe864607af6024d9d
MD5 691283864f9248f3480c728fd468a396
BLAKE2b-256 484bfd8a2802bee7c25f255b8d85d6cf5ef3e5467e1ab35472e12d059c7bb022

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cotkg_network_intrusion_detection-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70b28670d7f258345569adc649de5ba62ecf422010a7ea316d01b7bc41e9685f
MD5 f3b9b574a26344341425e2812490db95
BLAKE2b-256 16199aeeceee8385855d32e168419767dd675626a0a84c31dc7df03d69655cca

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