Skip to content

Commit

Permalink
Merge pull request #760 from Arihant-Bhandari/cat-classify
Browse files Browse the repository at this point in the history
[Project Addition] Cats Breed Classification using DL
  • Loading branch information
abhisheks008 authored Jun 10, 2024
2 parents cc3e2ec + 43eadad commit 82cc2ca
Show file tree
Hide file tree
Showing 26 changed files with 169 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cats Breed Classification using DL/Dataset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The link for the dataset used in this project: https://www.kaggle.com/datasets/yapwh1208/cats-breed-dataset

The dataset consists of 5 subdirectories: siamese, ragdoll, bengal, domestic_shorthair and maine_coon under cat_v1 directory, totalling to 951 images.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Cats Breed Classification using DL/Images/EDA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

148 changes: 148 additions & 0 deletions Cats Breed Classification using DL/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
## **Cats Breed Classification using DL**

### 🎯 **Goal**

The objective of this project is to classify images of cats into 5 breeds, namely: siamese, ragdoll, bengal, domestic shorthair and maine coon.

### 🧵 **Dataset**

The dataset consists of 5 subdirectories: siamese, ragdoll, bengal, domestic_shorthair and maine_coon under cat_v1 directory, totalling to 951 images.

### 🧾 **Description**

The project deals with multi-class classification, classifying images into 5 classes.

### 🧮 **What I had done!**

To achieve our goals, the following steps were implemented:

- Images were loaded using keras.utils and normalized to the range 0 to 1.

- Implemented class balancing by loading 170 images per class.

- Labels were loaded and one-hot encoded into probability distributions.

- Images were resized to a fixed size of 224x224 pixels.

- Custom and pre-trained models were used for this task.

### 🚀 **Models Implemented**

models used:

- ResNet-50
- Xception
- VGG16
- CNN
- InceptionV3
- DenseNet-121
- MobileNet
- NASNetMobile

### 📚 **Libraries Needed**

- Keras

- Tensorflow

- Numpy

- Matplotlib

### 📊 **Exploratory Data Analysis Results**


- #### **Exploratory Data Analysis**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/bengal.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/domestic%20shorthair.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/maine%20coon.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/ragdoll.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/siamese.png" height="400px" width="400px" />
</p>

<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/EDA.png">

- #### **CNN**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/CNN%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/CNN%20Loss.png" height="400px" width="400px" />
</p>

- #### **InceptionV3**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/InceptionV3%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/InceptionV3%20Loss.png" height="400px" width="400px" />
</p>

- #### **VGG16**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/VGG16%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/VGG16%20Loss.png" height="400px" width="400px" />
</p>

- #### **MobileNet**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/MobileNet%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/MobileNet%20Loss.png" height="400px" width="400px" />
</p>

- #### **RESNET50**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/RESNET50%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/RESNET50%20Loss.png" height="400px" width="400px" />
</p>

- #### **DenseNet-121**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/DenseNet121%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/DenseNet121%20Loss.png" height="400px" width="400px" />
</p>

- #### **Xception**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/Xception%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/Xception%20Loss.png" height="400px" width="400px" />
</p>

- #### **NASNetMobile**

<p align="center">
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/NASNetMobile%20Accuracy.png" height="400px" width="400px" />
<img src="https://github.com/Arihant-Bhandari/DL-Simplified/blob/cat-classify/Cats%20Breed%20Classification%20using%20DL/Images/NASNetMobile%20Loss.png" height="400px" width="400px" />
</p>

### 📈 **Performance of the Models based on the Accuracy Scores**

#### Metrics:

We used Validation **Loss** and **Accuracy** as metrics.

| Models | Accuracy | Loss |
|--------|---------------------|--------------------------|
| ResNet-50 | 22.66% | 12.4663 |
| InceptionV3 | 83.59% | 0.4896 |
| CNN | 35.94% | 2.2302 |
| VGG16 | 78.12% | 0.6243 |
| MobileNet | 90.62% | 0.3220 |
| DenseNet-121 | 85.16% | 0.5082 |
| Xception | 82.81% | 0.4810 |
| NASNetMobile | 87.50% | 0.4133 |

### 📢 **Conclusion**

We conclude the following:

**NASNetMobile**, **Xception**, **MobileNet** and **DenseNet-121** work exceptionally on given task.

### ✒️ **Your Signature**

Original Contributor: Arihant Bhandari [https://github.com/Arihant-Bhandari]
17 changes: 17 additions & 0 deletions Cats Breed Classification using DL/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pandas
keras
tensorflow
numpy
matplotlib
torch
seaborn
Dense
Dropout
BatchNormalization
Adam
EarlyStopping
ModelCheckpoint
Conv2D
MaxPooling2D
Sequential
Nadam

0 comments on commit 82cc2ca

Please sign in to comment.