Graph-based intrusion detection using GCN, Transformer autoencoder, and contrastive learning
Project description
GraphIDS
Graph-based intrusion detection using GCN, Transformer autoencoder, and contrastive learning.
Reference implementation of the framework introduced in:
Govindarajan, V. & Muzamal, J. H. (2025). Advanced cloud intrusion detection framework using graph based features transformers and contrastive learning. Scientific Reports, 15, 20511. DOI: 10.1038/s41598-025-07956-w
Install
pip install graphids
Quick start
from graphids import GraphIDS
model = GraphIDS(n_features=41, n_classes=5)
model.train_pipeline(X_train, y_train)
result = model.evaluate(X_test, y_test)
print(f"Accuracy: {result.accuracy:.4f}")
Architecture
Three-stage pipeline:
- GCN — constructs a communication graph from flow data, extracts structural node embeddings via 3-layer graph convolution
- Transformer autoencoder — refines embeddings through self-attention, identifies discriminative feature dimensions
- Contrastive classifier — improves class separation for minority attack types (U2R, R2L), outputs multi-class predictions
Results (from the paper)
| Dataset | Accuracy | Precision | Recall | F1 | FPR |
|---|---|---|---|---|---|
| NSL-KDD (5-class) | 99.97% | 99.94% | 99.92% | 99.93% | 0.05% |
| CIC-IDS (binary) | 99.96% | 99.93% | 99.91% | 99.92% | 0.06% |
| CIC-IDS (multi) | 99.95% | 99.92% | 99.90% | 99.91% | 0.07% |
Citation
@article{govindarajan2025graphids,
title = {Advanced cloud intrusion detection framework using graph based
features transformers and contrastive learning},
author = {Govindarajan, Vijay and Muzamal, Junaid Hussain},
journal = {Scientific Reports},
volume = {15},
pages = {20511},
year = {2025},
doi = {10.1038/s41598-025-07956-w},
}
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graphids-0.1.0.tar.gz.
File metadata
- Download URL: graphids-0.1.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db63759f43cbe5361b07c54276709c9b63d4269cc8b97df55e5df6cae6eba603
|
|
| MD5 |
f8084ed1639442f9335d89d690bcedb6
|
|
| BLAKE2b-256 |
eb106d4af618da8347695c722c3e7f3f8d3b636fcbd29038b3e0121511359227
|
Provenance
The following attestation bundles were made for graphids-0.1.0.tar.gz:
Publisher:
publish.yml on vijaygovindaraja/graphids
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graphids-0.1.0.tar.gz -
Subject digest:
db63759f43cbe5361b07c54276709c9b63d4269cc8b97df55e5df6cae6eba603 - Sigstore transparency entry: 1281024464
- Sigstore integration time:
-
Permalink:
vijaygovindaraja/graphids@7aa537751fd8a9cfdb7033e0b5a646676270eb43 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vijaygovindaraja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7aa537751fd8a9cfdb7033e0b5a646676270eb43 -
Trigger Event:
release
-
Statement type:
File details
Details for the file graphids-0.1.0-py3-none-any.whl.
File metadata
- Download URL: graphids-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46f1df024a4ac757ec6419d18dc2073213f0404bc51c243225cefb3d2745e1d5
|
|
| MD5 |
c8e910ec29111fc35fcc82e481e8ffe7
|
|
| BLAKE2b-256 |
ad2ae3e5674c774697f9155638db5a3490481e4c2115b2d0ab3807e3beac0eb2
|
Provenance
The following attestation bundles were made for graphids-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on vijaygovindaraja/graphids
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graphids-0.1.0-py3-none-any.whl -
Subject digest:
46f1df024a4ac757ec6419d18dc2073213f0404bc51c243225cefb3d2745e1d5 - Sigstore transparency entry: 1281024466
- Sigstore integration time:
-
Permalink:
vijaygovindaraja/graphids@7aa537751fd8a9cfdb7033e0b5a646676270eb43 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vijaygovindaraja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7aa537751fd8a9cfdb7033e0b5a646676270eb43 -
Trigger Event:
release
-
Statement type: