Skip to content
Snippets Groups Projects
Commit 2b92575d authored by yacinetouahria's avatar yacinetouahria
Browse files

tutorial

parent 7725415a
No related branches found
No related tags found
1 merge request!2tutorial
......@@ -32,33 +32,76 @@ In this library, we provide a variety of binary classifiers, clustering algorith
| DBSCAN | Clustering Algorithm |
| Fuzzy C mean | Clustering Algorithm |
| Gaussian Mixture | Clustering Algorithm |
| K-means | Clustering Algorithm |
| k-Means | Clustering Algorithm |
| Mean shift | Clustering Algorithm |
| Isolation Forest | Anomaly Detection Algorithm |
| One-class SVM | Anomaly Detection Algorithm |
| Local Outlier Factor | Anomaly Detection Algorithm |
| DBSCAN | Anomaly Detection Algorithm |
| k-Means | Anomaly Detection Algorithm |
### 1.2. Datasets
The following intrusion detection datasets were used to test and evaluate the models. Our code includes all the pre-processing steps required to convert these datasets from tabular format into graphs. Due to usage restrictions, this library provides only a single graph of each dataset, with 5,000 nodes, already pre-processed and normalized.
| Name | Ref |
|-----------------|-------|
| CIC-DDoS2019 | [7] |
| AWID3 | |
| Name | Ref |
|------------------------|-------|
| CIC-DDoS2019 | [7] |
| AWID3 | [8] |
| CIC-Darknet2020 | [9] |
| NF-UNSW-NB15-V2 | [10] |
| NF-BoT-IoT-V2 | [11] |
| NF-ToN-IoT-V2 | [12] |
| NF-CSE-CIC-IDS2018-V2 | [13] |
## 2. Installation
```bash
git clone https://gitlab.liris.cnrs.fr/gladis/ghypeddings.git
mv ghypeddings\ Ghypeddings\
```
## 3. Usage
Training and evaluation a model using our library is done in 03 lines of code only!
Training and evaluating a model using our library is done in lines of code only!
### 3.1. Models
```python
from Ghypeddings import PVAE
# adj: adjacency matrix
# features: node features matrix
model = PVAE(adj=adj,
features=features,
labels=labels,
dim=20,
hidden_dim=features.shape[1],
test_prop=.2,
val_prop=.1,
epochs=50,
classifier='random forest')
# fit the model and outputs the training scores
loss, accuracy, f1,recall,precision,roc_auc,training_time = model.fit()
# prediction scores
loss,acc,f1,recall,precision,roc_auc = model.predict()
```
### 3.2. Datasets
```python
from Ghypeddings import Darknet
# Build a graph of 5000 nodes from the Darknet dataset
adj ,features ,labels = Darknet().build(n_nodes = 5000)
# The graph is already loaded automatically after executing the previous line of code
# This method saves time and helps comparing results
# it simply loads graphs built and saved previously
adj, features, labels = Darknet().load_samples()
```
## 4. Citation
> Mohamed Yacine Touahria Miliani, Souhail Abdelmouaiz Sadat, Mohammed Haddad, Hamida Seba, and Karima Amrouche. 2024. Comparing Hyperbolic Graph Embedding models on Anomaly Detection for Cybersecurity. In Proceedings of the 19th International Conference on Availability, Reliability and Security (ARES '24). Association for Computing Machinery, New York, NY, USA, Article 118, 1–11. https://doi.org/10.1145/3664476.3670445
## 5. References
......@@ -68,4 +111,10 @@ Training and evaluation a model using our library is done in 03 lines of code on
[4]: [Mathieu, Emile, et al. "Continuous hierarchical representations with poincaré variational auto-encoders." Advances in neural information processing systems 32 (2019).](https://proceedings.neurips.cc/paper/2019/hash/0ec04cb3912c4f08874dd03716f80df1-Abstract.html)
[5]: [Dai, Jindou, et al. "A hyperbolic-to-hyperbolic graph convolutional network." Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2021.](https://www.computer.org/csdl/proceedings-article/cvpr/2021/450900a154/1yeJgfbgw6Y)
[6]: [Park, Jiwoong, et al. "Unsupervised hyperbolic representation learning via message passing auto-encoders." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2021.](https://ieeexplore.ieee.org/document/9577649)
[7]: [CIC-DDoS2019](https://www.unb.ca/cic/datasets/ddos-2019.html)
\ No newline at end of file
[7]: [CIC-DDoS2019](https://www.unb.ca/cic/datasets/ddos-2019.html)
[8]: [AWID3](https://icsdweb.aegean.gr/awid/)
[9]: [CIC-Darknet2020](https://www.unb.ca/cic/datasets/darknet2020.html)
[10]: [NF-UNSW-NB15-V2](https://staff.itee.uq.edu.au/marius/NIDS_datasets/#RA6)
[11]: [NF-BoT-IoT-V2](https://staff.itee.uq.edu.au/marius/NIDS_datasets/#RA8)
[11]: [NF-ToN-IoT-V2](https://staff.itee.uq.edu.au/marius/NIDS_datasets/#RA7)
[13]: [NF-CSE-CIC-IDS2018-V2](https://staff.itee.uq.edu.au/marius/NIDS_datasets/#RA9)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment