[Paper Review] Predicting Gender by First Name Using Character-level Machine Learning
This paper proposes a character-level machine learning and deep learning approach to predict gender from Brazilian first names, using one-hot encoded characters as input. Recurrent models like BiLSTM achieve over 96% accuracy, outperforming feedforward and traditional machine learning models, demonstrating that sequence modeling is highly effective for name-based gender prediction.
Predicting gender by the first name is not a simple task. In many applications, especially in the natural language processing (NLP) field, this task may be necessary, mainly when considering foreign names. In this paper, we examined and implemented several machine learning algorithms, such as extra trees, KNN, Naive Bayes, SVM, random forest, gradient boosting, light GBM, logistic regression, ridge classifier, and deep neural network models, such as MLP, RNN, GRU, CNN, and BiLSTM, to classify gender through the first name. A dataset of Brazilian names is used to train and evaluate the models. We analyzed the accuracy, recall, precision, f1 score, and confusion matrix to measure the models' performances. The results indicate that the gender prediction can be performed from the feature extraction strategy looking at the names as a set of strings. Some models accurately predict gender in more than 95% of the cases. The recurrent models overcome the feedforward models in this binary classification problem.
Motivation & Objective
- To investigate the effectiveness of character-level machine learning and deep learning models in predicting gender from first names.
- To compare the performance of traditional machine learning algorithms (e.g., SVM, random forest) with deep neural networks (e.g., CNN, RNN, BiLSTM) in a binary gender classification task.
- To evaluate model performance using standard metrics such as accuracy, precision, recall, F1-score, and confusion matrices.
- To determine whether recurrent architectures outperform feedforward networks in capturing sequential patterns in names for gender prediction.
Proposed method
- Names were preprocessed using one-hot encoding to convert each character into a numerical vector representation.
- A total of 13 traditional machine learning models (e.g., Extra Trees, LightGBM, SVM, Logistic Regression) were trained and evaluated on the encoded name features.
- Five deep learning models—MLP, CNN, RNN, GRU, and BiLSTM—were implemented to learn hierarchical and sequential patterns from character-level inputs.
- Model training used early stopping to prevent overfitting, and dropout was applied during training to improve generalization.
- Performance was evaluated using 5-fold cross-validation, with metrics including accuracy, precision, recall, F1-score, and confusion matrices.
- Training and validation accuracy and loss were monitored over epochs to assess convergence and model stability.
Experimental results
Research questions
- RQ1Can character-level machine learning and deep learning models effectively predict gender from first names using only the name string?
- RQ2How do recurrent neural networks (RNN, GRU, BiLSTM) compare to feedforward networks (MLP, CNN) in gender prediction from names?
- RQ3Which traditional machine learning model performs best on character-encoded names for gender classification?
- RQ4Does the gender ratio imbalance in the dataset affect model performance, and how do models handle this?
- RQ5What is the optimal model architecture for maximizing accuracy and F1-score in this binary classification task?
Key findings
- The BiLSTM model achieved the highest accuracy of 96.96% on the dataset with only 100% gender ratio names, outperforming all other models.
- The BiLSTM model also achieved a precision of 0.9720 and F1-score of 0.9642 on the same dataset, indicating strong balance between precision and recall.
- Recurrent models (BiLSTM, GRU, RNN) consistently outperformed feedforward models (MLP, CNN) in both accuracy and F1-score across all evaluation settings.
- The Extra Trees and Random Forest classifiers showed strong performance among traditional models, with accuracy above 94%, but still underperformed the best deep learning models.
- The MLP model achieved only 86.98% accuracy on the full dataset, indicating limitations in capturing sequential dependencies in names.
- Confusion matrices revealed that BiLSTM and GRU models had the fewest misclassifications, particularly in correctly identifying male and female names.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.