Wright State University
Cluster-Aware Vulnerability Detection: A Systematic Evaluation Across Imbalance Ratios
Abstract
dc:descriptionSource code vulnerability detection faces class imbalance and the 512-token limit of transformer encoders. This study proposes HierCodeBERT, a hierarchical CodeBERT processing long code as overlapping 512-token chunks with norm-based attention pooling, paired with a cluster-aware framework partitioning vulnerable samples into KMeans em bedding clusters before resampling. Because the classifier consumes tokenized code rather than embeddings, oversampling duplicates real vulnerable samples, with SMOTE-style interpolation selecting which samples to duplicate; no synthetic vectors enter training, and all resampling stays within the fixed training partition, avoiding leakage from resampling. A 10-mode ablation evaluates five imbalance-handling strategies, with and without margin loss, across five ratios on three C/C++ datasets, ranked by composite score. Cluster-aware modes rank highest or joint-highest in 12 of 15 conditions (nine outright wins; three structural ties at 1:10,000): cluster-aware weighted sampling suits near-balanced data; cluster-aware oversampling suits higher native imbalance, with one exception.
Degree
thesis:*- Name thesis:degree_name
- Master of Science in Cyber Security (M.S.C.S.)
- Level thesis:degree_level
- masters
- Discipline thesis:degree_discipline
- Computer Engineering
- Grantor dc:publisher
- Wright State University
- Year dc:date
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Soni, Chirag Bhaveshkumar
- Advisor dc:contributor.advisor
-
- Zhang, Junjie
Subjects
dc:subject × 11Rights
dc:rights- Statement dc:rights
-
- unrestricted
- This thesis or dissertation is protected by copyright: all rights reserved. It may not be copied or redistributed beyond the terms of applicable copyright laws.
- Language dc:language
- English
Identifiers
dc:identifier.*- Repository record dc:identifier
- http://rave.ohiolink.edu/etdc/view?acc_num=wright1788273648511611