top of page

Face and Digit Classification

I trained my machine learning model, leveraging algorithms like Perceptron and Neural Networks, to accurately predict images containing faces or digits.

The task at hand involves implementing and comparing two classification algorithms, namely the Perceptron and a Two-layer Neural Network, for detecting faces and classifying digits. This requires designing features for each problem and writing a program for feature extraction. We'll train the algorithms using varying percentages of the training dataset and assess their performances based on prediction error, standard deviation, and training time.


For the Perceptron algorithm, the pixels in each digit and face image serve as direct inputs, extracted via basicFeatureExtractorDigit and basicFeatureExtractorFace functions in dataClassifier.py. Weights are initialized randomly between 0 and 1, and the algorithm iterates through the training data to update weights based on prediction accuracy. Face data poses a unique challenge, as incorrect predictions lead to weight adjustments to improve subsequent predictions.


Conversely, the Two-layer Neural Network involves initializing weights randomly and defining activation functions for forward and backward passes during training. This process includes computing dot products, applying activation functions, and updating weights based on prediction errors.


To evaluate performance, we'll train each algorithm using incremental percentages of the training data and analyze prediction error, standard deviation, and training time. The testing phase will involve running predictions on a separate testing dataset, ensuring that the algorithms are not influenced by the testing data during training to avoid bias.

Finally, we'll document our implementation process, discuss results, and reflect on lessons learned in a comprehensive report, showcasing our understanding of the algorithms and their practical applications.


Check it out at:

GitHub

Project Gallery

bottom of page