Skip to content

Commit

Permalink
Deep Learning
Browse files Browse the repository at this point in the history
  • Loading branch information
UTSAVS26 committed Oct 2, 2024
1 parent 908d0f7 commit ad5cc5b
Show file tree
Hide file tree
Showing 37 changed files with 15,339 additions and 0 deletions.
Empty file removed Deep_Learning/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions Deep_Learning/Face Mask Detection/Dataset/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dataset : https://www.kaggle.com/datasets/shiekhburhan/face-mask-dataset
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.
1 change: 1 addition & 0 deletions Deep_Learning/Face Mask Detection/Images/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
images
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions Deep_Learning/Face Mask Detection/Model/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Face mask detection using ConvNet, InceptionV3, MobileNet, DenseNet and VGG19

COVID-19 has been an inspiration for many software and data engineers during the last months.
This project demonstrates how a Depp learming models can detect if a person in a picture is wearing a face mask or not.
As you can easily understand the applications of this method may be very helpful for the prevention and the control of COVID-19 as it could be used in public places like airports, shopping malls etc.

## Defining the problem
Detecting if an image contains a person wearing a mask or not is a simple **classification problem**.
We have to classify the images between **2 discrete classes**: The ones that contain a face mask and the ones that do not.

## The dataset
https://www.kaggle.com/datasets/shiekhburhan/face-mask-dataset

![image](https://github.com/ranodeepbanerjee/DL-Simplified/assets/63450189/c0322919-0452-412a-9216-fbc75de3c17a)



## Models used

* Covnet - ConvNet, short for Convolutional Neural Network, is a type of deep learning model commonly used in image classification and object recognition tasks. It consists of multiple layers of convolutional and pooling operations that extract features from the input image.

* InceptionV3 - InceptionV3 is an advanced version of the Inception architecture, which is designed to improve the accuracy and efficiency of image classification models. It uses a combination of convolutions with different kernel sizes and pooling operations to capture multi-scale features.

* MobileNet - MobileNet is a lightweight neural network designed for mobile and embedded devices with limited computational resources. It uses depthwise separable convolutions to significantly reduce the number of parameters and computation required while maintaining high accuracy.

* DenseNet - DenseNet is a densely connected neural network that allows each layer to have direct access to the feature maps of all preceding layers. This results in better feature reuse and gradient flow, leading to improved accuracy and reduced overfitting.

* VGG19 - VGG19 is a deep neural network with 19 layers specifically designed for image recognition tasks. It uses small convolutional filters with a fixed size of 3x3 across all layers and max-pooling operations to extract and learn hierarchical features from images.

## Distribution of classes

![image](https://github.com/ranodeepbanerjee/DL-Simplified/assets/63450189/4392ebd7-5aa2-4fd3-88e3-d90c17dfee14)


## Evaluation

![image](https://github.com/ranodeepbanerjee/DL-Simplified/assets/63450189/eef19273-71e7-4284-8156-3db09f7051c1)

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Deep_Learning/Face Mask Detection/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
torch==1.9.0
numpy==1.19.5
pandas==1.3.0
opencv-python-headless==4.5.3.56
seaborn==0.11.1
matplotlib==3.4.2
keras==2.6.0
tensorflow==2.6.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# MNIST Digit Classification using Neural Networks

# GOAL
This project aims to create neural networks to successfully classify images provided by the MNIST dataset into 10 predefined classes.

# DATASET
https://www.kaggle.com/c/digit-recognizer

# DESCRIPTION

The project focuses on leveraging neural networks to achieve accurate image classification using the MNIST dataset. The dataset comprises handwritten digits, and the objective is to develop a robust model capable of categorizing these digits into ten predefined classes. By harnessing advanced deep learning techniques, the neural networks will learn intricate patterns and features within the images, facilitating precise classification. This endeavor not only emphasizes the application of cutting-edge technology but also contributes to the broader field of machine learning, with potential implications for diverse domains, including pattern recognition, digitization, and artificial intelligence.

# WHAT I HAD DONE

I have created 2 different nueral network models to correctly classify digits into 10 classes. One model is built using artificial neural networks and the other is built using convolutional neural networks. In both the models EDA has been done along with hyperparameter tuning to achieve high accuracy

# MODELS USED

<ul>
<li>Artificial neural networks</li>
<li>Convolutional neural networks</li>
</ul>
Neural networks have been used to solve the problem at hand as they tend to perform better than regular machine learning algorithms as they can capture more information and non-linear features. Convolutional neural network is a special type of neural network that is made to perfrom better on images and videos

# LIBRARIES NEEDED

<ul>
<li>tensorflow </li>
<li>matplotlib</li>
<li>seaborn</li>
<li>numpy</li>
<li>pandas</li>
<li>keras</li>
</ul>

# VISUALIZATION
![bar graph to visualize class imbalance](<bar graph.png>)
![pie chart to visualize class imbalance](<pie chart.png>)
![histogram plot to visualize frequency distribution in each class](histogram.png)
![input visualization](<input visualisation.png>)

# ACCURACIES

<ul>
<li>Artifical Neural Network - Accuracy: 97.7699%</li>
<li>Convolutional Neural Network - Accuracy: 99.1199%</li>
</ul>

# CONCLUSION

Convolutional Neural Networks (CNNs) demonstrate superiority over traditional Artificial Neural Networks (ANNs) in image-related tasks due to their specialized architecture. CNNs excel in capturing spatial hierarchies and local patterns within images through convolutional layers, which employ filters to detect features like edges and textures. This enables CNNs to preserve spatial relationships, making them highly effective for tasks like image classification and object recognition. In contrast, ANNs lack the inherent capacity to recognize spatial patterns efficiently, making them less adept at handling image data. The hierarchical and localized learning of CNNs makes them particularly well-suited for computer vision applications, outperforming ANNs in tasks that demand nuanced understanding of visual content. It is clearly observable from the scores that CNNs perform better than ANNs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- Link to the dataset -->

https://www.kaggle.com/c/digit-recognizer
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.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
numpy == 1.24.3
pandas==1.5.0
matplotlib==3.6.0
tensorflow==2.6.0
Keras
seaborn == 0.13.0
Loading

0 comments on commit ad5cc5b

Please sign in to comment.