Jason-42195 commited on
Commit
31e8d58
·
verified ·
1 Parent(s): 05a7f8f

Update to DistilBERT (Branch1) + LOF (Branch2) production models, refresh model card

Browse files
.gitkeep ADDED
File without changes
README.md CHANGED
@@ -15,7 +15,7 @@ pipeline_tag: text-classification
15
  Trained model artifacts for a **3-branch** AI-based SQL Injection detection system, deployed at
16
  the Database Proxy layer:
17
 
18
- - **Branch 1** — supervised multi-class classifier (Normal + SQLi variants), per query.
19
  - **Branch 2** — anomaly detector trained on benign traffic only (generalises to unseen syntax).
20
  - **Branch 3** — Session Correlator: not a separately-trained model, re-uses Branch 1 + Branch 2 and correlates their signals over a session (the main contribution).
21
 
@@ -25,12 +25,13 @@ Training data: [Jason-42195/VNU-SQLi-Detection](https://huggingface.co/datasets/
25
 
26
  | Folder | Branch | Model | Headline metric |
27
  |---|---|---|---|
28
- | `branch1_v1/` | 1 | TF-IDF (char) + Logistic Regression | F1-macro **0.9907** (5 classes, leakage-free) |
29
- | `branch1_comparison/` | 1 | 4 candidate architectures (5-class) | see table below |
30
- | `branch1_no_*/` | 1 | Leave-one-class-out ablations (zero-day coverage) | F1 ~0.98 on remaining |
31
- | `branch2_v1/` | 2 | One-Class SVM (4 structural features) | avg-precision **0.982** |
32
- | `branch2_zeroday/` | 2 | One-Class SVM (zero-day coverage variant) | — |
33
- | `branch3_v2/` | 3 | Session Correlator (no weights — reuses `branch1_v1`/`branch2_v1`, 4 calibrated thresholds) | FPR=0.0, detection rate=1.0 on 3 session-attack classes, 280-session held-out test set |
 
34
 
35
  Download everything: `hf download Jason-42195/VNU-SQLi-Detection-Models --local-dir models/`
36
 
@@ -38,67 +39,73 @@ Download everything: `hf download Jason-42195/VNU-SQLi-Detection-Models --local-
38
 
39
  ## `branch1_v1/` — Branch 1 (supervised multiclass) — **production**
40
 
41
- TF-IDF (`char_wb`, 2–4 gram, 50k features) + Logistic Regression. Classifies a query into one of
42
- **5 classes**: `normal`, `union_based`, `error_based`, `boolean_blind`, `time_blind`.
43
 
44
- - **F1-macro: 0.9907** on the held-out test set (13,560 rows), **leakage-free split** (dataset
45
- deduplicated by `query_canonical` before the train/test split — see the audit note below).
46
- - p50 latency ~0.5 ms, size ~3.5 MB.
47
- - Files: `vectorizer.joblib` (TfidfVectorizer), `model.joblib` (LogisticRegression), `metadata.json`.
 
 
48
 
49
  ```python
50
- import joblib
51
- vectorizer = joblib.load("branch1_v1/vectorizer.joblib")
52
- clf = joblib.load("branch1_v1/model.joblib")
53
 
 
54
  X = vectorizer.transform(["1' OR '1'='1"])
55
  clf.predict(X) # -> array([3]) (3 = boolean_blind)
56
  ```
57
 
58
- ## `branch1_comparison/` — Branch 1 architecture comparison (5-class)
59
 
60
- Four candidates trained on the same 5-class data (`train/compare_branch1_architectures.py`).
61
- The neural heads are sized from the data (true 5-class, no dead `stacked` neuron). TF-IDF+LogReg
62
- was chosen for production on the latency/size trade-off — the F1 gap is negligible.
 
63
 
64
- Numbers are on the **leakage-free split** (deduped by `query_canonical` before splitting):
 
 
 
 
65
 
66
  | Candidate | F1-macro | p50 latency | Size |
67
  |---|---|---|---|
68
- | `candidate_tfidf_logreg` | 0.9907 | 0.5 ms | 3.5 MB |
69
- | `candidate_tfidf_lightgbm` | 0.9977 | 60.4 ms | 5.6 MB |
70
- | `candidate_distilbert` | 0.9957 | 2.8 ms (GPU) | 256 MB |
71
- | `candidate_cnn_sqltok` | 0.9906 | 0.3 ms | 0.11 MB (28.5K params) |
 
 
 
72
 
73
  Only the two neural candidates' weights are hosted here (`candidate_distilbert/`:
74
  `model.safetensors` + tokenizer/config; `candidate_cnn_sqltok/`: `model.pt` + `vocab.json`).
75
 
76
- ```python
77
- # DistilBERT candidate
78
- from transformers import AutoModelForSequenceClassification, AutoTokenizer
79
- tok = AutoTokenizer.from_pretrained("branch1_comparison/candidate_distilbert")
80
- model = AutoModelForSequenceClassification.from_pretrained("branch1_comparison/candidate_distilbert")
81
- # model.config.num_labels == 5
82
- ```
83
-
84
  The CNN candidate is a small TextCNN over a char-level SQL tokenizer; reconstruct it with the
85
- helper in `train/compare_branch1_architectures.py` (`_build_textcnn_class`, `_encode_texts`) and the
86
- saved `vocab.json` — see `train/notebooks/demo_detect.ipynb` for a runnable example.
87
 
88
  ## `branch1_no_*/` — leave-one-class-out ablations (zero-day coverage)
89
 
90
  Four Branch-1 models, each trained with **one attack class excluded**
91
  (`branch1_no_union_based`, `branch1_no_error_based`, `branch1_no_boolean_blind`,
92
  `branch1_no_time_blind`). Used to measure whether the anomaly branch / combined system still
93
- catches an attack family the supervised model was never trained on. Each scores F1-macro ~0.98 on
94
- its remaining classes. Same file layout as `branch1_v1/`; `metadata.json` records `excluded_label`.
 
 
95
 
96
- ## `branch2_v1/` — Branch 2 (anomaly detection)
 
 
 
97
 
98
- One-Class SVM trained on benign traffic only, using 4 structural features
99
- (`length`, `special_char_ratio`, `sql_keyword_count`, `entropy`) — not TF-IDF, so it can
100
- generalise to unseen attack syntax. Average precision ~0.982 (full PR curve / threshold sweep in
101
- the project repo's `report/metrics/`).
102
 
103
  ```python
104
  # From within the project repo (needs src.models.branch2_anomaly.AnomalyDetector):
@@ -106,26 +113,33 @@ from src.models.branch2_anomaly import AnomalyDetector
106
  import numpy as np
107
 
108
  detector = AnomalyDetector.load("branch2_v1")
109
- X = np.array([[40, 0.05, 1, 3.6]]) # [length, special_char_ratio, sql_keyword_count, entropy]
110
  detector.score(X) # continuous anomaly score
111
- detector.anomaly_flags(X) # boolean flag
112
  ```
113
 
114
  ## `branch2_zeroday/` — Branch 2 (zero-day coverage variant)
115
 
116
- One-Class SVM with the same config as `branch2_v1`, used in the zero-day coverage experiment
117
- (pairs with the `branch1_no_*` ablations). Same loader as `branch2_v1`.
118
 
119
  ## `branch3_v2/` — Branch 3 (Session Correlator)
120
 
121
  Not a trained model — no weights, just `metadata.json` holding 4 calibrated scalar thresholds
122
- (`content_threshold`, `per_query_threshold`, `mean_threshold`, `fraction_threshold`). At inference
123
- time it re-uses `branch1_v1`'s classifier (re-scores the session's concatenated query text) and
124
- `branch2_v1`'s anomaly detector (aggregates its per-query scores), OR'ing the two checks together.
125
- Classifies a **session** into 4 classes: `benign`, `boolean_blind`, `time_blind`,
126
  `query_splitting`. See the project repo's `src/models/branch3_session.py`
127
  (`SessionCorrelator`) for the scoring logic, and `report/plan/data_contract.md` §4.2 for why
128
- this replaced an earlier trained GRU design (`branch3_v1`, removed).
 
 
 
 
 
 
 
129
 
130
  ---
131
 
@@ -133,12 +147,15 @@ this replaced an earlier trained GRU design (`branch3_v1`, removed).
133
 
134
  - Branch 1's `boolean_blind` class has ~13% measured label noise (catch-all bucket for unmatched
135
  attack rows) — see `data_contract.md` in the project repo.
136
- - The uniformly high Branch-1 F1 (~0.99 across all 4 architectures) indicates the current dataset
137
- is easy to separate; it is **not** an adversarial/obfuscation benchmark. A `/blog/index.php/...`
138
- request format makes up ~17.6% of rows (content-format duplication), further limiting diversity.
139
- - Cross-split leakage (949 identical texts straddling train & test) was found and **fixed** on
140
- 20/8 by deduplicating `query_canonical` before the split; the numbers here are leakage-free.
141
  - No adversarial/obfuscation robustness testing yet.
 
 
 
 
142
  - License: mixed/unclear for the underlying training data (see the dataset repo's card) — treat as
143
  research / course-project artifacts, not cleared for unrestricted reuse.
144
 
 
15
  Trained model artifacts for a **3-branch** AI-based SQL Injection detection system, deployed at
16
  the Database Proxy layer:
17
 
18
+ - **Branch 1** — supervised multi-class classifier (Normal + 5 SQLi variants), per query.
19
  - **Branch 2** — anomaly detector trained on benign traffic only (generalises to unseen syntax).
20
  - **Branch 3** — Session Correlator: not a separately-trained model, re-uses Branch 1 + Branch 2 and correlates their signals over a session (the main contribution).
21
 
 
25
 
26
  | Folder | Branch | Model | Headline metric |
27
  |---|---|---|---|
28
+ | `branch1_v1/` | 1 | **DistilBERT** (fine-tuned, 6-class) | F1-macro **0.9699** |
29
+ | `branch1_v1_logreg_backup/` | 1 | TF-IDF (char) + Logistic Regression — former production champion, superseded | F1-macro 0.8977 |
30
+ | `branch1_comparison/` | 1 | 4 candidate architectures (6-class) | see table below |
31
+ | `branch1_no_*/` | 1 | Leave-one-class-out ablations (zero-day coverage) | F1 ~0.98–0.99 on remaining |
32
+ | `branch2_v1/` | 2 | **Local Outlier Factor** (12 structural/lexical features) | AUC **0.915**, detection 78.4% @ FPR 5.3% |
33
+ | `branch2_zeroday/` | 2 | Local Outlier Factor (zero-day coverage variant) | — |
34
+ | `branch3_v2/` | 3 | Session Correlator (no weights — reuses `branch1_v1`/`branch2_v1`, 4 calibrated thresholds) | FPR=0.0, detection rate 95.7–100% on 3 session-attack classes, 280-session held-out test set |
35
 
36
  Download everything: `hf download Jason-42195/VNU-SQLi-Detection-Models --local-dir models/`
37
 
 
39
 
40
  ## `branch1_v1/` — Branch 1 (supervised multiclass) — **production**
41
 
42
+ Fine-tuned `distilbert-base-uncased` (max_length 128, 3 epochs). Classifies a query into one of
43
+ **6 classes**: `normal`, `union_based`, `error_based`, `boolean_blind`, `time_blind`, `stacked`.
44
 
45
+ - **F1-macro: 0.9699** on the held-out test set (18,295 rows; 71,705 train rows).
46
+ - p50 latency ~2.8 ms (GPU), size ~256 MB.
47
+ - Chosen over the lighter TF-IDF+LogReg baseline (`branch1_v1_logreg_backup/`, F1-macro 0.8977)
48
+ because the gap concentrates in the two hardest classes: `stacked` (0.700 → 0.932) and
49
+ `time_blind` (0.812 → 0.973) — see `branch1_comparison/` below. Latency is still real-time.
50
+ - Files: `model.safetensors`, `tokenizer.json`, `tokenizer_config.json`, `config.json`, `metadata.json`.
51
 
52
  ```python
53
+ from src.models.branch1_loader import load_branch1_artifacts
 
 
54
 
55
+ vectorizer, clf = load_branch1_artifacts("branch1_v1") # auto-detects DistilBERT vs sklearn layout
56
  X = vectorizer.transform(["1' OR '1'='1"])
57
  clf.predict(X) # -> array([3]) (3 = boolean_blind)
58
  ```
59
 
60
+ ## `branch1_v1_logreg_backup/` — former production model (superseded)
61
 
62
+ TF-IDF (`char_wb`, 2–4 gram, 50k features) + Logistic Regression. Kept as a lightweight fallback
63
+ and as the baseline in the architecture comparison. F1-macro **0.8977** on the same 6-class split
64
+ — same loader (`load_branch1_artifacts`) works on this folder too (`vectorizer.joblib` +
65
+ `model.joblib` layout).
66
 
67
+ ## `branch1_comparison/` — Branch 1 architecture comparison (6-class)
68
+
69
+ Four candidates trained on the same 6-class data, including `stacked`
70
+ (`train/compare_branch1_architectures.py`). DistilBERT was chosen for production: the F1 gap over
71
+ TF-IDF+LogReg concentrates in `stacked`/`time_blind`, and latency/size are still acceptable.
72
 
73
  | Candidate | F1-macro | p50 latency | Size |
74
  |---|---|---|---|
75
+ | `candidate_tfidf_logreg` | 0.8977 | 0.5 ms | 0.4 MB |
76
+ | `candidate_tfidf_lightgbm` | 0.9624 | 3.0 ms | 4.7 MB |
77
+ | `candidate_distilbert` | 0.9648 | 2.8 ms (GPU) | 256 MB |
78
+ | `candidate_cnn_sqltok` | 0.7490 | 0.3 ms | 0.15 MB |
79
+
80
+ (Deployed `branch1_v1/` scores slightly higher, 0.9699, because it was retrained afterwards on a
81
+ larger train split — see `metadata.json` in each folder for exact row counts.)
82
 
83
  Only the two neural candidates' weights are hosted here (`candidate_distilbert/`:
84
  `model.safetensors` + tokenizer/config; `candidate_cnn_sqltok/`: `model.pt` + `vocab.json`).
85
 
 
 
 
 
 
 
 
 
86
  The CNN candidate is a small TextCNN over a char-level SQL tokenizer; reconstruct it with the
87
+ helper in `train/compare_branch1_architectures.py` (`_build_textcnn_class`, `_encode_texts`) and
88
+ the saved `vocab.json`.
89
 
90
  ## `branch1_no_*/` — leave-one-class-out ablations (zero-day coverage)
91
 
92
  Four Branch-1 models, each trained with **one attack class excluded**
93
  (`branch1_no_union_based`, `branch1_no_error_based`, `branch1_no_boolean_blind`,
94
  `branch1_no_time_blind`). Used to measure whether the anomaly branch / combined system still
95
+ catches an attack family the supervised model was never trained on. Each scores F1-macro
96
+ ~0.98–0.99 on its remaining classes. `metadata.json` records `excluded_label`.
97
+
98
+ ## `branch2_v1/` — Branch 2 (anomaly detection) — **production**
99
 
100
+ **Local Outlier Factor** (`n_neighbors=5`, `contamination=0.05`) trained on benign traffic only,
101
+ using 12 structural/lexical features (length, special-char ratio, SQL keyword count, entropy,
102
+ bigram entropy, quote/paren imbalance, token-length/run stats) — not TF-IDF, so it generalises to
103
+ unseen attack syntax.
104
 
105
+ - **AUC 0.915**, detection rate **78.4%** at FPR 5.3% (full PR curve / threshold sweep in the
106
+ project repo's `report/metrics/`).
107
+ - Chosen over Isolation Forest (AUC 0.903) and One-Class SVM (AUC 0.579, which misclassified
108
+ benign traffic from sources unlike its training distribution as anomalous).
109
 
110
  ```python
111
  # From within the project repo (needs src.models.branch2_anomaly.AnomalyDetector):
 
113
  import numpy as np
114
 
115
  detector = AnomalyDetector.load("branch2_v1")
116
+ X = np.array([[40, 0.05, 1, 3.6, 0, 0, 0, 5, 8, 0, 0, 0]]) # 12 features, see feature_names in metadata.json
117
  detector.score(X) # continuous anomaly score
118
+ detector.predict(X) # boolean/label flag
119
  ```
120
 
121
  ## `branch2_zeroday/` — Branch 2 (zero-day coverage variant)
122
 
123
+ Local Outlier Factor with the same config as `branch2_v1`, used in the zero-day coverage
124
+ experiment (pairs with the `branch1_no_*` ablations). Same loader as `branch2_v1`.
125
 
126
  ## `branch3_v2/` — Branch 3 (Session Correlator)
127
 
128
  Not a trained model — no weights, just `metadata.json` holding 4 calibrated scalar thresholds
129
+ (`content_threshold`, `per_query_threshold`, `median_threshold`, `fraction_threshold`). At
130
+ inference time it re-uses `branch1_v1`'s classifier (re-scores the session's concatenated query
131
+ text) and `branch2_v1`'s anomaly detector (aggregates its per-query scores), OR'ing the two checks
132
+ together. Classifies a **session** into 4 classes: `benign`, `boolean_blind`, `time_blind`,
133
  `query_splitting`. See the project repo's `src/models/branch3_session.py`
134
  (`SessionCorrelator`) for the scoring logic, and `report/plan/data_contract.md` §4.2 for why
135
+ this replaced an earlier trained GRU design (`branch3_v1`, removed) — a diagnostic found the GRU's
136
+ dense projection collapsed a clear bisection signal (cosine similarity 0.961 between consecutive
137
+ steps) into near-identical post-classifier probabilities.
138
+
139
+ Content-check alone and the combined check both reach FPR=0.0 with detection 95.7–100% across the
140
+ 3 session-attack classes on 280 held-out sessions; the behavior-check alone misses `time_blind`
141
+ entirely (0% — the content check is what carries that class), which is why the two are OR'd rather
142
+ than used separately.
143
 
144
  ---
145
 
 
147
 
148
  - Branch 1's `boolean_blind` class has ~13% measured label noise (catch-all bucket for unmatched
149
  attack rows) — see `data_contract.md` in the project repo.
150
+ - The architecture-comparison numbers are on a harder 6-class split (adds `stacked`, previously a
151
+ dead neuron in older 5-class experiments) — don't compare them to earlier 5-class READMEs.
152
+ - Cross-split leakage (949 identical texts straddling train & test) was found and **fixed** by
153
+ deduplicating `query_canonical` before the split; the numbers here are leakage-free.
 
154
  - No adversarial/obfuscation robustness testing yet.
155
+ - Branch 3's session data is self-generated (bisection algorithm against a self-hosted demo DB),
156
+ not independently-captured attacker traffic — near-perfect detection reflects both branches
157
+ scoring data from the same generation process they were built around, not generalization to
158
+ novel evasive traffic.
159
  - License: mixed/unclear for the underlying training data (see the dataset repo's card) — treat as
160
  research / course-project artifacts, not cleared for unrestricted reuse.
161
 
branch1_comparison/candidate_cnn_sqltok/model.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:458313adfdebbf3d0ad103cdbb0ab1233271d50177283bd7f7aa799aaa4b6196
3
- size 117227
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb3d733d449ccc99c64accb70f324f25da3bbe4666d84fed7698fc5af1c6909d
3
+ size 150763
branch1_comparison/candidate_cnn_sqltok/vocab.json CHANGED
@@ -1 +1 @@
1
- {"<PAD>": 0, "<UNK>": 1, "e": 2, "l": 3, " ": 4, "n": 5, "/": 6, "u": 7, "o": 8, "a": 9, "t": 10, "s": 11, "i": 12, "-": 13, "r": 14, "c": 15, "d": 16, "p": 17, "0": 18, ",": 19, "2": 20, ")": 21, "(": 22, "m": 23, "b": 24, "'": 25, "g": 26, ".": 27, "h": 28, "1": 29, "3": 30, "f": 31, "x": 32, "5": 33, "=": 34, "4": 35, "7": 36, "w": 37, "9": 38, "q": 39, "8": 40, "6": 41, ":": 42, "y": 43, "\"": 44, "v": 45, "_": 46, "j": 47, "&": 48, "*": 49, "z": 50, "k": 51, "%": 52, "?": 53, "#": 54, "{": 55, "\\": 56, ";": 57, "|": 58, "}": 59, ">": 60, "@": 61, "$": 62, "]": 63, "`": 64, "!": 65, "<": 66, "[": 67, "\u00f1": 68, "~": 69, "\u26fd": 70, "\u150d": 71, "\u154b": 72, "\ufffd": 73, "\u00ff": 74, "\u0e76": 75, "\u1394": 76, "\u05a1": 77, "\ud2b8": 78, "\ub9ac": 79, "\uac70": 80, "\u00fc": 81, "\u00e8": 82, "\u0951": 83, "\u21c0": 84}
 
1
+ {"<PAD>": 0, "<UNK>": 1, "l": 2, ",": 3, " ": 4, "n": 5, "e": 6, "u": 7, "t": 8, "a": 9, "i": 10, "5": 11, "r": 12, "9": 13, "o": 14, "s": 15, "c": 16, "d": 17, ")": 18, "(": 19, "/": 20, "p": 21, "\"": 22, "m": 23, "0": 24, "'": 25, "-": 26, "f": 27, "1": 28, "h": 29, "2": 30, "g": 31, "_": 32, ".": 33, "b": 34, "4": 35, "3": 36, "w": 37, "y": 38, "q": 39, "*": 40, "=": 41, "7": 42, "6": 43, "8": 44, "v": 45, "x": 46, "k": 47, "j": 48, "z": 49, ";": 50, ":": 51, "#": 52, "%": 53, "&": 54, ">": 55, "|": 56, "\ufffd": 57, "?": 58, "`": 59, "~": 60, "{": 61, "\\": 62, "}": 63, "!": 64, "\u0440": 65, "\u0627": 66, "\u043e": 67, "\u043f": 68, "@": 69, "\u0442": 70, "]": 71, "\u0631": 72, "\u00e9": 73, "\u0645": 74, "$": 75, "\u0430": 76, "<": 77, "\u062a": 78, "\u00e4": 79, "\u064a": 80, "\u043a": 81, "\u0438": 82, "[": 83, "\u043c": 84, "\u0441": 85, "\u0443": 86, "\u044d": 87, "\u0637": 88, "\u044f": 89, "\u010d": 90, "\u0433": 91, "\u0646": 92, "\u00e2": 93, "\u0644": 94, "\u00e1": 95, "\u0648": 96, "\u0928": 97, "\u093e": 98, "\u0932": 99, "\u00ed": 100, "\u017e": 101, "\u00f3": 102, "\u00e3": 103, "\u0629": 104, "\u00e7": 105, "\u0947": 106, "\u092a": 107, "\u0935": 108, "\u093f": 109, "\u092e": 110, "\u0938": 111, "\u094d": 112, "\u0925": 113, "\u0915": 114, "\u094b": 115, "\u0435": 116, "\u0628": 117, "\u0641": 118, "\u00f1": 119, "\u043b": 120, "\u0161": 121, "\u043d": 122, "\u017c": 123, "\u062d": 124, "\u00f6": 125, "\u015f": 126, "\u00f4": 127, "\u0635": 128, "\u0633": 129, "\u00fc": 130, "\u0434": 131, "\u0121": 132, "\u0432": 133, "\u063a": 134, "\u0439": 135, "\u03b1": 136, "\u062f": 137, "\u0621": 138, "\u0105": 139, "\u0639": 140, "\u0127": 141, "\u044b": 142, "\u03b5": 143, "\u00eb": 144, "\u673a": 145, "\u573a": 146, "\u0151": 147, "\u4e2d": 148, "\u56fd": 149, "\u7684": 150, "\u03c1": 151, "\u00e8": 152, "\u062c": 153, "\u0623": 154, "\u0431": 155, "\u044c": 156, "\ud55c": 157, "\uad6d": 158, "\uc758": 159, "\uacf5": 160, "\ud56d": 161, "\u00ef": 162, "\u03b9": 163, "\u00f8": 164, "\u03b4": 165, "\u0131": 166, "\u03bf": 167, "\u00fa": 168, "\u011b": 169, "\u03bb": 170, "\u0457": 171, "\u03bd": 172, "\u17d2": 173, "\u0437": 174, "\u17c6": 175, "\u0101": 176, "\u0119": 177, "\u03c4": 178, "\u0638": 179, "\u0142": 180, "\u0632": 181, "\u015b": 182, "\u00ea": 183, "\u049b": 184, "\u00e5": 185, "\u0634": 186, "\u200e": 187, "\u6e2f": 188, "\u03bc": 189, "\u0642": 190, "\u0451": 191, "\u0643": 192, "\u03ac": 193, "\u06a9": 194, "\u0103": 195, "\u65e5": 196, "\u672c": 197, "\u306e": 198, "\u7a7a": 199, "\u17c1": 200, "\u2013": 201, "\u1796": 202, "\u03c3": 203, "\u05e9": 204, "\u03ba": 205, "\u0445": 206, "\u00f0": 207, "\u178f": 208, "\u0449": 209, "\u0111": 210, "\u03cc": 211, "\u03b7": 212, "\u1394": 213, "\u06cc": 214, "\u0626": 215, "\u1793": 216, "\u009e": 217, "\u03af": 218, "\u0446": 219, "\u00ee": 220, "\u1784": 221, "\u1797": 222, "\u1789": 223, "\u0219": 224, "\u05d5": 225, "\u05ea": 226, "\u05d4": 227, "\u05dc": 228, "\u26fd": 229, "\u150d": 230, "\u1798": 231, "\u179a": 232, "\u1780": 233, "\u0117": 234, "\u0447": 235, "\u00e0": 236, "\u0307": 237, "\u067e": 238, "\u06d2": 239, "\u06c1": 240, "\u0688": 241, "\u06ba": 242, "\u00fd": 243, "\u03ae": 244, "\u03c0": 245, "\u0448": 246, "\u0647": 247, "\u1794": 248, "\u05a1": 249, "\u0148": 250, "\u03c5": 251, "\u012b": 252, "\u03c2": 253, "\u0e76": 254, "\u17cb": 255, "\u1785": 256, "\u00f5": 257, "\u00b0": 258, "\u10d8": 259, "\u0436": 260, "\u03c6": 261, "\u03ad": 262, "\u011f": 263, "\u154b": 264, "\u02bc": 265, "\u0144": 266, "\u05d3": 267, "\u05e2": 268, "\u05e4": 269, "\u05d9": 270, "\u05e8": 271, "\u05d0": 272, "\u17bc": 273, "\u1783": 274, "\u17bb": 275, "\u17b6": 276, "\u91ab": 277, "\u0159": 278, "\u00df": 279, "\u03b3": 280, "\u17c7": 281, "\u1781": 282, "\u1792": 283, "\u0625": 284, "\u06af": 285, "\u1ee7": 286, "\u1ec7": 287, "\u02bb": 288, "\u012f": 289, "\u179f": 290, "\u17c0": 291, "\u0630": 292, "\u1e6d": 293, "\u0301": 294, "\u1782": 295, "\u17b7": 296, "\u17b8": 297, "\u0951": 298, "\u1ea3": 299, "\u1ed3": 300, "\u0165": 301, "\u0163": 302, "\u570b": 303, "\u79d1": 304, "\u5927": 305, "\u5b78": 306, "\u9644": 307, "\u5c6c": 308, "\u9662": 309, "\u76f4": 310, "\u5347": 311, "\u6a5f": 312, "\u5834": 313, "\u014f": 314, "\u0107": 315, "\u10d7": 316, "\u10d1": 317, "\u10da": 318, "\u10e1": 319, "\u00e6": 320, "\u2019": 321, "\u4fe1": 322, "\u9633": 323, "\u660e": 324, "\u0444": 325, "\u044e": 326, "\u0113": 327, "\u00ec": 328, "^": 329, "\u5317": 330, "\u4eac": 331, "\u5357": 332, "\u90ca": 333, "\u014d": 334, "\u2710": 335, "\u0577": 336, "\u056b": 337, "\u0580": 338, "\u0561": 339, "\u056f": 340}
branch1_comparison/candidate_distilbert/config.json CHANGED
@@ -15,7 +15,8 @@
15
  "1": "LABEL_1",
16
  "2": "LABEL_2",
17
  "3": "LABEL_3",
18
- "4": "LABEL_4"
 
19
  },
20
  "initializer_range": 0.02,
21
  "label2id": {
@@ -23,7 +24,8 @@
23
  "LABEL_1": 1,
24
  "LABEL_2": 2,
25
  "LABEL_3": 3,
26
- "LABEL_4": 4
 
27
  },
28
  "max_position_embeddings": 512,
29
  "model_type": "distilbert",
 
15
  "1": "LABEL_1",
16
  "2": "LABEL_2",
17
  "3": "LABEL_3",
18
+ "4": "LABEL_4",
19
+ "5": "LABEL_5"
20
  },
21
  "initializer_range": 0.02,
22
  "label2id": {
 
24
  "LABEL_1": 1,
25
  "LABEL_2": 2,
26
  "LABEL_3": 3,
27
+ "LABEL_4": 4,
28
+ "LABEL_5": 5
29
  },
30
  "max_position_embeddings": 512,
31
  "model_type": "distilbert",
branch1_comparison/candidate_distilbert/model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:398dff85977ff638bfef20fed5274e8b011cfa735037cc4df6600e1caa3bef38
3
- size 267841796
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4bd5ed32a425d4323e0b984310f8cbcbce9eb2e764d4d0e1440bc34edf1791c
3
+ size 267844872
branch1_comparison/candidate_tfidf_lightgbm/model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c1c9e076e7c82674a15dc77beef3c38f08f0e739cc6821cb26901ad85d70879
3
+ size 4512948
branch1_comparison/candidate_tfidf_lightgbm/vectorizer.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccb1073e6e06eeb9665efd87f407a20c6ebbd9bc800e28f3069b4c439c9b30df
3
+ size 164472
branch1_comparison/candidate_tfidf_logreg/model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9683a0937d315540a8f249d58f2add3c2da3846c3a638aaa26eefacda16a872
3
+ size 242727
branch1_comparison/candidate_tfidf_logreg/vectorizer.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccb1073e6e06eeb9665efd87f407a20c6ebbd9bc800e28f3069b4c439c9b30df
3
+ size 164472
branch1_no_boolean_blind/metadata.json CHANGED
@@ -2,6 +2,5 @@
2
  "excluded_label": 3,
3
  "excluded_label_name": "boolean_blind",
4
  "f1_macro_on_remaining": 0.998,
5
- "trained_at": "2026-08-20T07:06:58",
6
- "split": "leakage-free (deduped branch1_train.csv, 20/8)"
7
  }
 
2
  "excluded_label": 3,
3
  "excluded_label_name": "boolean_blind",
4
  "f1_macro_on_remaining": 0.998,
5
+ "trained_at": "2026-08-22T17:03:05"
 
6
  }
branch1_no_error_based/metadata.json CHANGED
@@ -2,6 +2,5 @@
2
  "excluded_label": 2,
3
  "excluded_label_name": "error_based",
4
  "f1_macro_on_remaining": 0.989,
5
- "trained_at": "2026-08-20T07:06:45",
6
- "split": "leakage-free (deduped branch1_train.csv, 20/8)"
7
  }
 
2
  "excluded_label": 2,
3
  "excluded_label_name": "error_based",
4
  "f1_macro_on_remaining": 0.989,
5
+ "trained_at": "2026-08-22T17:02:56"
 
6
  }
branch1_no_time_blind/metadata.json CHANGED
@@ -2,6 +2,5 @@
2
  "excluded_label": 4,
3
  "excluded_label_name": "time_blind",
4
  "f1_macro_on_remaining": 0.9883,
5
- "trained_at": "2026-08-20T07:07:15",
6
- "split": "leakage-free (deduped branch1_train.csv, 20/8)"
7
  }
 
2
  "excluded_label": 4,
3
  "excluded_label_name": "time_blind",
4
  "f1_macro_on_remaining": 0.9883,
5
+ "trained_at": "2026-08-22T17:03:19"
 
6
  }
branch1_no_union_based/metadata.json CHANGED
@@ -2,6 +2,5 @@
2
  "excluded_label": 1,
3
  "excluded_label_name": "union_based",
4
  "f1_macro_on_remaining": 0.9901,
5
- "trained_at": "2026-08-20T07:06:26",
6
- "split": "leakage-free (deduped branch1_train.csv, 20/8)"
7
  }
 
2
  "excluded_label": 1,
3
  "excluded_label_name": "union_based",
4
  "f1_macro_on_remaining": 0.9901,
5
+ "trained_at": "2026-08-22T17:02:43"
 
6
  }
branch1_v1/config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation": "gelu",
3
+ "architectures": [
4
+ "DistilBertForSequenceClassification"
5
+ ],
6
+ "attention_dropout": 0.1,
7
+ "bos_token_id": null,
8
+ "dim": 768,
9
+ "dropout": 0.1,
10
+ "dtype": "float32",
11
+ "eos_token_id": null,
12
+ "hidden_dim": 3072,
13
+ "id2label": {
14
+ "0": "LABEL_0",
15
+ "1": "LABEL_1",
16
+ "2": "LABEL_2",
17
+ "3": "LABEL_3",
18
+ "4": "LABEL_4",
19
+ "5": "LABEL_5"
20
+ },
21
+ "initializer_range": 0.02,
22
+ "label2id": {
23
+ "LABEL_0": 0,
24
+ "LABEL_1": 1,
25
+ "LABEL_2": 2,
26
+ "LABEL_3": 3,
27
+ "LABEL_4": 4,
28
+ "LABEL_5": 5
29
+ },
30
+ "max_position_embeddings": 512,
31
+ "model_type": "distilbert",
32
+ "n_heads": 12,
33
+ "n_layers": 6,
34
+ "pad_token_id": 0,
35
+ "problem_type": "single_label_classification",
36
+ "qa_dropout": 0.1,
37
+ "seq_classif_dropout": 0.2,
38
+ "sinusoidal_pos_embds": false,
39
+ "tie_weights_": true,
40
+ "tie_word_embeddings": true,
41
+ "transformers_version": "5.13.1",
42
+ "vocab_size": 30522
43
+ }
branch1_v1/metadata.json CHANGED
@@ -1,24 +1,27 @@
1
  {
2
  "version": "branch1_v1",
3
  "branch": "branch1_supervised_multiclass",
4
- "architecture": "tfidf_logreg",
5
- "trained_at": "2026-08-20T01:02:50",
6
- "train_rows": 54236,
7
- "test_rows": 13560,
8
- "f1_macro": 0.9906716828805351,
9
- "train_time_s": 14.267253901998629,
10
  "labels": {
11
  "0": "normal",
12
  "1": "union_based",
13
  "2": "error_based",
14
  "3": "boolean_blind",
15
- "4": "time_blind"
 
16
  },
17
  "dataset": "data/processed/branch1_train.csv",
18
- "tfidf": {
19
- "analyzer": "char_wb",
20
- "ngram_min": 2,
21
- "ngram_max": 4,
22
- "max_features": 50000
23
- }
 
 
24
  }
 
1
  {
2
  "version": "branch1_v1",
3
  "branch": "branch1_supervised_multiclass",
4
+ "architecture": "distilbert",
5
+ "trained_at": "2026-08-28T13:13:57",
6
+ "train_rows": 71705,
7
+ "test_rows": 18295,
8
+ "f1_macro": 0.9698705289802508,
9
+ "train_time_s": 2067.231512582999,
10
  "labels": {
11
  "0": "normal",
12
  "1": "union_based",
13
  "2": "error_based",
14
  "3": "boolean_blind",
15
+ "4": "time_blind",
16
+ "5": "stacked"
17
  },
18
  "dataset": "data/processed/branch1_train.csv",
19
+ "distilbert": {
20
+ "pretrained": "distilbert-base-uncased",
21
+ "max_length": 128,
22
+ "batch_size": 32,
23
+ "epochs": 3,
24
+ "learning_rate": 5e-05
25
+ },
26
+ "model_size_bytes": 268557782
27
  }
branch1_v1/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0da1a514800ec908c5d90844213d0877a39c046d90d592e18755ee00240d591
3
+ size 267844872
branch1_v1/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
branch1_v1/tokenizer_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_lower_case": true,
5
+ "is_local": false,
6
+ "local_files_only": false,
7
+ "mask_token": "[MASK]",
8
+ "model_max_length": 512,
9
+ "pad_token": "[PAD]",
10
+ "sep_token": "[SEP]",
11
+ "strip_accents": null,
12
+ "tokenize_chinese_chars": true,
13
+ "tokenizer_class": "BertTokenizer",
14
+ "unk_token": "[UNK]"
15
+ }
branch1_v1_logreg_backup/metadata.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "branch1_v1",
3
+ "branch": "branch1_supervised_multiclass",
4
+ "architecture": "tfidf_logreg",
5
+ "trained_at": "2026-08-27T16:04:05",
6
+ "train_rows": 71705,
7
+ "test_rows": 18295,
8
+ "f1_macro": 0.8976786190129755,
9
+ "train_time_s": 29.315624694998405,
10
+ "labels": {
11
+ "0": "normal",
12
+ "1": "union_based",
13
+ "2": "error_based",
14
+ "3": "boolean_blind",
15
+ "4": "time_blind",
16
+ "5": "stacked"
17
+ },
18
+ "dataset": "data/processed/branch1_train.csv",
19
+ "tfidf": {
20
+ "analyzer": "char_wb",
21
+ "ngram_min": 1,
22
+ "ngram_max": 2,
23
+ "max_features": 50000,
24
+ "C": 10.0
25
+ }
26
+ }
branch1_v1_logreg_backup/model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ffdff7a5bed45b2a94a5ead694ec0fa050b43e79c9272bd3ee67842686b76cb8
3
+ size 242727
branch1_v1_logreg_backup/vectorizer.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccb1073e6e06eeb9665efd87f407a20c6ebbd9bc800e28f3069b4c439c9b30df
3
+ size 164472
branch2_v1/model.joblib CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:aa7be59101b5064d39f7b1b5beeb9319b654441fd8f20a97e0a8d1029c51c579
3
- size 7545486
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92c4c393881a434aa5a10c887aca737029f217f0bdbadd632236474d34681678
3
+ size 15134350
branch2_v1/scaler.joblib CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:08feb5555f0891a4f2c1f56f4721f6c923747bce3c4fbe79543493494e0adcac
3
  size 871
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3573605ab5ed039d63a23fa579a188bd49e871e248a8166ed1d1644fafdc153c
3
  size 871
branch2_zeroday/metadata.json CHANGED
@@ -1,15 +1,28 @@
1
  {
2
- "algorithm": "one_class_svm",
3
- "contamination": 0.005,
 
 
4
  "random_seed": 42,
5
- "scale_features": false,
6
  "log_transform_features": [
7
- "length"
 
 
 
8
  ],
9
  "feature_names": [
10
  "length",
11
  "special_char_ratio",
12
  "sql_keyword_count",
13
- "entropy"
 
 
 
 
 
 
 
 
14
  ]
15
  }
 
1
  {
2
+ "algorithm": "local_outlier_factor",
3
+ "contamination": 0.05,
4
+ "gamma": null,
5
+ "n_neighbors": 5,
6
  "random_seed": 42,
7
+ "scale_features": true,
8
  "log_transform_features": [
9
+ "length",
10
+ "max_token_length",
11
+ "max_special_run",
12
+ "max_digit_run"
13
  ],
14
  "feature_names": [
15
  "length",
16
  "special_char_ratio",
17
  "sql_keyword_count",
18
+ "entropy",
19
+ "bigram_entropy",
20
+ "quote_imbalance",
21
+ "same_type_run_ratio",
22
+ "max_token_length",
23
+ "token_count",
24
+ "max_special_run",
25
+ "max_digit_run",
26
+ "paren_imbalance"
27
  ]
28
  }
branch2_zeroday/model.joblib CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c641ee9a009000ac22bfa4ef0d2216a3d414894589d9a40895236cf87ed3fa14
3
- size 4719
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09dd852aaa4be05d9ba380f3a0ff963500b16cc4436e42a96b732dc761fa9196
3
+ size 7545486
branch2_zeroday/scaler.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08feb5555f0891a4f2c1f56f4721f6c923747bce3c4fbe79543493494e0adcac
3
+ size 871
branch3_v2/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "mechanism": "session_correlator",
3
+ "content_threshold": 0.9993392772157677,
4
+ "per_query_threshold": 5.939099,
5
+ "median_threshold": 6.4248535,
6
+ "fraction_threshold": 0.125,
7
+ "max_decode_iterations": 3
8
+ }