/Happy-Sad-ClassificationAiModel

This project aims to build an AI model capable of classifying images as happy or sad faces. The model is trained using nearly 2,000 portrait pictures from Google search results.

Primary LanguageJupyter Notebook

Image Classification AI Model for Happy and Sad Faces with Machine Learning

This project aims to build an AI model capable of classifying images as happy or sad faces. The model is trained using nearly 2,000 portrait pictures from Google search results.

Libraries Used

The following libraries were used to build and train the model:

Tensorflow Pandas Matplotlib cv2 imghdr os Numpy

Neural Network Training Models Used

The following neural network training models were used to build the AI model:

Sequential Conv2D MaxPooling2D Dense Flatten Dropout

Training Results

The model was trained for 30 epochs, resulting in the following metrics:

Loss: 0.0206 Accuracy: 0.9908 Validation Loss: 1.1787 Validation Accuracy: 0.8047

Model Training

The model was trained on a dataset consisting of nearly 2,000 portrait pictures from Google search results. The pictures were labeled as either happy or sad faces, based on the emotions depicted on the faces.

Model Prediction

The model was tested on an unknown image and achieved an impressive prediction accuracy. The picture selected was a poker face, but the model accurately predicted it to be a sad face with high confidence. It is important to note that the model only predicts on two major emotions, happy and sad faces.

Potential Applications

The main goal of this project is to demonstrate the potential of machine learning techniques in image classification tasks. By accurately identifying whether a person is happy or sad based on their facial expression, this technology could potentially be used in various applications. For instance, it could be employed in monitoring mental health, analyzing customer satisfaction in retail environments, or even in developing educational tools for people with autism to help recognize emotions.

Conclusion This project is a perfect example of how machine learning techniques can be utilized in image classification tasks. By training a model on a dataset of images, it can accurately classify new images that it has never seen before. The results achieved in this project can pave the way for more research on the potential use of machine learning techniques in various industries.

Model Trained with 2000 Faces Like :

Screenshot 2023-05-06 at 11 10 23 AM

The Result Model on Unknow Image and

Screenshot 2023-05-06 at 11 10 14 AM

the Pictures selected with Poker face but the machine Predict it with very high accurecy to SAD FACE.

Note that. the model only predicting on to major " SAD " and " HAPPY " Faces.