Skip to content

Latest commit

 

History

History
85 lines (60 loc) · 1.95 KB

README.md

File metadata and controls

85 lines (60 loc) · 1.95 KB

GenderClassification

The aim of this project is to construct a Convolutional Neural Network (CNN) model that is capable of accurately distinguishing between male and female categories, given an image of a human.

Project Structure

├───App
│   ├───static
│   │   └───faces
│   ├───templates
├───Code
├───Model
└───Pic

Methodology

To prepare the images for classification, OpenCV (CV2) is utilized to crop faces from the images. The classification process is based on a simple CNN algorithm

FaceDetected

Pic

Data

Dataset on kaggle

  • Training :47009

Training

  • Validation: 11649

Validation

Note : This set is splited to : 2,336 for testing and 9,313 for validation

  • Samples:

Samples

Training

Augmentation

  • RandomFlip("horizontal")
  • RandomRotation(0.1)
  • RandomZoom(0.1)
  • RandomBrightness(factor=0.2)
  • RandomContrast(factor=0.2)

Callbacks

  • LearningRateScheduler
  • EarlyStopping (monitor='val_loss', patience=3)

Model Architecture

Model Architecture

Compilation Parameters

  • Adam : initial_lr = 0.0001, Drop = 0.1, Every 10 epochs
  • loss : Categorical Cross Entropy
  • metric : 'Accuracy'
  • epochs : 19

Training and Validation Matrices

Training and Validation Matrices

  • Tranining loss : 0.0904
  • Training Acc : 0.9680
  • Validation loss : 0.0802
  • Validation lAcc : 0.9695

results

  • Accuracy: 1.0
  • Precision: 1.0
  • Recall: 1.0
  • F1-score: 1.0
  • Confusion matrix:

Cm

Links:

Model File

Simple Flask Web App

Demo