Professional Documents
Culture Documents
Submitted by
Soumyakshya
Registration No:
20030146DS013
Bangalore
Master of Technology
Declaration
This is to declare that the Report titled “Real Time Face Mask Detection” has been
made for the partial fulfillment of the Course: Industry Internship Programme (IIP) in
Semester II by me at Excelvisor Technologies LLP (organization) under the guidance of
Dr./Prof. P.Mano Paul
I confirm that this Report truly represents my work undertaken as a part of my Industry
Internship Programme (IIP). This work is not a replication of work done previously by any
other person. I also confirm that the contents of the report and the views contained
therein have been discussed and deliberated with the academic supervisor.
Registration No : 20030146DS013
Master of Technology
Certificate
This is to certify that Mr. / Ms. Soumyakshya Regn. No. 20030146DS013 has completed
the report titled “Real Time Face Mask Detection” under my guidance for the partial
fulfillment of the Course: Industry Internship Programme (IIP) in Semester II of the Master
ABSTRACT
1. INTRODUCTION 1
2. PROJECT PROFILE 14
2.2. METHODOLOGY 15
4. RESULTS 31
6. CONCLUSION 37
LEARNING OUTCOME 38
ANNEXURE 39
REFERENCES 49
ABSTRACT
Since the Covid sickness (COVID-19) become a general medical condition all throughout
the planet. This pandemic is affecting social orders and economies all throughout the
planet. The expansion in the quantity of COVID-19 tests gives more data about the
pandemic spread, which might prompt the chance of encompassing it to forestall further
contaminations. In any case, wearing a facial covering that forestalls the transmission of
beads noticeable all around and keeping a proper actual separation among individuals, and
lessening close contact with one another can in any case be helpful in battling this
pandemic.
Consequently, we are executing a Realtime Face Mask Detection model utilizing VGG16
as a PC vision framework. Individuals not wearing covers were identified. In the wake of
executing and sending the models, the chose one accomplished a certainty score of 85-
100%.
1. INTRODUCTION
Covids are a huge group of infections that are known to cause sickness going from the
normal virus to more extreme illnesses like Middle East Respiratory Syndrome (MERS)
and Severe Acute Respiratory Syndrome (SARS). Since the finish of 2019, irresistible
Covid infection (COVID-19) has been accounted for without precedent for Wuhan, and it
has turned into a public harm wellness issue in China and surprisingly around the world.
The World Health Organization (WHO) has pronounced the Covid sickness 2019 (COVID-
19) a pandemic[1]. A worldwide facilitated exertion is expected to stop the further spread
and influencing an outstandingly high extent of the population.[2] The last pandemic
This pandemic effectsly affects social orders and economies all throughout the planet
From one side of the planet to the other, particularly in the third wave, COVID-19 has
been a critical medical services challenge [3]. Numerous closures in various businesses
have been brought about by this pandemic. What's more, numerous areas, for example,
upkeep undertakings and framework development have not been suspended attributable
to their huge impact on people groups routine life [4, 5]. At this point, the infection has
quickly spread to most of the nations overall [2]. Around the world, as of 4:50pm CET, 19
November 2021, there have been 255,324,963 affirmed instances of COVID-19, including
As indicated by the habitats for Disease Control and Prevention (CDC), Covid
inhale, talk, hack, or wheeze [3] with normal drop size 510m however spray emanation
1
In this way, to forestall quick COVID-19 contamination, numerous arrangements, like
repression and lockdowns, are proposed by most of the universes state run
troublesome yet essential infection regulation measures (e.g., stay-at-home requests and
lockdowns), just as noncooperation for reasons other than free riding. For example,
creators in [7] contended that in light of the fact that severe stay-at-home measures can
(combined with lockdown weakness) can wind up offsetting the danger of contamination
from going out. As individual-level choices straightforwardly affect the general public level
of expected low paces of consistence, particularly from financially hindered people who
don't have the advantage of remaining at home [8]. A few state run administrations might
have likewise been confident that group insusceptibility from recuperations and
immunizations would permit them to try not to force such disliked measures by and
large.
With rising quantities of cases and extended wellbeing offices, just as the absence of an
immunization all through 2020 and hardships related with accomplishing group
in [7] proposed utilizing social projects, for example, crisis help assets and joblessness
protection to bring down the expenses of consistence, especially for lowerpaid laborers
[11]. As immunizations opened up toward the finish of 2020, creators in [12] contended
that projects driving inoculation take-up will outperform different angles like antibody
investigation, and specialist based displaying, the creators suggested that people
2
of communication, the strength of the antibody, pandemic boundaries, and discernments
the public authority will be affected by pestilence boundaries, the idea of the antibody
the board of HR required for the inoculation exertion, and the quantity of antibody
include an enthusiasm for the many variables that adjust settlements so both individual
and legislative choices shift toward security. It is actually the case that COVID-19 is a
worldwide pandemic and influences a few areas. All things considered, it made a way for
example, making new programmed location techniques for COVID-19 and distinguishing
individuals with or without veils. Taking into account that there are a few blunders in the
aftereffects of the early lab tests and their postponements, scientists zeroed in on various
choices [13]. Thusly, the use of cutting edge man-made reasoning (AI) strategies [14-17]
combined with VGG-16 can prompt a more precise identification of the COVID-19 and
can assist with controlling the issue of loss of particular doctors in separated towns [18].
University of Oxford in the paper Very Deep Convolutional Networks for Large-Scale
Image Recognition. The model accomplishes 92.7% top-5 test precision in ImageNet,
which is a dataset of more than 14 million pictures having a place with 1000 classes.
We are utilizing this model to achive our objective of recognizing fase cover of individuals
3
1.1. INDUSTRY OVERVIEW
other niche technology, and also in Tech Education. Excelvisor has initiated it’s Industry-
for connectivity, network and security that establishes the growth of your
organization. We are expertise in providing the most efficient solutions, easy to use
applications connected to servers that simplify some of the tasks to work in high-
Virtualization, Local Area Network & Wide Area Network, Embedded area as well
utilization across the global networks. With fast growing technologies and evolving
demand for application storage and data, we derive strategies that lower upfront
cost, bring up affordability and easy-to-use and saves management time. We are
4
experts in transforming complexity to simplicity IT Solutions to maximize business
strategy that enables our clients for Staff Augmentation. Our comprehensive team
of consultants enables the process that evaluates skilled and expert candidates
that are able to fulfill the criteria required by assessing the skills. We serve our
clients in managing the complex process to easy transition through our expert
domains. Our key advantage in staffing strategies includes hiring a vast pool of
productivity that helps in finding niche talent and to solve staffing challenges.
match candidates that fulfill the given job requirements. Our dedication and
placement. We evaluate the performance of the candidates and gauge their skills
5
Products that Excelvisor sells to its esteemed clients
DESCRIPTION
ET-DCU-xC is a data logger from various external devices such as Energy meters, Sensor
Hub etc. It will support industrial protocols like Modbus, DLMS-COSEM (APDRP/AMR),
PACT and Proprietary Protocols. It will store the data time wise in various file format like
the external devices. It will support single or multiple channels. This device has optional
feature like to push the data to Cloud Server via wired or wireless network connectivity.
FEATURES:
6
Web UI – Strong Password Protected, HTTP web access and Remote HTTPS web access
(Optional).
2. COMMUNICATION PRODUCT
DESCRIPTION
ET-RTU-1600s is designed for remote monitoring of various devices using SCADA. This
device is capable to acquire the data from Multifunction Meters (MFM) using Modbus
ET-RTU-1600s has RS232/485 for MFM communication and Ethernet (RJ45) for SCADA
communication. Also it has 16 Digital Input which will help monitor the various filed
7
devices like Relay, Circuit Breakers etc. It will perform as a Modbus RTU/TCP Master to
through GPRS/Wi-Fi and Digital Outputs to control external devices. It has capable to
FEATURES
Two Ethernet Ports for SCADA communication and local network access.
Web UI – Strong Password Protected, HTTP web access and Remote HTTPS web access
(Optional).
3. WIRELESS PRODUCTS :
4G INDUSTRIAL GATEWAY
Model: ET-LAN2WL-4G
8
DESCRIPTION
over the air. It is a compact, rugged unit, it mainly designed to establish communication
between Controlled (RTU, IED, and Relay) and Controlling Station (SCADA) over the air.
device is typically used for remote data acquisition / remote device monitoring and
control. It is totally transparent to the protocols used for communication between the
end-points and principally functions as a gateway providing TCP/IP connectivity for the
wireless connectivity.
BLOG: Excelvisor Career Training & Skills Development Program Blog Official Excelvisor
blogs, be the first to know the evolution of training development program, futuristic
Machine Learning & Artificial Technologies news, articles and blogs, recent job posts, and
companies outlook. Subscribe to our Blog page and keep updated with newbies of tools
and software, batch timings, batch dates on different course modules. Get to know course
curriculum, training classes and best ever tutors from an industrial background.
the quality training system, helping people to transform their careers to gain realistic
technology exposure. Join today to unlock the hidden learning potentials and acquire the
9
Deckspire : Deckspire is a product development firm focused on building and launching
innovative software products. Our products help businesses across a variety of industries
Makers of Aiva, A virtual chatbot which helps clients organize their customers and focus
a) Over 200 real estate lead sources supported out of the box
b) Automatically copy your custom Aiva email address on your incoming lead notifications
to send leads in
c) Easily turn on and off lead sources at any time, setup takes just minutes
Deckspire is situated in 36 W 25th St, New York, NY 10010, United States , a 4 min walk
Indian Scenario :
1)The Seksaria Group : With over eight decades of responsible business practices, our
businesses have grown into global powerhouses in a wide range of sectors .Vision is to
continue to build strong diversified companies for the benefit of all our stakeholders.
Cuttack. Its authorized share capital is Rs. 18,000,000 and its paid up capital is Rs.
engineering .
10
Directors of Kamalakanta Engineering & Construction Company Private Limited are
Excellence". The vision of the company is to provide cost effective, high quality, innovative
Excelvisor has designed and built a wide range of devices in sector of Energy Monitoring
and communication. It is also committed to provide it's customer a cost effective solution
The R & D division of Excelvisor is still in make of various IoT devices in sector of Energy
Excelvisor provides the service and training in niche areas. As a service Excelvisor
11
The training division of Excelvisor conducts Corporate Training and Skill levelling in
Excelvisor Mission
Excelvisor is on a mission to work on industry 4.0 technologies and provide the industry
with high quality, cost effective product, service and Training . As part of the service as
providing well-researched training courses that will enable them to excel immensely. The
products and services are custom-made to deliver high-yielding results to the clients and
their organizations. Our primary mission is to improve and empower the candidates’ skills
Our Vision
With an aim to add value to all our business line as Product, Service and Niche skill
training, our primary aim is to deliver excellence. With our strong and dedicated vision,
we endeavor to build transparent and long-term relationships with our clients. Our high-
quality services and products are administered seamlessly to the organizations enabling
them of nothing but perfection. The R&D department takes pride in its effective and
committed team members who make sure that the product quality surpasses client
the team members of Excelvisor ensure that newfound methods are used to come up with
solutions that will help both the organizations and trainees. The Training courses are
which helps the them attaining high level in industry. Offering premium quality and
innovative products and services in energy monitoring, clean energy and domestic usage
sector, Excelvisor makes use of the latest technology to yield enhanced results. The team
members are updated with the newest tech and are able to carry out their work
high-quality products and services that will provide optimized solutions to clients.
12
Product and Services
Our skilled and experienced team, which is always curious and looking forward for new
innovation in this sector, we have been very successful in providing cost effective and
robust solutions.
ensuring the right recruitment process by finding perfectly match candidates that fulfill
the given job requirements.With expertise in IT solutions, we put forward effective strategy
that enables our clients for Staff Augmentation. Explore the right applications that offer a
reliable, high-performance for connectivity, network and security that establishes the
Strength:
productivity that helps in finding nice talent and to solve staffing challenges.
They evaluate the performance of the candidates and gauge their skills by
Weakness:
13
Training resource could have been improved.
Opportunity:
Company explore the right applications that offer a reliable high-performance for
They put forward effective strategy that enables our clients for Staff Augmentation.
ensuring the right recruitment process by finding perfectly match candidates that
Threats
2. PROJECT PROFILE
enormous potential for extracting tiny features in image analysis. Due to the COVID-19
epidemic, some deep learning approaches have been proposed to detect patients infected
with coronavirus. In this context, and unlike bacterial pneumonia, many other types of
lung infections caused by viruses are called viral pneumonia. These viruses, such as the
COVID-19, infect the lungs by blocking the oxygen flow, which can be life-threatening.
This motivated researchers to develop many frameworks and schemes based on AI tools
in the fight against this dangerous virus. Hence, we divide this section into two sections
14
We will build a real-time system to detect whether the person on the webcam is wearing a
mask or not. The dataset consists of 1376 images with 690 images containing images of
people wearing masks and 686 images with people without masks.
A model is created using datasets with mask and without mask. To identify people on
camera without mask and send an alert to the respective authorities, with the picture of
To identify people on camera without mask and send an alert to the respective
As the coronavirus is spreading rapidly, the World Health Organization has suggested to
In support of the ongoing fight against this infectious disease, we are motivated to
generate new insights, by providing information about the people who don’t wear
Corona virus has affected every single individual over the globe. Every individual is taking
Our project is to prepare a data set which would detect whether a person on the camera
is wearing a Face Mask or not and sends an alert to the security or the people who are
monitoring it.
2.2. METHODOLOGY
VGG-16
15
VGG16 is a convolutional neural organization model proposed by K. Simonyan and A.
Zisserman from the University of Oxford in the paper Very Deep Convolutional Networks
for Large-Scale Image Recognition. The model accomplishes 92.7% top-5 test precision in
ImageNet, which is a dataset of more than 14 million pictures having a place with 1000
classes. It was one of the renowned model submitted to ILSVRC-2014. It makes the
improvement over AlexNet by supplanting enormous piece measured channels (11 and 5
in the first and second convolutional layer, individually) with numerous 33 portion
estimated channels in a steady progression. VGG16 was prepared for a really long time
Figure : VGG-16
Datasets
Datasets were given to us by Excelvisor Technologies LPP. Two set of datasets composed
of faces of various people from different parts of the world and of all age groups. One set
of dataset consists of faces of people with mask. Other set of dataset consists of faces of
ImageNet is a dataset of more than 15 million marked high-goal pictures having a place
with around 22,000 classifications. The pictures were gathered from the web and marked
Beginning in 2010, as a component of the Pascal Visual Object Challenge, a yearly rivalry
called the ImageNet Large-Scale Visual Recognition Challenge (ILSVRC) has been held.
ILSVRC utilizes a subset of ImageNet with approximately 1000 pictures in every one of
1000 classifications. By any means, there are generally 1.2 million preparing pictures,
50,000 approval pictures, and 150,000 testing pictures. ImageNet comprises of variable-
16
goal pictures. Consequently, the pictures have been down-inspected to a proper goal of
256256. Given a rectangular picture, the picture is rescaled and trimmed out the focal
Workflow Diagram:
17
Dataset without facemask:
The Architecture
18
The architecture depicted below is VGG16.
The contribution to cov1 layer is of fixed size 224 x 224 RGB picture. The picture is gone
through a heap of convolutional (conv.) layers, where the channels were utilized with a
tiny responsive field: 33 (which is the littlest size to catch the idea of left/right, up/down,
focus). In one of the setups, it additionally uses 11 convolution channels, which can be
viewed as a straight change of the info channels (trailed by non-linearity). The convolution
step is fixed to 1 pixel; the spatial cushioning of conv. layer input is with the end goal that
the spatial goal is protected after convolution, for example the cushioning is 1-pixel for 33
conv. layers.
Spatial pooling is finished by five max-pooling layers, which follow a part of the conv.
layers (not all the conv. layers are trailed by max-pooling). Max-pooling is performed over a
Three Fully-Connected (FC) layers follow a heap of convolutional layers (which has an
alternate profundity in various models): the initial two have 4096 channels each, the third
performs 1000-way ILSVRC arrangement and hence contains 1000 channels (one for each
19
class). The last layer is the fragile max layer. The design of the completely associated
All secret layers are outfitted with the correction (ReLU) non-linearity. It is likewise noticed
that none of the organizations (with the exception of one) contain Local Response
ILSVRC dataset, yet prompts expanded memory utilization and calculation time.
Configurations
The ConvNet designs are illustrated in figure 2. The nets are alluded to their names (A-E).
All arrangements follow the nonexclusive plan present in engineering and vary just in the
19 weight layers in the organization E (16 conv. what's more, 3 FC layers). The width of
conv. layers (the quantity of channels) is fairly little, beginning from 64 in the primary
layer and afterward expanding by a component of 2 after each maximum pooling layer,
20
Figure: ConvNet Configuration
It is agonizing to prepare.
plate/data transmission).
Because of its profundity and number of completely associated hubs, VGG16 is over
533MB. This makes sending VGG a tedious task.VGG16 is utilized in many profound
21
structures are regularly more alluring (like SqueezeNet, GoogLeNet, and so forth) In any
case, it is an incredible structure block for learning reason as it is not difficult to execute.
Neural Network
Neural networks are a set of calculations enlivened by the working of human brian. By
and large when you open your eyes, what you see is called information and is handled by
the Neurons(data handling cells) in your mind, and perceive what is around you. That is
the way comparative the Neural Networks works. They take an enormous arrangement of
information, process the data(draws out the examples from information), and yields what
it is.
Neural networks, with their astounding capacity to get significance from muddled or
uncertain information, can be utilized to remove designs and recognize patterns that are
too mind-boggling to be in any way seen by one or the other people or other PC strategies.
A prepared neural network can be considered as a specialist in the class of data it has
been given to investigate. This master would then be able to be utilized to give projections
offered new circumstances of interest and response imagine a scenario where questions.
Adaptive learning: A capacity to figure out how to finish undertakings dependent on the
Self-Organization: An ANN can make its own association or portrayal of the data it gets
Network layers
The commonest kind of fake neural organization comprises of three gatherings, or layers,
of units: a layer of info units is associated with a layer of stowed away units, which is
22
Input units:- The action of the info units addresses the crude data that is taken care of
Hidden units:- The movement of each secret unit is dictated by the exercises of the info
units and the loads on the associations between the information and the secret units. this
Output units:- The conduct of the yield units relies upon the movement of the secret
units and the loads between the covered up and yield units. this is additionally called the
yield layer.
you can actually look at a few other Neural networks and their layers here. with the goal
This basic kind of organization is fascinating in light of the fact that the secret units are
allowed to develop their own portrayals of the information. The loads between the
information and secret units decide when each secret unit is dynamic, thus by changing
23
Before we investigate whole/Deep Neural Network gives look access to a solitary neuron.
A Single Neuron
The essential unit of calculation in a neural organization is the neuron, frequently called
as a hub or unit. It gets input from some different hubs, or from an outer source and
processes a yield. Each information has a related weight (w), which is alloted based on its
overall significance to different data sources. The hub applies a capacity f (characterized
The above network takes numerical inputs X1 and X2 and has weights w1 and w2
associated with those inputs. Additionally, there is another input 1 with weight b (called
We are using few python bundles to take our work further. What's more, the principle
bundles that are significant for implementing deep learning project is Tensorflow and
Keras.
24
TensorFlow is a end-to-end open-source stage for AI. Its a complete and adaptable
biological system of apparatuses, libraries and different assets that furnish work
processes with significant level APIs. The system offers different degrees of ideas for you to
pick the one you really want to construct and send AI models.
For example, assuming you want to do some huge AI undertakings, you can utilize the
Distribution Strategy API to perform circulated equipment arrangements and in case you
really want a full creation AI pipeline, you can basically utilize TensorFlow Extended
Hearty ML Production Anywhere: TensorFlow allows you to prepare and send your
control with highlights like the Keras Functional API and Model Subclassing API for the
Keras, then again, is a significant level neural organizations library that is running on the
highest point of TensorFlow, CNTK, and Theano. Utilizing Keras in profound learning
considers simple and quick prototyping just as running consistently on CPU and GPU.
This structure is written in Python code which is not difficult to troubleshoot and permits
ease for extensibility. The main advantages of Keras are described below:
User-Friendly: Keras has a simple, consistent interface optimized for common use
cases which provides clear and actionable feedback for user errors.
Easy To Extend: With the help of Keras, you can easily write custom building
25
Easy To Use: Keras offers consistent & simple APIs which helps in minimizing the
number of user actions required for common use cases, also it provides clear and
26
3. OBSERVATIONS & ANALYSIS
Beofre VGG16
27
Lets evaluate the model.
28
As you can see the exactness of the validation set is around 75-80% so let's attempt to
I have made another consecutive model with every one of the layers of VGG16 aside from
the last thick layer as it gives 1000 results however we want just two. Additionally, I'm not
preparing loads at each layer as the VGG16 is very useful for picture arrangement of
After VGG16
29
As you can see the accuracy has gone to 85% whereas loss is decreasing by each epoch.
30
31
Computer Vision
OpenCV is an extremely renowned library for computer vision and picture handling
undertakings. It is quite possibly the most utilized python open-source library for
thresholding, edge discovery, corner location, forms, picture pyramids, picture division,
32
4. RESULTS
33
34
As you can see the exactness of the validation set is around 75-80% so let's attempt to
I have made another consecutive model with every one of the layers of VGG16 aside from
the last thick layer as it gives 1000 results however we want just two. Additionally, I'm not
preparing loads at each layer as the VGG16 is very useful for picture arrangement of
35
After VGG16
As you can see the accuracy has gone to 85% whereas loss is decreasing by each epoch.
36
37
5. RECOMMENDATIONS /FUTURE DIRECTIONS
and computer vision, its use in detecting COVID-19 face masks in the real world is still
nascent. Face mask detection has been a difficult task in the domain of image processing
especially during the COVID-19 pandemic because of diversified mask types, various
pose variation, shadows, illumination, angle of view, and rotation) , balancing various
expression, lack of real-world dataset, and the storage space required to manage image
database.
This study also deducted that deeper and wider deep learning architectures with
YOLOv3, Xception, and DenseNet are not yet implemented to detect face masks.
Therefore, future work will focus on the implementation of these models as a comparative
Also, from the analysis, we deduced that most of these datasets do not represent the real
world because they are artificially created which ultimately affects the precision accuracy
of the model when deployed in the real world . This is because they are few face mask
datasets were given to us by Excelvisor Technologies LLP for training deep learning and
machine learning models to detect COVID-19 face masks. This influences the
performance of deep learning and machine learning models, especially when deployed in
machine learning models rely on datasets for training, accuracy, and extracting
meaningful insights.
38
The study deducted that most of the datasets used to detect face masks are static in
nature, do not represent most of the real-world environments which ultimately affect the
precision accuracy of the model. This influences the performance of deep learning and
machine learning models, especially when deployed in dynamic environments and various
inevitable in the future , therefore, there is a need for sharing real-world COVID-19 face
mask images for modelling deep learning techniques. The future work may focus on
strategies ways to share real-world COVID-19 face mask images for modelling deep
learning techniques which will further assist develop high precision real-time automatic
face masks detection systems. Such systems could be deployed in dynamic environments
and various facemask-wearing conditions. Also, future work may apply deeper and wider
inception5h, Mask R-CNN, Faster R-CNN, YOLOv4, Xception, and DenseNet are not yet
39
6. CONCLUSION
Gathered the datasets of individuals with and without facemask from Excelvisor
model utilizing the datasets. The assembled model is stacked. Cameras are turned on.
CV2 identifies faces, faces are separated. We have built our model and it is utilized to
distinguish the facemasks. In the event that the cover isn't distinguished, it catches the
Our review not just screens an individual who doesnt wear a veil, yet additionally let the
experts in on who are not wearing it, so that move can be made quickly, which is
significant for the anticipation of irresistible infections, i.e Covid in people in general.
This research focuses on the face recognition of a person wearing a mask. The
coronavirus pandemic forces us to continue to carry out health protocols, namely wearing
masks when on the move, especially working. We propose the use of transfer learning
techniques for facial feature extraction and classification according to identity. The
results showed that the VGG16 transfer learning model was better than CNN, with an
accuracy of 85%. These results indicate that using the webcam of our system.
These results indicate that using the VGG16 model is better in classifying 35 different
people's identities. This study also uses only one deep learning model, which is
undoubtedly more efficient than previous studies using two deep learning models. The
40
accuracy value also increased by 0.92% compared to previous studies. Future research
can be developed on real-time video data so that the data processing speed can be known.
LEARNING OUTCOME
It's anything but a stretch to say temporary jobs have become vital. The opposition for
occupations has never been stiffer. In late examinations, businesses have demonstrated a
draw towards those with pertinent experience before graduate versus those without. So
Internship give you understanding into your dream industry, organization, develop your
pragmatic information and give you an upper hand over your companions. Sounds
As an intern, don’t expect to spearhead a critical project right off the bat…at least not yet.
In the start of internship, we took time essentially attempting to figure out how the
organization functions. we did shadow a work that get a comprehension of the job.
Following a day or a couple of long stretches of learning the intricate details of the
Occasion dealing with: Interns are frequently approached to regulate the planning of
significant occasions. You may requested to assist with getting everything ready for a
41
significant. From tying down the area to helping the making of a topic to obtaining your
key speakers.
Research: Interns straight from a college degree have a lot of exceptional information.
Your association might effectively utilize this information by setting you in an exploration
job. You might be approached to investigate another task and give your suggestions on
ANNEXURE
SPECIFICATIONS
HARDWARE
PC-
CPU: Processor above Intel Core i5, i7, 5th, 7th Generation.
SOFTWARE
Web Brower: installed any web Brower in your PC like Chrome, Fire Fox or any
Python IDLE
Jupyter Notebook
Technology used:
Python is a deciphered undeniable level broadly useful programming language. Its plan
theory accentuates code clarity with its utilization of critical space. Its language builds
just as its item arranged methodology expect to assist developers with composing clear,
42
Jupyter Notebook/ Spyder:
The Jupyter Notebook/ Spyder is an open-source web application that permits you to
make and share records that contain live code, conditions, perceptions and story text.
PROGRAM : Code
import os
import random
import shutil
import tensorflow as tf
import numpy as np
43
TRAINING_DIR = r"C:\Users\sipan\OneDrive\Desktop\Excelvisor\Intern_Project\Real
project\train\train"
VALIDATION_DIR = r"C:\Users\sipan\OneDrive\Desktop\Excelvisor\Intern_Project\Real
project\test\test"
train_datagen = ImageDataGenerator(rescale=1.0/255,
rotation_range=40,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
horizontal_flip=True,
fill_mode='nearest')
train_generator = train_datagen.flow_from_directory(TRAINING_DIR,
batch_size=10,
target_size=(224, 224),
class_mode='categorical')
validation_datagen = ImageDataGenerator(rescale=1.0/255)
validation_generator = validation_datagen.flow_from_directory(VALIDATION_DIR,
batch_size=4,
shuffle=False,
target_size=(224, 224),
44
class_mode='categorical')
checkpoint = ModelCheckpoint('model-
{epoch:03d}.model',monitor='val_loss',verbose=0,save_best_only=True,mode='auto')
model = tf.keras.models.Sequential([
tf.keras.layers.MaxPooling2D(2,2),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(2, activation='softmax')
])
opt = optimizers.Adam(learning_rate=0.001)
model.summary()
history = model.fit(train_generator,
epochs=5,
validation_data=validation_generator
,callbacks=[checkpoint])
45
loss = history.history['loss']
val_loss = history.history['val_loss']
acc = history.history['acc']
val_acc = history.history['val_acc']
# plotting accuracy
plt.xlabel('Epochs')
plt.ylabel('Accuracy')
plt.legend()
plt.show()
# plotting loss
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.show()
46
We are going to use VGG16 model here
vgg16_model=tf.keras.applications.vgg16.VGG16()
type(vgg16_model)
2. The last Dense layer in VGG16 has 1000 ouputs but we need only two
# So we will create a blank sequential model and then add layers from VGG16 except last
one
improved_model =tf.keras.models.Sequential()
improved_model.add(layer)
improved_model.summary()
# By Default the VGG16 layers are well trained for image classification so no need to
layer.trainable=False
improved_model.add(tf.keras.layers.Dense(2, activation='softmax'))
opt = optimizers.Adam(learning_rate=0.001)
47
improved_model.compile(optimizer=opt, loss='categorical_crossentropy', metrics=['acc'])
improved_model.summary()
history = improved_model.fit(train_generator,
epochs=10,
validation_data=validation_generator
,callbacks=[checkpoint])
loss = history.history['loss']
val_loss = history.history['val_loss']
acc = history.history['acc']
val_acc = history.history['val_acc']
# plotting accuracy
plt.xlabel('Epochs')
plt.ylabel('Accuracy')
plt.legend()
plt.show()
# plotting loss
48
plt.plot(epochs, loss, color='orange', label='Training')
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.show()
import cv2
color_dict={0:(0,255,0),1:(0,0,255)}
size = 4
frame_width = int(webcam.get(3))
frame_height = int(webcam.get(4))
49
result1 = cv2.VideoWriter('capture.avi',
cv2.VideoWriter_fourcc(*'MJPG'),
10, size1)
classifier = cv2.CascadeClassifier(r'C:/Users/sipan/anaconda3/Lib/site-
packages/cv2/data/haarcascade_frontalface_default.xml')
while True:
faces = classifier.detectMultiScale(mini)
for f in faces:
50
resized=cv2.resize(face_img,(224,224))
normalized=resized/255.0
reshaped=np.reshape(normalized,(1,224,224,3))
reshaped = np.vstack([reshaped])
result=improved_model.predict(reshaped)
label=np.argmax(result,axis=1)[0]
cv2.rectangle(im,(x,y),(x+w,y+h),color_dict[label],2)
cv2.rectangle(im,(x,y-40),(x+w,y),color_dict[label],-1)
(255,255,255),2)
result1.write(im)
cv2.imshow('LIVE', im)
key = cv2.waitKey(10)
break
# Stop video
webcam.release()
result1.release()
cv2.destroyAllWindows()
51
REFERENCES
3. W. Liu, Z. Wang, X. Liu, N. Zeng, Y. Liu, F.E. Alsaadi, A survey of deep neural
4. Yang xin, Lingshuang Kong, Zhi Liu, Yuling Chen, Yanmiao Li, Hongliang Zhu, et
al., "Machine Learning and Deep Learning Methods for Cyber security", IEEE
5. Yann LeCun, Yoshua Bengio and Geoffrey Hinton, "Deep Learning", NATURE, vol.
52