
Research Article
A Comparative Study on Source Code Attribution Using AI: Datasets, Features, and Techniques
@INPROCEEDINGS{10.1007/978-3-031-94445-1_18, author={Shamma Alalawi and Saed Alrabaee and Wasif Khan and Issam Al-Azzoni and Medha Mohan Ambali Parambil}, title={A Comparative Study on Source Code Attribution Using AI: Datasets, Features, and Techniques}, proceedings={Security and Privacy in Communication Networks. 20th EAI International Conference, SecureComm 2024, Dubai, United Arab Emirates, October 28--30, 2024, Proceedings, Part I}, proceedings_a={SECURECOMM}, year={2026}, month={9}, keywords={Software Forensics Code Authorship Attribution Machine Learning Deep Learning ChatGPT-generated Code}, doi={10.1007/978-3-031-94445-1_18} }- Shamma Alalawi
Saed Alrabaee
Wasif Khan
Issam Al-Azzoni
Medha Mohan Ambali Parambil
Year: 2026
A Comparative Study on Source Code Attribution Using AI: Datasets, Features, and Techniques
SECURECOMM
Springer
DOI: 10.1007/978-3-031-94445-1_18
Abstract
In recent years, the application of artificial intelligence (AI) techniques for source code authorship attribution has gained significant attention from academia and industry. Accurately attributing source code to its original author is crucial for various purposes, such as intellectual property protection, cybersecurity, and software forensics. Advances in AI technologies, like ChatGPT, which can generate code, present new challenges and opportunities in distinguishing between human- and machine-generated code. This article aims to comprehensively review existing research on source code authorship attribution and present a series of experiments using a dataset of 600 source codes. The study involves extracting lexical and layout features, ranking methods, and employing several machine learning models (SVM, LR, MLP, XGBoost, and RF) and deep learning models (LSTM, RNN, and CNN). The objectives include identifying the best model to determine whether source codes were written by a human or ChatGPT-4 and providing insights into two human characteristics: gender and region. Our results show that we achieved up to 94.7% accuracy with RF using TF-IDF and 95% accuracy with the CNN model. Finally, we identify emerging trends and potential future research directions in AI for authorship attribution.

