The paper 'Investigation of Intrusion Detection Methods for Smart Systems Utilizing the GCN-LOF Algorithm' code. This repository implements GCN-LOF, a method that combines Graph Convolutional Networks (GCNs) with the Local Outlier Factor (LOF) for anomaly detection and other graph-based learning tasks. The code is written in Python and leverages popular libraries such as PyTorch for deep learning.
- Graph Convolutional Networks (GCNs): Leverages GCNs to capture graph structure and node features.
- Local Outlier Factor (LOF): Enhances anomaly detection by integrating LOF with GCN outputs.
- Customizable: Modular design allows easy extension for new datasets and models.
GCN-LOF-main/
├── gcn-lof-chinese.py # Example script in Chinese for specific use cases
├── main.py # Main entry point for the project
├── data/
│ └── full_dataset/ # Folder containing datasets
├── models/
│ └── gcn.py # Implementation of the GCN model
├── train/
│ └── train_test.py # Training and testing scripts
├── utils/
│ ├── data_loader.py # Data loading utilities
│ ├── metrics.py # Performance metrics
- Python >= 3.8
- PyTorch >= 1.10
- Other dependencies listed in
requirements.txt
- Clone the repository:
git clone https://github.com/your-username/GCN-LOF.git cd GCN-LOF - Install dependencies:
pip install -r requirements.txt
- Verify installation by running a test script:
python main.py --help
Place your datasets in the data/full_dataset/ directory. Ensure the data is formatted according to the instructions in data/full_dataset/README.md.
Run the training script:
python main.py --train --epochs 50 --dataset your_dataset_nameEvaluate the trained model:
python main.py --test --dataset your_dataset_nameModify hyperparameters in the main.py or pass them via command-line arguments, e.g.,:
python main.py --train --learning_rate 0.01 --hidden_units 64main.py: Entry point for training and testing the GCN-LOF model.models/gcn.py: Defines the GCN architecture.utils/data_loader.py: Handles data preprocessing and loading.utils/metrics.py: Implements performance metrics.
Below is an example to train and evaluate the model:
python main.py --train --dataset cora --epochs 100
python main.py --test --dataset cora