Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SHAY2407 committed Aug 12, 2022
2 parents f3d22d4 + bb5ad1b commit c414f60
Show file tree
Hide file tree
Showing 24 changed files with 5,096 additions and 54 deletions.
3 changes: 0 additions & 3 deletions Dummy Project/Dataset/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Dummy Project/Dataset/dummy_dataset.csv

This file was deleted.

1 change: 0 additions & 1 deletion Dummy Project/Images/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Dummy Project/Images/dummy_img1.png

This file was deleted.

1 change: 0 additions & 1 deletion Dummy Project/Images/dummy_img2.png

This file was deleted.

43 changes: 0 additions & 43 deletions Dummy Project/Model/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Dummy Project/Model/dummy_project.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion Dummy Project/requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions HotDog Classification/Dataset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I have fetched the HotDog Classification Dataset from, https://www.kaggle.com/datasets/thedatasith/hotdog-nothotdog, for building and developing this Project. You guys can check out the dataset from the given link.
Binary file added HotDog Classification/Images/img1.JPG
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 HotDog Classification/Images/img10.JPG
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 HotDog Classification/Images/img2.JPG
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 HotDog Classification/Images/img3.JPG
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 HotDog Classification/Images/img4.JPG
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 HotDog Classification/Images/img5.JPG
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 HotDog Classification/Images/img6.JPG
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 HotDog Classification/Images/img7.JPG
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 HotDog Classification/Images/img8.JPG
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 HotDog Classification/Images/img9.JPG
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.

3,518 changes: 3,518 additions & 0 deletions HotDog Classification/Model/hotdog-classification-model.ipynb

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions HotDog Classification/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Hotdog Prediction Model

![image.png](Images/img1.JPG)

# Introduction

Hotdog Prediction Model is a Machine Learning based frame work which will predict whether a given image is of hotdog or not. Let's have a talk about the dataset.

# Dataset

The dataset for this project is taken from the Kaggle website. Here is the link for the dataset,https://www.kaggle.com/datasets/thedatasith/hotdog-nothotdog.
Here in the dataset you will find the test and training images for the Hotdog | Not Hotdog dataset. The goal is to use this images for binary classification and predict with the help of our model whether the image is of hotdog or not.
This dataset contains:Training images to be used for developing a binary classification model
2121 images of hot dogs, and 2121 images of other items.Test images to be used after training a binary classification model 200 images of hot dogs, and 200 images of other items.
The total number of images is, of course, 2x2121 for training and 2x200 for testing, with a total of 4,642 files.


# Goal

The goal of this project is to build a machine learning model with highest accuracy, which will predict the image is of hotdog or not.

# Approach

In this notebook we will implement various approaches and compare their accuracy with the help of dataset each approach will be divided into different section. For each approach EDA and all techniques of training and testing will be done seperately.

# Approach Using CNN
A Convolutional Neural Network is a type of neural network that is used in Computer Vision and Natural Language Processing tasks quite often due to the fact that it can learn to extract relevant features from the input data.
A typical CNN layer can be understood with the help of following diagram:
![image.png](Images/img2.JPG)

#### With a 52.7% test accuracy, the model performs only slightly better than simply tossing a coin. But that was our first approach. Let's move on to next approach to see whether our accuracy will improve or not.
![image.png](Images/img3.JPG)

# Approach Using MONAI Framework

The MONAI framework is the open-source foundation being created by Project MONAI. MONAI is a freely available, community-supported, PyTorch-based framework for deep learning in imaging field. It provides domain-optimized foundational capabilities for developing imaging training workflows in a native PyTorch paradigm.

Project MONAI also includes MONAI Label, an intelligent open source image labeling and learning tool that helps researchers and clinicians collaborate, create annotated datasets, and build AI models in a standardized MONAI.

### Visualizing some examples
![image.png](Images/img4.JPG)

## Plot the loss and metric
![image.png](Images/img5.JPG)

## Classification Report
![image.png](Images/img6.JPG)

### With a 69.6% test accuracy, the model performs much better than the previous simple CNN approach. But that is our second approach. Let's move on to next approach to see whether our accuracy will improve or not.

# Approach Using Tensorflow and Transfer Learning

Transfer learning is a method of reusing an already trained model for another task. The original training step is called pre-training. The general idea is that, pre-training “teaches” the model more general features, while the latter final training stage “teaches” it features specific to our own (limited) data. In this approach we have used InceptionResNetV2 as pre-training model and based on this we will transfer the learnings from this model into our model and predict the result.


## Generated Images Using Train Generator
![image.png](Images/img7.JPG)

### Loss and Accuracy Plot
![image.png](Images/img8.JPG)

## Classification Report and Confusion Matrix
![image.png](Images/img9.JPG)

![image.png](Images/img10.JPG)

### So here we have obtained the best accuracy from all the approaches that is **95 percent** and in this further scope can be improved by testing different type of pre-trained models like in our approach we have used InceptionResNetV2 . Other Resnet can also be used for transfer learning purpose.

# Conclusion
### We have implemented three different approaches CNN, Monai Pytorch, And Tensorflow with transfer learning and in each case we obtained the accuracy 52.7%,69.7%, and 95% respectively which clearly indicates that transfer learning for this dataset is best when used with InceptionResNetV2 among all approaches which has been discussed in this file.

Connect with me on Linkedin:https://www.linkedin.com/in/vikalp-tripathi-187190202/ Check out my Github profile: https://github.com/Vikalp981
12 changes: 12 additions & 0 deletions HotDog Classification/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
python
pandas
numpy
matplotlib
tensorflow
pytorch
keras
sklearn
cv2
monai
shutil
tempfile
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
<h3>Website for Deep Learning Simplified Repo: <a href="https://tinyurl.com/deep-learning-simplified">Click Here!🎯</a></h3>
</div>

<div align="center">

![GitHub contributors](https://img.shields.io/github/contributors/abhisheks008/DL-Simplified?style=for-the-badge&color=blue)
![GitHub Closed issues](https://img.shields.io/github/issues-closed-raw/abhisheks008/DL-Simplified?style=for-the-badge&color=brightgreen)
![GitHub PR Open](https://img.shields.io/github/issues-pr/abhisheks008/DL-Simplified?style=for-the-badge&color=aqua)
![GitHub PR closed](https://img.shields.io/github/issues-pr-closed-raw/abhisheks008/DL-Simplified?style=for-the-badge&color=blue)
![GitHub language count](https://img.shields.io/github/languages/count/abhisheks008/DL-Simplified?style=for-the-badge&color=brightgreen)
![GitHub top language](https://img.shields.io/github/languages/top/abhisheks008/DL-Simplified?style=for-the-badge&color=aqua)
![GitHub last commit](https://img.shields.io/github/last-commit/abhisheks008/DL-Simplified?style=for-the-badge&color=blue)
![GitHub Maintained](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg?style=for-the-badge)
![Github Repo Size](https://img.shields.io/github/repo-size/abhisheks008/DL-Simplified?style=for-the-badge&color=aqua)

</div>

![](https://github.com/abhisheks008/DL-Simplified/blob/main/.github/Assets/deep%20learning%20(2).png)

*************************************************
Expand Down Expand Up @@ -30,7 +44,7 @@ Please follow the [Code of Conduct](https://github.com/abhisheks008/DL-Simplifie
<table>
<tr>
<td align="center">
<a href="https://ssoc.getsocialnow.co/#"><img src="https://github.com/abhisheks008/DL-Simplified/blob/main/.github/Assets/logo-1.jpg" width=100px height=100px /><br /><sub><b>Social SoC 2022</b></sub></a><br /><sub><h3>PR Count: 01</h3></sub>
<a href="https://ssoc.getsocialnow.co/#"><img src="https://github.com/abhisheks008/DL-Simplified/blob/main/.github/Assets/logo-1.jpg" width=100px height=100px /><br /><sub><b>Social SoC 2022</b></sub></a><br /><sub><h3>PR Count: 03</h3></sub>
</td>
</tr>
</table>
Expand All @@ -50,7 +64,7 @@ Please follow the [Code of Conduct](https://github.com/abhisheks008/DL-Simplifie

<table>
<tr>
<td align="center"><a href="https://github.com/abhisheks008/DL-Simplified/blob/main/.github/ssoc_leaderboard.md"><img src="https://cdn-icons-png.flaticon.com/512/1986/1986941.png" width="100px;" alt=""/><br /><sub><b>SSOC Leaderboard</b></sub></a></td>
<td align="center"><a href="https://docs.google.com/spreadsheets/d/14s2_cPpc_R09HJacQ-cqXy57xXD6lfU-18Gd562T5Dw/edit?usp=sharing"><img src="https://cdn-icons-png.flaticon.com/512/1986/1986941.png" width="100px;" alt=""/><br /><sub><b>SSOC Leaderboard</b></sub></a></td>
</tr>
</table>

Expand Down

0 comments on commit c414f60

Please sign in to comment.