YouTube Spam Comment Detection using Transfer Learning and Machine Learning algorithms

Md. Nahid Hasan, Md. Milon Islam, Raiyan Azim, Jahanur Biswas · 2025

YouTube is the most popular social media platform enriched with different kinds of content. Spam comments on YouTube can lead to misinformation about content and users fall into scams. This often creates dissatisfaction among the subscribers and leads to poor user experience. In our research, a YouTube comment will be classified as either spam or not using supervised machine learning classifications and transfer learning algorithms. Lemmatization, tokenization, and other text preprocessing techniques had been applied to be suitable for the algorithms. BERT, ROBERTA, and DistilBERT are the transfer learning algorithms, while Naive Bayes, Decision Tree, Support Vector Machine, and K-Nearest Neighbour are the classification algorithms introduced in our proposed study. Random Forest and XGBoost, both powerful ensemble algorithms, were used for better classification. Among these algorithms, The RoBERTa algorithm performed better and achieved the highest accuracy of 92.71%. Among the machine learning algorithms, SVM was able to get the best accuracy of 88.9% after hyperparameter tuning.

Read the paper · More papers on PaperTik