Text Classification
Transformers
Safetensors
English
roberta
Generated from Trainer
classification
nlp
vulnerability
Eval Results (legacy)
text-embeddings-inference
Instructions to use CIRCL/vulnerability-severity-classification-roberta-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CIRCL/vulnerability-severity-classification-roberta-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="CIRCL/vulnerability-severity-classification-roberta-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("CIRCL/vulnerability-severity-classification-roberta-base") model = AutoModelForSequenceClassification.from_pretrained("CIRCL/vulnerability-severity-classification-roberta-base", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
End of training
Browse files- README.md +37 -156
- config.json +1 -1
- emissions.csv +1 -1
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -1,118 +1,50 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
license:
|
| 4 |
base_model: roberta-base
|
| 5 |
-
metrics:
|
| 6 |
-
- accuracy
|
| 7 |
-
- f1
|
| 8 |
tags:
|
| 9 |
- generated_from_trainer
|
| 10 |
-
|
| 11 |
-
-
|
| 12 |
-
- nlp
|
| 13 |
-
- vulnerability
|
| 14 |
-
datasets:
|
| 15 |
-
- CIRCL/vulnerability-scores
|
| 16 |
model-index:
|
| 17 |
- name: vulnerability-severity-classification-roberta-base
|
| 18 |
-
results:
|
| 19 |
-
- task:
|
| 20 |
-
type: text-classification
|
| 21 |
-
name: Vulnerability severity classification
|
| 22 |
-
dataset:
|
| 23 |
-
type: CIRCL/vulnerability-scores
|
| 24 |
-
name: CIRCL/vulnerability-scores
|
| 25 |
-
split: test
|
| 26 |
-
revision: 55a886a483bb27aabb6461edc64e8058cc136e24
|
| 27 |
-
metrics:
|
| 28 |
-
- type: accuracy
|
| 29 |
-
value: 0.7415
|
| 30 |
-
name: Accuracy
|
| 31 |
-
- type: f1
|
| 32 |
-
value: 0.6460
|
| 33 |
-
name: F1 Macro
|
| 34 |
-
args:
|
| 35 |
-
average: macro
|
| 36 |
---
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
#
|
| 42 |
-
|
| 43 |
-
This model is a fine-tuned version of [roberta-base](https://huggingface.co/roberta-base) on
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
| 59 |
|
| 60 |
## Model description
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
Labels:
|
| 65 |
-
|
| 66 |
-
| Label | CVSS score |
|
| 67 |
-
|-------|------------|
|
| 68 |
-
| Low | < 4.0 |
|
| 69 |
-
| Medium | 4.0 – 6.9 |
|
| 70 |
-
| High | 7.0 – 8.9 |
|
| 71 |
-
| Critical | ≥ 9.0 |
|
| 72 |
-
|
| 73 |
-
## How to get started with the model
|
| 74 |
|
| 75 |
-
|
| 76 |
-
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 77 |
-
import torch
|
| 78 |
|
| 79 |
-
|
| 80 |
-
revision = "064daa2"
|
| 81 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name, revision=revision)
|
| 82 |
-
model = AutoModelForSequenceClassification.from_pretrained(model_name, revision=revision)
|
| 83 |
-
model.eval()
|
| 84 |
|
| 85 |
-
|
| 86 |
-
that could severely harm the host system. This could significantly affect the confidentiality, integrity, and availability of the targeted system."
|
| 87 |
-
inputs = tokenizer(test_description, return_tensors="pt", truncation=True, padding=True)
|
| 88 |
|
| 89 |
-
|
| 90 |
-
with torch.no_grad():
|
| 91 |
-
outputs = model(**inputs)
|
| 92 |
-
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
| 93 |
-
|
| 94 |
-
# Print results
|
| 95 |
-
print("Predictions:", predictions)
|
| 96 |
-
predicted_class = torch.argmax(predictions, dim=-1).item()
|
| 97 |
-
print("Predicted severity:", model.config.id2label[predicted_class])
|
| 98 |
-
```
|
| 99 |
-
|
| 100 |
-
## Training data
|
| 101 |
-
|
| 102 |
-
Revision [`55a886a`](https://huggingface.co/datasets/CIRCL/vulnerability-scores/tree/55a886a483bb27aabb6461edc64e8058cc136e24)
|
| 103 |
-
of [CIRCL/vulnerability-scores](https://huggingface.co/datasets/CIRCL/vulnerability-scores),
|
| 104 |
-
built with VulnTrain 3.4.0 from CVE records, GitHub, PySec and CSAF (Red Hat, Cisco, CISA) advisories:
|
| 105 |
-
|
| 106 |
-
| Split | Rows | Labelled rows |
|
| 107 |
-
|-------|-----:|--------------:|
|
| 108 |
-
| train | 670,283 | 567,964 |
|
| 109 |
-
| validation | 83,550 | 71,470 |
|
| 110 |
-
| test | 83,376 | 70,472 |
|
| 111 |
-
|
| 112 |
-
- **Group-aware split (80/10/10).** Rows that share a description, an identifier or an alias are
|
| 113 |
-
kept in the same split, so no vulnerability appears in both train and test.
|
| 114 |
-
- **Labels** come from the first available CVSS score, in the order v4.0, v3.1, v3.0, v2.0.
|
| 115 |
-
CVSS 4.0 scores are read with base metrics only (CVSS-B), whatever the source.
|
| 116 |
|
| 117 |
## Training procedure
|
| 118 |
|
|
@@ -127,71 +59,20 @@ The following hyperparameters were used during training:
|
|
| 127 |
- lr_scheduler_type: linear
|
| 128 |
- num_epochs: 5
|
| 129 |
|
| 130 |
-
The checkpoint with the best validation accuracy (epoch 4) is the one published.
|
| 131 |
-
|
| 132 |
-
Training took 4 h 25 min on 4 × NVIDIA L40S and used 4.61 kWh, for 0.48 kg CO₂eq
|
| 133 |
-
(measured with CodeCarbon, see [`emissions.csv`](emissions.csv)).
|
| 134 |
-
|
| 135 |
-
### Results
|
| 136 |
-
|
| 137 |
-
Evaluated once on the leakage-free test split of
|
| 138 |
-
[CIRCL/vulnerability-scores](https://huggingface.co/datasets/CIRCL/vulnerability-scores/tree/55a886a483bb27aabb6461edc64e8058cc136e24)
|
| 139 |
-
(revision `55a886a`, 70,472 labelled rows):
|
| 140 |
-
|
| 141 |
-
- Accuracy: **0.7415** (95% CI 0.7383 – 0.7447)
|
| 142 |
-
- F1 Macro: 0.6460
|
| 143 |
-
|
| 144 |
-
| Class | Precision | Recall | F1 |
|
| 145 |
-
|-------|----------:|-------:|---:|
|
| 146 |
-
| Low | 0.6146 | 0.3280 | 0.4278 |
|
| 147 |
-
| Medium | 0.7767 | 0.8251 | 0.8002 |
|
| 148 |
-
| High | 0.7328 | 0.7237 | 0.7282 |
|
| 149 |
-
| Critical | 0.6460 | 0.6107 | 0.6279 |
|
| 150 |
-
|
| 151 |
### Training results
|
| 152 |
|
| 153 |
-
Validation metrics at each epoch:
|
| 154 |
-
|
| 155 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 Macro | Low Precision | Low Recall | Low F1 | Medium Precision | Medium Recall | Medium F1 | High Precision | High Recall | High F1 | Critical Precision | Critical Recall | Critical F1 |
|
| 156 |
|:-------------:|:-----:|:-----:|:---------------:|:--------:|:--------:|:-------------:|:----------:|:------:|:----------------:|:-------------:|:---------:|:--------------:|:-----------:|:-------:|:------------------:|:---------------:|:-----------:|
|
| 157 |
-
| 2.
|
| 158 |
-
| 2.
|
| 159 |
-
| 1.
|
| 160 |
-
| 1.
|
| 161 |
-
| 1.
|
| 162 |
-
|
| 163 |
-
### Previous versions
|
| 164 |
|
| 165 |
-
The previous model, trained on the earlier random split, is revision
|
| 166 |
-
[`10d9861`](https://huggingface.co/CIRCL/vulnerability-severity-classification-roberta-base/tree/10d9861)
|
| 167 |
-
(dataset revision `34e6a14`, test accuracy 81.17%, 73.02% on the test rows without a twin in train).
|
| 168 |
|
| 169 |
### Framework versions
|
| 170 |
|
| 171 |
-
- Transformers 5.
|
| 172 |
- Pytorch 2.15.0+cu132
|
| 173 |
- Datasets 4.8.5
|
| 174 |
- Tokenizers 0.23.3
|
| 175 |
-
|
| 176 |
-
## Citation
|
| 177 |
-
|
| 178 |
-
```bibtex
|
| 179 |
-
@article{bonhomme2025vlai,
|
| 180 |
-
title = {{VLAI}: A {RoBERTa}-Based Model for Automated Vulnerability
|
| 181 |
-
Severity Classification},
|
| 182 |
-
author = {Bonhomme, C{\'e}dric and Dulaunoy, Alexandre},
|
| 183 |
-
journal = {arXiv preprint arXiv:2507.03607},
|
| 184 |
-
year = {2025}
|
| 185 |
-
}
|
| 186 |
-
|
| 187 |
-
@techreport{bonhomme2026vulnscores,
|
| 188 |
-
title = {Improving vulnerability-scores: Leakage-Free Splits and
|
| 189 |
-
Consistent {CVSS} 4.0 Scoring},
|
| 190 |
-
author = {Bonhomme, C{\'e}dric},
|
| 191 |
-
institution = {CIRCL - Computer Incident Response Center Luxembourg},
|
| 192 |
-
year = {2026},
|
| 193 |
-
month = oct,
|
| 194 |
-
doi = {10.5281/zenodo.23760802},
|
| 195 |
-
url = {https://doi.org/10.5281/zenodo.23760802}
|
| 196 |
-
}
|
| 197 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
license: mit
|
| 4 |
base_model: roberta-base
|
|
|
|
|
|
|
|
|
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
+
metrics:
|
| 8 |
+
- accuracy
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
model-index:
|
| 10 |
- name: vulnerability-severity-classification-roberta-base
|
| 11 |
+
results: []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 15 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 16 |
+
|
| 17 |
+
# vulnerability-severity-classification-roberta-base
|
| 18 |
+
|
| 19 |
+
This model is a fine-tuned version of [roberta-base](https://huggingface.co/roberta-base) on an unknown dataset.
|
| 20 |
+
It achieves the following results on the evaluation set:
|
| 21 |
+
- Loss: 3.0881
|
| 22 |
+
- Accuracy: 0.7477
|
| 23 |
+
- F1 Macro: 0.6619
|
| 24 |
+
- Low Precision: 0.5404
|
| 25 |
+
- Low Recall: 0.4261
|
| 26 |
+
- Low F1: 0.4765
|
| 27 |
+
- Medium Precision: 0.7953
|
| 28 |
+
- Medium Recall: 0.8114
|
| 29 |
+
- Medium F1: 0.8033
|
| 30 |
+
- High Precision: 0.7300
|
| 31 |
+
- High Recall: 0.7469
|
| 32 |
+
- High F1: 0.7384
|
| 33 |
+
- Critical Precision: 0.6604
|
| 34 |
+
- Critical Recall: 0.6015
|
| 35 |
+
- Critical F1: 0.6296
|
| 36 |
|
| 37 |
## Model description
|
| 38 |
|
| 39 |
+
More information needed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
## Intended uses & limitations
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
More information needed
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
## Training and evaluation data
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
More information needed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
## Training procedure
|
| 50 |
|
|
|
|
| 59 |
- lr_scheduler_type: linear
|
| 60 |
- num_epochs: 5
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
### Training results
|
| 63 |
|
|
|
|
|
|
|
| 64 |
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 Macro | Low Precision | Low Recall | Low F1 | Medium Precision | Medium Recall | Medium F1 | High Precision | High Recall | High F1 | Critical Precision | Critical Recall | Critical F1 |
|
| 65 |
|:-------------:|:-----:|:-----:|:---------------:|:--------:|:--------:|:-------------:|:----------:|:------:|:----------------:|:-------------:|:---------:|:--------------:|:-----------:|:-------:|:------------------:|:---------------:|:-----------:|
|
| 66 |
+
| 2.5865 | 1.0 | 18258 | 2.6268 | 0.7302 | 0.6219 | 0.6499 | 0.2702 | 0.3817 | 0.7774 | 0.8076 | 0.7922 | 0.7061 | 0.7295 | 0.7176 | 0.6226 | 0.5720 | 0.5962 |
|
| 67 |
+
| 2.3063 | 2.0 | 36516 | 2.5395 | 0.7447 | 0.6513 | 0.6407 | 0.3392 | 0.4436 | 0.7705 | 0.8451 | 0.8061 | 0.7491 | 0.6990 | 0.7231 | 0.6375 | 0.6272 | 0.6323 |
|
| 68 |
+
| 1.6765 | 3.0 | 54774 | 2.6399 | 0.7478 | 0.6605 | 0.6133 | 0.3784 | 0.4681 | 0.7952 | 0.8150 | 0.8050 | 0.7342 | 0.7365 | 0.7354 | 0.6307 | 0.6362 | 0.6334 |
|
| 69 |
+
| 1.6561 | 4.0 | 73032 | 2.8246 | 0.7483 | 0.6634 | 0.6211 | 0.3880 | 0.4776 | 0.8001 | 0.8076 | 0.8038 | 0.7282 | 0.7466 | 0.7373 | 0.6364 | 0.6334 | 0.6349 |
|
| 70 |
+
| 1.2166 | 5.0 | 91290 | 3.0881 | 0.7477 | 0.6619 | 0.5404 | 0.4261 | 0.4765 | 0.7953 | 0.8114 | 0.8033 | 0.7300 | 0.7469 | 0.7384 | 0.6604 | 0.6015 | 0.6296 |
|
|
|
|
|
|
|
| 71 |
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
### Framework versions
|
| 74 |
|
| 75 |
+
- Transformers 5.22.2
|
| 76 |
- Pytorch 2.15.0+cu132
|
| 77 |
- Datasets 4.8.5
|
| 78 |
- Tokenizers 0.23.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -34,7 +34,7 @@
|
|
| 34 |
"pad_token_id": 1,
|
| 35 |
"problem_type": "single_label_classification",
|
| 36 |
"tie_word_embeddings": true,
|
| 37 |
-
"transformers_version": "5.
|
| 38 |
"type_vocab_size": 1,
|
| 39 |
"use_cache": true,
|
| 40 |
"vocab_size": 50265
|
|
|
|
| 34 |
"pad_token_id": 1,
|
| 35 |
"problem_type": "single_label_classification",
|
| 36 |
"tie_word_embeddings": true,
|
| 37 |
+
"transformers_version": "5.22.2",
|
| 38 |
"type_vocab_size": 1,
|
| 39 |
"use_cache": true,
|
| 40 |
"vocab_size": 50265
|
emissions.csv
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
timestamp,project_name,run_id,experiment_id,duration,emissions,emissions_rate,cpu_power,gpu_power,ram_power,cpu_energy,gpu_energy,ram_energy,energy_consumed,water_consumed,country_name,country_iso_code,region,cloud_provider,cloud_region,os,python_version,codecarbon_version,cpu_count,cpu_model,gpu_count,gpu_model,longitude,latitude,ram_total_size,tracking_mode,cpu_utilization_percent,gpu_utilization_percent,ram_utilization_percent,ram_used_gb,on_cloud,pue,wue
|
| 2 |
-
2026-
|
|
|
|
| 1 |
timestamp,project_name,run_id,experiment_id,duration,emissions,emissions_rate,cpu_power,gpu_power,ram_power,cpu_energy,gpu_energy,ram_energy,energy_consumed,water_consumed,country_name,country_iso_code,region,cloud_provider,cloud_region,os,python_version,codecarbon_version,cpu_count,cpu_model,gpu_count,gpu_model,longitude,latitude,ram_total_size,tracking_mode,cpu_utilization_percent,gpu_utilization_percent,ram_utilization_percent,ram_used_gb,on_cloud,pue,wue
|
| 2 |
+
2026-11-13T16:33:32,VulnTrain,fa63d08b-de15-4b04-9d1f-2657c1449f00,5b0fa12a-3dd7-45bb-9766-cc326314d9f1,16333.030918859999,0.49822975988256707,3.050442764467271e-05,70.00019598784039,904.829317126947,70.0,0.31755006313886025,4.098892778556039,0.31674697697422527,4.733189818669112,0.0,Luxembourg,LUX,luxembourg,,,Linux-6.8.0-149-generic-x86_64-with-glibc2.39,3.12.3,3.3.2,224,Intel(R) Xeon(R) Platinum 8480+,4,4 x NVIDIA L40S,6.1327,49.6098,2015.3354415893555,machine,0.6936078672403196,77.62334050399508,1.0999877074370008,21.564408882952353,N,1.0,0.0
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 498618976
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:264e93c8df795b1dc66459bae6bf178bad6b30b7c5b553ca25ea49b251cfcae4
|
| 3 |
size 498618976
|