# Explainable Security Requirements Classification Through Transformer Models
## 2 Related Work
### Automatic Requirements Classification  
[PERSON] et al. [13] employed TensorFlow-guided learning and Word2 Vec-based representations for classifying requirements in software engineering documents. The study compares traditional Naive Bayes methods with convolutional neural networks (CNNs) using random and pre-trained Word2 Vec embeddings. The study aimed to evaluate the effectiveness of CNNs and the impact of Word2 Vec embeddings on classification accuracy. Naive Bayes classifiers were built using Scikit-Learn with word count and TF-IDF feature vectors for the baseline. The CNN models were implemented using TensorFlow, with specific configurations for embedding, convolutional, and pooling layers. The results showed that CNNs with Word2 Vec embeddings significantly outperformed the Naive Bayesbaseline regarding precision and recall. For the SecReq dataset, the best CNN configuration achieved an F1-score improvement of over 7% compared to the baseline. However, in this work, the Naive Bayes classifiers used as baselines already perform well on the chosen datasets. While the CNN classifiers with Word2 Vec embeddings showed improvements, the extent of these improvements might be less pronounced on different datasets or with other baseline methods. In addition, they do not compare CNNs with other advanced classifiers beyond Naive Bayes to determine relative performance across different methods. With 100 epochs, this work achieves a maximum F1-score value of 91.34%, while we, with only ten epochs, achieve a maximum F1-score value of 90%. We also conducted an exhaustive comparison of various machine learning models to thoroughly analyze their performance and identify the most effective ones for a given task. The paper [14] explores the challenges and solutions for identifying security requirements in software development using machine learning (ML) techniques. The study aims to evaluate various ML-based classification algorithms to automate the identification process using the SecReq dataset. The authors propose an empirical study to assess the performance of 22 supervised ML classification algorithms and two deep learning approaches, LSTM and CNN. The study focuses on fast pre-processing techniques, such as word encoding and word embedding, to simplify the classification process without relying on complex linguistic and semantic rules. Results indicate that the LSTM network achieved the highest accuracy (84%) among non-supervised algorithms, while Boosted Ensemble achieved the highest accuracy (80%) among supervised algorithms. The study also analyzes the trade-off between accuracy and training time, highlighting that some classifiers, such as KNN-based algorithms, offer a good balance. In contrast to this previous work, our approach demonstrated a notable improvement in accuracy, reaching a remarkable 90% on the same dataset. We also employed different techniques to handle the dataset imbalance. Combining these strategies improved the model's ability to generalize to unseen data and ultimately achieve a higher accuracy rate. The study [15] presents an approach for automatically classifying security requirements into predefined groups using Natural Language Processing (NLP) transformers. The research aims to develop an NLP model capable of achieving at least an 80% F1-score in classifying security requirements by security objectives. The primary models used in this study include BERT, XLNET, and DistilBERT, with evaluation metrics such as precision, recall, and F1-score. The authors performed a binary classification on the SecReq dataset using DistilBERT since it is an efficient model, showing promising results compared to other models. The study demonstrates that deep learning models like DistilBERT can effectively classify security requirements with reasonable accuracy. The study highlights significant challenges in classifying security requirements using NLP transformers due to class imbalance, which, in this study, we tried to overcome using augmentation techniques showing promising results.