Skip to content

Gender Classification using Support Vector Machine (SVM). A Machine Learning project analyzes facial features to predict gender with 96% accuracy using the RBF Kernel.

Notifications You must be signed in to change notification settings

samir-m0hamed/Gender_Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘« Gender Classification Using SVM

πŸ“Œ Overview

This project implements a Support Vector Machine (SVM) classifier to predict gender (Male/Female) based on facial physical characteristics. The model utilizes the RBF (Radial Basis Function) Kernel to handle non-linear relationships in the data, achieving high accuracy on both training and testing datasets.

πŸ“‚ Dataset Features

The dataset consists of 5001 samples with the following features:

  • long_hair: (0 or 1)
  • forehead_width_cm: Continuous value
  • forehead_height_cm: Continuous value
  • nose_wide: (0 or 1)
  • nose_long: (0 or 1)
  • lips_thin: (0 or 1)
  • distance_nose_to_lip_long: (0 or 1)
  • gender: Target variable (Male/Female)

πŸ› οΈ Technologies Used

  • Python: Core programming language.
  • Pandas: For data manipulation and analysis.
  • Plotly: For interactive Exploratory Data Analysis (EDA) and visualizations.
  • Scikit-Learn: For building the SVM model and evaluation metrics.

πŸ“Š Methodology

  1. Data Loading & Inspection: Checking for null values and understanding data distribution.
  2. EDA: Visualizing feature distributions using Plotly histograms differentiated by gender.
  3. Preprocessing: Encoding the categorical target (gender) into numerical values (Male: 1, Female: 0).
  4. Splitting: Dividing data into Training (80%) and Testing (20%) sets.
  5. Model Training: Training an SVC model with kernel='rbf'.
  6. Evaluation: Using Accuracy Score and Confusion Matrix.

πŸ“ˆ Results

The model demonstrated excellent performance with minimal overfitting:

Metric Score
Training Accuracy 97.00%
Testing Accuracy 96.30%

Confusion Matrix (Testing Set)

  • True Negatives (Female predicted correctly): 486
  • True Positives (Male predicted correctly): 478
  • False Positives: 16
  • False Negatives: 21

πŸš€ How to Run

  1. Clone the repository:
    git clone [https://github.com/samir-m0hamed/Gender-Classification-SVM.git](https://github.com/samir-m0hamed/Gender-Classification-SVM.git)
  2. Install dependencies:
    pip install pandas numpy scikit-learn plotly
  3. Run the Jupyter Notebook:
    jupyter notebook Gender_Classification.ipynb

🀝 Contributing

Contributions, issues, and feature requests are welcome!


πŸ‘€ Author

samir mohamed

About

Gender Classification using Support Vector Machine (SVM). A Machine Learning project analyzes facial features to predict gender with 96% accuracy using the RBF Kernel.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published