This repository provides the code for LineVD: Statement-level Vulnerability Detection using Graph Neural Networks. The environment can be built using Singularity, or by following / following the commands in the Singularity file. To start, clone the repository and navigate to the root directory.
(main module) ├── sastvd
│ ├── codebert
│ ├── helpers
│ ├── ivdetect
│ ├── linevd
│ └── scripts
├── storage
(memoization) │ ├── cache
(raw data) │ ├── external
(csvs) │ ├── outputs
(models) │ └── processed
(tests) └── tests
Build and initialise environment and download dataset
sudo singularity build main.sif Singularity
singularity run main.sif -p initialise
Feature extraction (Increase NUM_JOBS if running on HPC for speed up)
singularity exec main.sif python sastvd/scripts/prepare.py
singularity exec main.sif python sastvd/scripts/getgraphs.py
Train model (Training takes around 1-2 hours using GTX 3060)
singularity exec --nv main.sif python sastvd/scripts/train_best.py