Skip to content

Commit 0420cd2

Browse files
authored
Merge pull request #806 from abckhush/main
Pet's Facial Expression Detection
2 parents 39e42a9 + d9c81e7 commit 0420cd2

10 files changed

+89
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# **Pet's Facial Expression Recognition**
2+
3+
This dataset contains 1000 face images of various pets, such as dogs, cats, rabbits, hamsters, sheep, horses, and birds. The images capture the diversity of expressions these animals can display, such as happiness, sadness, anger etc. You can apply ML techniques to gain insights into pet emotions and personalities, create fun and creative projects with pet face images, and contribute to pet face recognition research and animal welfare
4+
5+
### Dataset Link : https://www.kaggle.com/datasets/anshtanwar/pets-facial-expression-dataset/data
Loading
19 KB
Loading
Loading
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# **Pet's Facial Expression Detection**
2+
This project focuses on developing a sophisticated image classification system to identify different facial expressions in pets using deep learning techniques. The system leverages three state-of-the-art convolutional neural network (CNN) architectures: EfficientNet and ResNet50, along with Vision Transformer (ViT) architecture, each known for their robustness and high performance in image recognition tasks.
3+
4+
5+
### Models Implemented
6+
- ViT Transformer: Utilizes the transformer architecture for image classification, providing state-of-the-art accuracy.
7+
- EfficientNet: A family of models that balance model depth, width, and resolution, achieving high performance with fewer parameters.
8+
- ResNet50: Employs residual learning to train very deep networks, addressing the vanishing gradient problem and achieving high accuracy.
9+
10+
### Libraries Used
11+
The following libraries were used to implement the models:
12+
13+
- TensorFlow: An open-source library developed by Google for numerical computation and large-scale machine learning.
14+
- Keras: A high-level neural networks API, written in Python and capable of running on top of TensorFlow.
15+
- NumPy: A fundamental package for scientific computing with Python, used for handling arrays and performing mathematical operations.
16+
- Pandas: A data manipulation and analysis library for Python.
17+
- Matplotlib: A plotting library for Python and its numerical mathematics extension, NumPy.

Pet's Facial Expression/Models/pet-s-facial-expression-detection-resnet-50.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

Pet's Facial Expression/Models/pets-facial-expression-efficientnet.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

Pet's Facial Expression/Models/pets-facial-expression-vit.ipynb

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

Pet's Facial Expression/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# **Pet's Facial Expression Detection**
2+
3+
### 🎯 Goal
4+
This project aims to develop an advanced image classification system that can accurately identify the facial expressions of pets using cutting-edge deep learning techniques.
5+
6+
### Purpose
7+
Understanding pet emotions through their facial expressions can significantly enhance the bond between pets and their owners. This project aims to leverage advanced AI models to detect and classify various facial expressions in pets, aiding in better care and understanding of pets' emotional states.
8+
9+
### 🧵 Dataset
10+
The dataset used in this project is: https://www.kaggle.com/datasets/anshtanwar/pets-facial-expression-dataset
11+
12+
### 🧾 Description
13+
This project focuses on developing a sophisticated image classification system to identify different facial expressions in pets using deep learning techniques. The system leverages three state-of-the-art convolutional neural network (CNN) architectures: EfficientNet and ResNet50, and Vision Transformer (ViT) architecture, each known for their robustness and high performance in image recognition tasks.
14+
15+
### 🚀 Models Implemented
16+
- ViT Transformer: Utilizes the transformer architecture for image classification, providing state-of-the-art accuracy.
17+
- EfficientNet: A family of models that balance model depth, width, and resolution, achieving high performance with fewer parameters.
18+
- ResNet50: Employs residual learning to train very deep networks, addressing the vanishing gradient problem and achieving high accuracy.
19+
20+
### 📚 Libraries Needed
21+
- TensorFlow: For building and training deep learning models.
22+
- Keras: For simplifying the creation and training of neural networks.
23+
- NumPy: For numerical computations and array operations.
24+
- Pandas: For data manipulation and analysis.
25+
- Matplotlib: For plotting and visualizing data.
26+
27+
### 📊 Exploratory Data Analysis Results
28+
Exploratory Data Analysis (EDA) involved examining the distribution of the dataset, visualizing sample images, and understanding the different classes of facial expressions. The dataset was split into training and testing sets to evaluate the model's performance effectively.
29+
30+
### 📈 Performance of the Models based on the Accuracy Scores
31+
32+
**ViT Performance**
33+
34+
![ConfusionMatrix_ViT](https://github.com/abckhush/DL-Simplified/assets/127378920/d708a320-014b-43bf-881e-67908057f0e2)
35+
36+
**EficientNet Performance**
37+
38+
![EfficientNet_plot](https://github.com/abckhush/DL-Simplified/assets/127378920/631071c2-91cc-4b96-9114-869e4f55cd96)
39+
40+
**ResNet50 Performance**
41+
42+
![ResNet50_Plot](https://github.com/abckhush/DL-Simplified/assets/127378920/03ef5ddc-e537-4101-aedd-3e5d3c83fe6e)
43+
44+
45+
### 📢 Conclusion
46+
The Vision Transformer (ViT) model successfully classified the facial expressions of pets with high accuracy. The EfficientNet model showed moderate performance, and the ResNet50 model achieved the highest accuracy among the three models. Each model's performance demonstrates the potential of using advanced neural network architectures for image classification tasks in the domain of pet emotion detection.
47+
48+
### Accuracy Results
49+
The model's performance was evaluated using accuracy and F1 scores.
50+
1. ViT
51+
- Training Accuracy: 80.0%
52+
- F1 Score: 0.8
53+
2. EfficientNet
54+
- Training Accuracy: 57.7%
55+
- F1 Score: 0.54
56+
3. ResNet50
57+
- Training Accuracy: 97.99%
58+
59+
### Best Fitted Model
60+
The ResNet50 model proved to be the best-fitted model for this task, achieving the highest accuracy and demonstrating robustness in classification.
61+
62+
## ✒️ Contributor
63+
- Name: Khushi Kalra
64+
- Github: https://www.github.com/abckhush

0 commit comments

Comments
 (0)