DOI: 10.1515/jisys-2024-0496 ISSN: 2191-026X

Advancing content-based analysis for automatic hate speech classification on social media

Korakoch Mounggam, Kittipol Wisaeng

Abstract

Hate speech on social media has become a significant challenge, contributing to discrimination, social division, and online violence. Existing automated detection approaches often suffer from three major limitations: severe class imbalance, inadequate feature representation, and poor generalization across diverse contexts. To address these issues, this study proposes an optimized deep learning framework for automatic hate speech classification. The proposed approach integrates Term Frequency–Inverse Document Frequency (TF-IDF) for feature extraction, the Synthetic Minority Over-sampling Technique (SMOTE) for handling class imbalance, and systematic hyperparameter optimization to improve model performance. A multi-layer perceptron (MLP) architecture with two hidden layers ([64, 128]) and Rectified Linear Unit (ReLU) activation is employed, while different data split ratios and training epochs are evaluated to identify optimal configurations. Experiments are conducted on three benchmark datasets comprising approximately 60,000 records from social media platforms. The results demonstrate that the optimal configuration achieves 96.04 % accuracy, 96.48 % recall, 99.09 % precision, and 97.77 % F1-score, outperforming traditional machine learning models, including Naïve Bayes (NB), K-Nearest Neighbors (K-NN), Support Vector Machine (SVM), and Random Forest (RF), by up to 8.66 %. The findings indicate that the proposed framework effectively improves classification performance and generalization across datasets, while maintaining computational efficiency. This study provides a practical and scalable solution for automated hate speech detection in real-world social media environments.