Late-fusion exploitation-priority model for CVEs. Predicts the calibrated
probability that a vulnerability becomes an operational priority (CISA KEV
membership as the exploitation-priority proxy), instead of ranking by CVSS
base score alone.
Trained on
alirezaaminzadeh/cve-riskrank
with a strict temporal split: train ≤ 2024-12-31, validation 2025 H1,
test 2025 H2. Early stopping on validation PR-AUC. All training ran on
Hugging Face ZeroGPU hardware.
Raw (uncalibrated) test PR-AUC: 0.135. See
metrics.json for the full
validation/test breakdown and the baseline comparison in
cve-riskrank-baseline.
1import json
2
3import joblib
4import numpy as np
5import pandas as pd
6import torch
7from huggingface_hub import hf_hub_download
8from sentence_transformers import SentenceTransformer
9
10REPO = "alirezaaminzadeh/cve-riskrank-fusion"
11cfg = json.load(open(hf_hub_download(REPO, "config.json")))
12pre = joblib.load(hf_hub_download(REPO, "tabular_preprocessor.joblib"))
13cal = joblib.load(hf_hub_download(REPO, "calibrator.joblib"))
14
15class FusionHead(torch.nn.Module):
16 def __init__(self, dim_in):
17 super().__init__()
18 self.net = torch.nn.Sequential(
19 torch.nn.Linear(dim_in, 256), torch.nn.ReLU(), torch.nn.Dropout(0.2),
20 torch.nn.Linear(256, 64), torch.nn.ReLU(), torch.nn.Dropout(0.1),
21 torch.nn.Linear(64, 1))
22 def forward(self, x):
23 return self.net(x).squeeze(-1)
24
25head = FusionHead(cfg["text_dim"] + cfg["tabular_dim"])
26head.load_state_dict(torch.load(hf_hub_download(REPO, "fusion_head.pt"),
27 map_location="cpu", weights_only=True))
28head.eval()
29encoder = SentenceTransformer(cfg["encoder"])
30
31# `row` follows the cve-riskrank dataset schema
32row = {...}
33emb = encoder.encode([row["description"]], normalize_embeddings=True)
34tab = pre.transform(pd.DataFrame([row])).astype(np.float32)
35x = torch.from_numpy(np.hstack([emb, tab]).astype(np.float32))
36with torch.no_grad():
37 prob = float(cal.predict([torch.sigmoid(head(x)).item()])[0])
38print(f"exploitation priority: {prob:.1%}")
Designed for patch prioritization support in vulnerability management
workflows. KEV membership is a proxy label: it is curated, US-centric, and
lags disclosure, so recent CVEs carry conservative labels. Scores should
complement — not replace — asset-context-aware risk assessment.
CVE-RiskRank Space —
live NVD triage, agent advisories, ranking explorer, and evaluation dashboard.