Integrating BERT fine-tuning and genetic algorithm for superior depression detection in social media - Aouragh, Abd Allah; Bahaj, Mohamed; Toufik, Fouad (International Journal of Electrical and Computer Engineering (IJECE), 2026)
Early detection of depression is crucial for minimizing its adverse effects on mental and physical health. Recent advancements in natural language processing facilitate the large-scale analysis of social media texts to identify depressive tendencies. Our study introduces a novel approach by integrating a genetic algorithm for hyperparameter tuning, optimizing the classification performance beyond conventional methods. We provide a comprehensive comparison of vectorization techniques, including term frequency-inverse document frequency (TF-IDF), Word2Vec, and a fine-tuned bidirectional encoder representation from transformers (BERT) model specifically adapted to our dataset. Using a dataset of 7,731 entries, we implemented standard pre-processing steps such as stop word removal and lemmatization before vectorizing the text. Five machine learning algorithms—decision tree, logistic regression, random forest, gradient boosting, and support vector machine—were evaluated, with hyperparameter tuning performed using a genetic algorithm. The highest accuracy (95.99%) and F1-score (95.91%) were achieved with the combination of fine-tuned BERT, support vector machine, and genetic algorithm optimization. This study demonstrates the advantages of integrating BERT fine-tuning with genetic optimization, outperforming traditional TF-IDF and Word2Vec approaches in depression detection.