Question: Objective The goal of this assignment is to train machine learning models to predict the age and gender of individuals from facial images using the
Objective
The goal of this assignment is to train machine learning models to predict the age and gender of individuals from facial images using the UTKFace dataset. Students will practice data preprocessing, model training, evaluation, and interpretation of results. Additionally, students will compare the performance of Convolutional Neural Networks CNNs with Transformers for these tasks.
Dataset
The UTKFace dataset contains over face images with annotations of age and gender. Each image file is named in the format agegenderethnicitydate.jpg
Age:
Gender: male or female
Tasks
Data Preprocessing
Download the UTKFace dataset from UTKFace DatasetLinks to an external site..
Load the images and corresponding labels age gender into a data structure suitable for training machine learning models.
Split the dataset into training, validation, and test sets eg training, validation, test
Exploratory Data Analysis EDA
Perform EDA to understand the distribution of age and gender in the dataset.
Visualize some example images from each class.
Discuss any potential biases in the dataset and how they might affect model performance.
Model Training
Convolutional Neural Networks CNN
Train a CNN model to predict the age and gender of individuals.
Evaluate the model using appropriate metrics eg Mean Absolute Error for age, Accuracy for gender
Transformers
Train a Transformerbased model to predict the age and gender of individuals.
Evaluate the model using the same metrics as used for the CNN model.
Model Comparison
Compare the performance of the CNN and Transformer models on the validation and test sets.
Analyze the training time, computational resources required, and any differences in model architecture complexity.
Discuss the strengths and weaknesses of each approach in the context of the given tasks.
Model Evaluation
Plot the training and validation metrics over epochs to check for overfittingunderfitting for both CNN and Transformer models.
Analyze the confusion matrix for gender predictions to identify common misclassifications for both models.
Discuss the overall performance of the models and potential improvements.
You need to submit the file as follows firstnamelastname.ipynb
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
