You are on page 1of 42

SIX WEEKS INDUSTRIALTRAINING REPORT

On

Artificial Intelligence from Beat The Virus

at

1STOP
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE AWARD

OF THE DEGREE OF

BACHELOR OF TECHNOLOGY

(Electronics and Communication Engineering)

SUBMITTED BY:

NAME : Harshit Yadav

UNIVERSITY ROLL NO. : 1915170

JUNE, 2021
DEPARTMENT OFELECCTRONICS AND COMMUNICATION ENGINEREING

CHANDIGARH ENGINEERING COLLEGE JHANJERI, MOHALI


CANDIDATE’S DECLARATION

1. I “HARSHIT YADAV” hereby declare that I have undertaken Six Weeks Industrial Training at “1STOP”
during a period from 10/07/2021 to 10/09/2021 . The project entitled “Artificial Intelligence from Beat The Virus”
submitted by HARSHIT YADAV, 1915170 in partial fulfillment of the requirement for the award of degree of the B.
Tech. (Electronics and Communication Engineering) submitted in Chandigarh Engineering College Jhanjeri, Mohali is
an authentic record of my own work carried out during Six Weeks Industrial Training. The matter presented in this
project has not formed the basis for the award of any other degree, diploma, fellowship or any other similar titles.

Signature of the Student


Place: ONLINE
Date:26/9/2021

i
CERTIFICATE OF TRAINING COMPLETION
CERTIFICATE OF TRAINING PARTICIPATION
ACKNOWLEDGEMENT

I express my sincere gratitude to the I. K. Gujral Punjab Technical University, Jalandhar, Kapurthala for
giving me the opportunity to undergo Six Weeks Industrial Training after my 4th Semester of B.Tech.
(ECE)

I would like to thank Mr. Rajnesh Talwar , Director and Mr.SAJJAN SINGH Head of Department, ECE
at Chandigarh Engineering College Jhanjeri, Mohali for their kind support.

I also owe my sincere gratitude towards Ms.Malika Arora for his/her valuable advice and healthy
criticism throughout my training which helped me immensely to complete my work successfully.

I would also like to thank everyone who has knowingly and unknowingly helped me throughout my work.

Last but not least, a word of thanks for the authors of all those books and papers which I have consulted
during my training as well as for preparing the report.

Harshit Yadav
ABSTRACT

AI research has focused on improving the decision-making capabilities


of computers, i.e., the ability to select high-quality actions in pursuit of a
given objective. When the objective is aligned with the values of the
human race, this can lead to tremendous benefits. When the objective is
misaligned, improving the AI system’s decision-making may lead to
worse outcomes for the human race. The objectives of the proposed
research are (1) to create a mathematical framework in which
fundamental questions of value alignment can be investigated; (2) to
develop and experiment with methods for aligning the values of a
machine (whether explicitly or implicitly represented) with those of
humans; (3) to understand the relationships among the degree of value
alignment, the decision-making capability of the machine, and the
potential loss to the human; and (4) to understand in particular the
implications of the computational limitations of humans and machines
for value alignment. The core of our technical approach will be a
cooperative, game-theoretic extension of inverse reinforcement learning,
allowing for the different action spaces of humans and machines and the
varying motivations of humans; the concepts of rational metareasoning
and bounded optimality will inform our investigation of the effects of
computational limitations.

iv
Table of Contents

Declaration of the Student i


Certificate ii
Acknowledgement iii
Abstract iv

1. INTRODUCTION 2-9
1.1 Organization/website Profile
1.2 Introduction of Project
1.3 Problem Definition
1.4 Limitation of Existing System
1.5 Objective of Project
1.6 Introduction of the technology
2. PROJECTS UNDERTAKEN 10-13
2.1 Objectives
2.2 Feasible study
2.3. Software Requirement Specification
2.4 Hardware Specification
2.5 Software Specification

3. DEVELPOMENT ENVIRONMENT 14-20


3.1 Introduction to Front End
3.2 Introduction to Back End
4. SYSTEM DESIGN 14-23
4.1 Software Analysis
4.2 Flowchart
4.3 Description of used model
4.4 DFDs
4.5 ER Diagram
4.6 Use Case Diagram


4.7 Snapshots
5. IMPLEMENTATION AND TESTING 24-35
5.1 Testing 6
5.2 Implementation and running project Screenshot CONCLUS
IONS

7. REF
ERE
NCE
S

8. APP
ENDI
CES


INTRODUCTION
1stop is a strong platform with immense potential for students from anywhere and anytime to
access cutting-edge Mentorship and Certification Program widespread with a larger number of
domains and niches to explore learning. E-learning has been the fastest growing way for an
aspirant to start their journey into pursuing their Dream Career.

Our Vision lies to bring in a technology-oriented career-driven Industrial Experience into the
aspirant’s career with Great Value.

“Learn, Grow, Prosper


2 Introduction of The Project

The MNIST handwritten digit classification problem is a standard dataset used in computer
vision and deep learning.

Although the dataset is effectively solved, it can be used as the basis for learning and practicing
how to develop, evaluate, and use convolutional deep learning neural networks for image
classification from scratch. This includes how to develop a robust test harness for estimating the
performance of the model, how to explore improvements to the model, and how to save the
model and later load it to make predictions on new data.


WHAT IS UN-SUPERVISED LEARNING ?▪

Unsupervised learning allows us to approach problems with little or no idea what


our results should look like that is you only have input data (X) and no
corresponding output variables.▪We can derive structure from data where we
don't necessarily know the effect of the variables.

GOAL OF USING UN-SUPERVISED LEARNING

The goal for unsupervised learning is to model the underlying structure or distribution
in the data in order to learn more about the data and all this is done without any
supervision or direction unlike supervised learning▪The model is given a dataset
which is neither labelled nor classified. The model explores the data and draws
inferences from datasets to define hidden structures from unlabelled dataGOAL OF
USING UN-SUPERVISED LEARNING

TYPES IN UN-SUPERVISED LEARNINGN-Supervised


learning can be split into two subcategories :Clustering and association
CLUSTERING
ASSOCIATION


1.1
2 EXAMPLE OF UN-SUPERVISED LEARNING
3 we can see that even without labels, the algorithm was able to sort the data based
on the structures it identified this is achieved by unsupervised learning
4 APPLICATIONS OF UN-SUPERVISED LEARNING
•Customer Segmentation
5 •Search Engines
6 •identification of cancer cells
7 •Handwritten digit recognition
8 •Clustering used in Search engines


WHAT IS TENSORFLOW?TensorFlow is an
open source machine learning platform developed by Google.
It has a JavaScript library for deploying machine learning
models in the browser, a lite version for mobile and IoT
devices, and an extended version for large production
environments.

WHAT IT DOES ?1.Tensorflowprovides


several add-on libraries and resources to deploy your
production models anywhere. 2.Through multiple
levels of abstraction, tensorflowgives you an easy
and flexible model building experience suitable for
both experts and beginners.3.By using high-
performance APIs, you have full control of your
advanced models to quickly debug or effortlessly
prototype these models.
TENSOR FLOW POSSESSED TOOLS
TensorFlow possessed multiples tools to produce
machine learning
systems:•TensorFlow(dah)•TensorFlow.js•TensorFlo
w liteto deploy machine learning model in an
embedded system•TensorFlow Extendedto
productizing machine learning pipeline•TensorFlow
Quantuma “library for rapid prototyping of hybrid
quantum-classical ML models”

8.1 LIMITATIONS

TensorFlow, how to build a ML


model?To interact with TensorFlow, one of the most
popular API is the Python one (and to be honest that’s
the one that I am the more comfortable

TensorFlow, how to build a ML


model?To interact with TensorFlow, one of the most
popular API is the Python one (and to be honest that’s
the one that I am the more comfortable
•tensorflow.keras.datasetsProvides the data sets
required like mnistdataset for that we need to use this
:tf.keras.datasets.mnist.load_data()•from
tensorflow.keras.modelsimport SequentialWe import
models this way•from tensorflow.keras.layersimport
Dense, Conv2D, Dropout, Flatten, MaxPooling2DWe
import layers by above line


8.2 OBJECTIVE OF THE PROJECT

Student Management System is software which is helpful for


college as well as the school authorities. In the current system
all the activities are done manually. It is very time consuming
and costly. Our Student Management System deals with the
various activities related to managing student records. Our
Objective is computerizing the process of student records
management.


8.3 INTRODUCTION OF THE TECHNOLOGY

LANGUAGE:- Python

Python is a widely used general-purpose, high level programming language. It was


initially designed by Guido van Rossum in 1991 and developed by Python Software
Foundation. It was mainly developed for emphasis on code readability, and its syntax
allows programmers to express concepts in fewer lines of code.
Python is a programming language that lets you work quickly and integrate systems
more efficiently.
Python is dynamically typed and garbage-collected. It supports multiple programming
paradigms, including procedural, object-oriented, and functional programming.
Python is often described as a "batteries included" language due to its
comprehensive standard library.

Tkinter

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to
the Tk GUI toolkit, and is Python's de facto standard GUI.Tkinter is included with
standard Linux, Microsoft Windows and Mac OS X installs of Python.

The name Tkinter comes from Tk interface. Tkinter was written by Fredrik Lundh.

XAMMP:

XAMPP is a cross-platform web server that is free and open-source. XAMPP is a short
form for Cross-Platform, Apache, MySQL, PHP, and Perl. XAMPP is a popular
cross- platform web server that allows programmers to write and test their code on
a local web server. It was created by Apache Friends, and the public can revise or
modify its native source code. It includes MariaDB, Apache HTTP Server, and
interpreters for PHP and Perl, among other computer languages. Because of XAMPP’s
simplicity of deployment, a developer can quickly and easily install a WAMP or
LAMP stack on an operating system, with the added benefit that common add-in
apps like WordPress and Joomla can also be loaded.


Database

MySQL
MySQL is a powerful, open source object-relational database system with over 30
years of active development that has earned it a strong reputation for reliability,
feature robustness, and performance.
MySQL is an advanced, enterprise class open source relational database that supports
both SQL (relational) and JSON (non-relational) querying. It is a highly stable
database management system, backed by more than 20 years of community
development which has contributed to its high levels of resilience, integrity, and
correctness. MySQL is used as the primary data store or data warehouse for many
web, mobile, geospatial, and analytics applications.

MySQL has a rich history for support of advanced data types, and supports a level of
performance optimization that is common across its commercial database counterparts,
like Oracle and SQL Server. AWS supports MySQL through a fully managed
database service with Amazon Relational Database Service (RDS). Amazon
Aurora with MySQL compatibility is also built using MySQL.
MySQL comes with many features aimed to help developers build applications,
administrators to protect data integrity and build fault-tolerant environments, and help
you manage your data no matter how big or small the dataset. In addition to being free
and open source, MySQL is highly extensible. For example, you can define your own
data types, build out custom functions, even write code from different programming
languages without recompiling your database.


2. PROJECT OVERVEIW
Student management systems serve academic institutions in a variety of ways, the
most important of which is centralized data administration and accessibility. Teachers
will be able to input, maintain, and access student data more simply. Parents and
guardians have a better understanding of how their children perform in class.

Teacher and other school or college professionals must enhance their student
management skills over time. It is defined as a collection of skills that every teacher
develops through time in order to properly manage their students. Getting into the
student’s heart is one of the most important aspects of management.

2.1 Objectives

Our product is a student management system that gives all the services
that must be provided to a student over the internet to find fee details
provided by that administrator of the college.

This product contains each and every data regarding student, payment etc.,
personal details which can be updated by the student and viewed by the
administrator. It provides detailed information about the fee details and
the location (place) of college. Our product is a subpart of the university
management system.

Our Student Management System product usage makes work done at the
faster way the software is applicable to view the fee details provided by
the administrator of the organization and student can edit his personal
details which can be viewed by the administrator.

10
2.2 FEASIBILITY ANALYSIS

Whatever we think need not be feasible. It is wise to think about the feasibility of any
problem we undertaken, feasibility is the study of impact, which happens in the
organization by the development of a system. The impact can be either positive or
negative. Then the positives nominate the negatives, then the system is considered
feasible. The feasibility study can be performed in two ways such as technical
feasibility and economical feasibility.

Technical Feasibility:

We can strongly says that it is technically feasible, since there will not be much
difficulty in getting required resources for the development and
maintaining the system as well. All the resources needed for the development of the
software as well as the maintenance of the same is available in the organization here
we are utilizing the resources which are available already.

Economical Feasibility:

Development of this application is highly economically feasible. The organization


needed not spend much money for the development of the
system already available. The only thing is to be done is making an environment for
the development with an effective supervision. If we are doing so,
we can attain the maximum usability of the corresponding resources.
Even after the development, the organization will not be in condition to invest more in
the organization .Therefore, the system is economically feasible.

Operational Feasibility:

Operational feasibility is the measure of how well a proposed system solves the
problems, and takes advantage of the opportunities identified during scope definition
and how it satisfies the requirements identified in the requirements analysis phase of
system development.
The operational feasibility assessment focuses on the degree to which the proposed
development project fits in with the existing business environment and objectives
with regard to development schedule, delivery date, corporate culture and existing
business processes.

11
2.3 SOFTWARE REQUIREMENT SEPCIFICATION
2.3.1 FUNCTIONAL REQUIREMENTS OF STUDENT
MANAGEMENT SYSTEM.
● Register new students.
● Record the attendance of students.
● Record the internal marks of students.
● Record the feed details of students.
● Register a new teacher/employee.
● Register a new user for the system.
● Record the salary details of employees.
● Record the course details and subject information.
● Record the scholarship details and information.
● Generate various reports for all transactions in the system.

2.3.2 NONFUNCTIONAL REQUIREMENTS

Performance Requirements

The proposed system that we are going to develop will be used as the
Chief performance system for providing help to the organization in
managing the whole database of the students studying in the organization.
Therefore, it is expected that the database would perform functionally all
the requirements that are specified.

Safety Requirements

If there is extensive damage to a wide portion of the database due to


catastrophic failure, such as a disk crash, the recovery method restores a past
copy of the database that was backed up to archival storage (typically tape) and
reconstructs a more current state by reapplying or redoing the operations of
committed transactions from the backed up log, up to the time of failure.

12
Security Requirements

Security systems need database storage just like many other applications.
However, the special requirements of the security market mean that vendors
must choose their database partner carefully.

2.4 HARDWARE REQUIREMENT

 Pentium IV processor or higher


 128 MB RAM(or above)
 40 GB or more HARDDISK
 Mouse/Keyboard

2.5 SOFTWARE REQUIREMENT

 OS-Windows 7/8/10
 Python Interpreter
 Pycharm IDE or VS code
 Xampp (For Mysql) or Mysql Workbench

13
3. DEVELOPMENT ENVIOURMENT

3.1 FRONT END DESCRIPTION

Front end development means the development of the visualization of the


software which is user friendly rather than back end. In front end I used
python and its modules for better visualization so that a person which is
do not have any technical background can use this software without any
difficulty You can see from the visuals that I used tkinter which is a
python programming module which is used to develop Graphical User
interface.

3.2 BACK END DISCRIPTION

Back end Development is the term for the behind-the-scenes activities


that happens when you do anything on a application. It is mostly referred
to the server-side of an application and everything that communicates
between the database and the front end/browser. You can also say that it’s
the server side of development that focuses primarily on how the
application works.

14
4. SYSTEM DESIGN

4.1 SOFTWARE ANALYSIS

Software Development Life cycle

Fig:- SDLC

15
16
4.3 DESCRIPTION OF USED MODEL
The Waterfall Model

The Waterfall model is a sequential software development process, in which progress


is seen as flowing steadily downwards (like a waterfall) through the phases of
Conception, Initiation, Analysis, Design (validation), Construction, Testing and
Maintenance.
To follow the waterfall model, one proceeds from one phase to the next in a
sequential manner. For example, one first completes requirements specification,
which after sign-off are considered "set in stone." When the requirements are fully
completed, one proceeds to design. The software in question is designed and a
blueprint is drawn for implementors (coders) to follow — this design should be a
plan for implementing the requirements given. When the design is fully completed, an
implementation of that design is made by coders. Towards the later stages of this
implementation phase, separate software components produced are combined to
introduce new functionality and reduced risk through the removal of errors.
Thus the waterfall model maintains that one should move to a phase only when its
preceding phase is completed and perfected. However, there are various modified
waterfall models (including Royce's final model) that may include slight or major
variations upon this process. Time spent early in the software production cycle can
lead to greater economy at later stages. It has been shown that a bug found in the early
stages (such as requirements specification or design) is cheaper in terms of money,
effort and time, to fix than the same bug found later on in the process. To take an
extreme example, if a program design turns out to be impossible to implement, it is
easier to fix the design at the design stage than to realize months later, when program
components are being integrated, that all the work done so far has to be scrapped
because of a broken design.
This is the central idea behind the waterfall model - time spent early on making sure
that requirements and design are absolutely correct will save you much time and
effort later. Thus, the thinking of those who follow the waterfall process goes, one

17
should make sure that each phase is 100% complete and absolutely correct before
proceeding to the next phase of program creation. Program requirements should be set
in stone before design is started (otherwise work put into a design based on incorrect
requirements is wasted); the program's design should be perfect before people begin
work on implementing the design (otherwise they are implementing the wrong design
and their work is wasted), etc.

A further argument for the waterfall model is that it places emphasis on


documentation (such as requirements documents and design documents) as well as
source code. In less designed and documented methodologies, should team members
leave, much knowledge is lost and may be difficult for a project to recover from.
Should a fully working design document be present (as is the intent of Big Design Up
Front and the waterfall model) new team members or even entirely new teams should
be able to familiarize themselves by reading the documents.
Basic principles of the waterfall model are:
Project is divided into sequential phases, with some overlap and splash back
acceptable between phases.
Emphasis is on planning, time schedules, target dates, budgets and implementation of
an entire system at one time.
Tight control is maintained over the life of the project through the use of extensive
written documentation, as well as through formal reviews and approval/signoff by the
user and information technology management occurring at the end of most phases
before beginning the next phase.

18
4.4 DATA FLOW DIAGRAM

The DFD takes an input-process-output view of a system. That is, data


objects flow into the software, are transformed by the processing
elements, and resultant data objects flow out of the software. Data objects
are represented by labeled arrows and transformations are represented by
circles. The DFD is represented in a hierarchical fashion. The first DFD
represents the system as a whole. Subsequent data flow diagrams provide
increasing detail with each subsequent level.

The data flow diagram enables the software engineer to develop models
of the information domain and functional domain at the same time. As the
DFD is refined into levels of greater detail, the analysts perform an
implicit functional decomposition of the system. Also DFD refinement
results in a corresponding
refinement of data as it moves through the processes that embody the
application.

19
Fig:- Zero (0) Level

20
4.5 ER DIAGRAM

Fig: ER DIAGRAM

21
4.6 USE CASE DIAGRAM

22
4.7 SNAPSHOTS

23
5. IMPLEMENTATION AND TESTING

5.1 TESTING

Testing is more than just debugging. The purpose of testing can be quality
assurance, verification and validation, or reliability estimation. Correctness
testing and reliability testing are two major areas of testing. Software testing
is a trade-off between budget, time and quality.

Software Testing

Software Testing is the process of executing a program or system with the


intent of finding errors. Or, it involves any activity aimed at evaluating an
attribute or capability of a program or system and determining that it meets its
required results. Software is not unlike other physical processes where inputs
are received and outputs are produced. Where software differs is in the
manner in which it fails. Unlike most physical systems, most of the defects in
software are design errors, not manufacturing defects.

To improve quality

As computers and software are used in critical applications, the outcome of a


bug can be severe. Bugs can cause huge losses.

For Verification & Validation (V&V)

Another important purpose of testing is verification and validation (V&V). It


is heavily used as a tool in the V&V process. Testers can make claims based
on interpretations of the testing results, which either the product works under
certain situations, or it does not work.

Software Testing Types

Black-box testing

The black-box approach is a testing method in which test data are derived
from the specified functional requirements without regard to the final program
structure. It is also termed data-driven, input/output driven or requirements-
based testing. A testing method emphasized on executing the functions and

24
examination of their input and output data.

White-box testing

Contrary to black-box testing, software is viewed as a white-box, or glass-


box in white-box testing, as the structure and flow of the software under test
are visible to the tester. This testing is based on knowledge of the internal
logic of an application’s code. Testing plans are made according to the details
of the software implementation, such as programming language, logic, and
styles. Test cases are derived from the program structure. White-box testing is
also called glass-box testing, logic-driven testing or design-based testing .

Unit testing

This involves testing of individual software components or modules. Typically


done by the programmer and not by testers, as it requires detailed knowledge
of the internal program design and code.

System testing

Entire system is tested as per the requirements. Black-box type testing that is
based on overall requirements specifications, covers all combined parts of
a system.

End-to-end testing

Similar to system testing, involves testing of a complete application


environment in a situation that mimics real-world use, such as interacting with
a database, using network communications, or interacting with other hardware,
applications, or systems if appropriate.

Usability testing

User-friendliness check. Application flow is tested, Can new user understand


the application easily, Proper help documented whenever user stuck at any
point. Basically system navigation is checked in this testing.

Install/uninstall testing
Tested for full, partial, or upgrade install/uninstall processes on different
operating systems under different hardware, software environment.

25
Recovery testing

Testing how well a system recovers from crashes, hardware failures, or other
catastrophic problems.

Security testing

Can system be penetrated by any hacking way. Testing how well the system
protects against unauthorized internal or external access. Checked if system,
database is safe from external attacks.

Compatibility testing

Testing how well software performs in a particular


hardware/software/operating system/network environment and different
combination s of above.

Comparison testing

Comparison of product strengths and weaknesses with previous versions


or other similar products.

Alpha testing

In house virtual user environment can be created for this type of testing.
Testing is done at the end of development. Still minor design changes may be
made as a result of such testing.

Beta testing

Testing typically done by end-users or others. Final testing before releasing


application for commercial purpose.

26
5.2 Implementation and running project
Screenshots…

SOURCE CODE 1
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "cnn classificatoin.ipynb",
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "A6uqMFX-QHFl",
"outputId": "dc216cd8-9423-4583-bb2f-c6813ffdc910"
},
"source": [
"import tensorflow as tf\r\n",
"(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()\r\n",
"x_train.shape"
],
"execution_count": 3,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"(60000, 28, 28)"
]
},
"metadata": {
"tags": []
},
"execution_count": 3
}
]
34
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "w62pBB6WT7Op",
"outputId": "03de3995-a41f-4da2-e9fd-581efe19f829"
},
"source": [
"import matplotlib.pyplot as plt\r\n",
"%matplotlib inline\r\n",
"fig, axs = plt.subplots(4, 4, figsize = (20, 20))\r\n",
"plt.gray()\r\n",
"for i, ax in enumerate(axs.flat):\r\n",
"    ax.matshow(x_train[i])\r\n",
"    ax.axis('off')\r\n",
"    ax.set_title('Number {}'.format(y_train[i]))\r\n",
"fig.show()\r\n",
"\r\n"
],
"execution_count": 9,
"outputs": [
{
"output_type": "display_data",
"data": {
"image/png": "text/plain": [
"<Figure size 1440x1440 with 16 Axes>"
]
},
"metadata": {
"tags": [],
"needs_background": "light"
}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "sOwf-Bau6KdV"
},
"source": [
""
]
},
{
34
"cell_type": "code",
"metadata": {
"id": "jVbanpv2Qnrt"
},
"source": [
"x_train = x_train.reshape(x_train.shape[0], 28, 28, 1)\r\n",
"x_test = x_test.reshape(x_test.shape[0], 28, 28, 1)\r\n",
"input_shape = (28, 28, 1)\r\n"
],
"execution_count": 10,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "hi31ZKC214FZ",
"outputId": "20b84fe9-4f17-4a52-d5d9-d29f4986b8ea"
},
"source": [
"x_train = x_train.astype('float32')\r\n",
"x_test = x_test.astype('float32')\r\n",
"x_train /= 255\r\n",
"x_test /= 255\r\n",
"print('x_train shape:', x_train.shape)\r\n",
"print('Number of images in x_train', x_train.shape[0])\r\n",
"print('Number of images in x_test', x_test.shape[0])"
],
"execution_count": 11,
"outputs": [
{
"output_type": "stream",
"text": [
"x_train shape: (60000, 28, 28, 1)\n",
"Number of images in x_train 60000\n",
"Number of images in x_test 10000\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "xGTpAYoZQvh_"
},
"source": [
34
"from tensorflow.keras.models import Sequential\r\n",
"from tensorflow.keras.layers import Dense, Conv2D, Dropout, Flatten, MaxPooling2D\r\n",
"model = Sequential()\r\n",
"model.add(Conv2D(28, kernel_size=(3,3), input_shape=input_shape))\r\n",
"model.add(MaxPooling2D(pool_size=(2, 2)))\r\n",
"model.add(Flatten()) \r\n",
"model.add(Dense(128, activation=tf.nn.relu))\r\n",
"model.add(Dropout(0.2))\r\n",
"model.add(Dense(10,activation=tf.nn.softmax))"
],
"execution_count": 12,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "PJ-V1KPdQ1W7",
"outputId": "3cbec4e7-9a4e-463d-a433-2aa3a75f52ca"
},
"source": [
"model.compile(optimizer='adam', \r\n",
"              loss='sparse_categorical_crossentropy', \r\n",
"              metrics=['accuracy'])\r\n",
"model.fit(x=x_train,y=y_train, epochs=1)"
],
"execution_count": 16,
"outputs": [
{
"output_type": "stream",
"text": [
"1875/1875 [==============================] - 30s 16ms/step - loss: 0.0550 - accuracy:
0.9827\n"
],
"name": "stdout"
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<tensorflow.python.keras.callbacks.History at 0x7fb9b426ea90>"
]
},
"metadata": {
"tags": []
},
"execution_count": 16
34
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "QwYRSf0vRKWd",
"outputId": "89eef82e-5d71-47e9-cd3e-fa06ad0079a1"
},
"source": [
"model.evaluate(x_test, y_test)"
],
"execution_count": 19,
"outputs": [
{
"output_type": "stream",
"text": [
"313/313 [==============================] - 2s 6ms/step - loss: 0.0544 - accuracy:
0.9831\n"
],
"name": "stdout"
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"[0.05435193330049515, 0.9830999970436096]"
]
},
"metadata": {
"tags": []
},
"execution_count": 19
}
]
}
]
}

34
35
6. CONCLUSION

1. The project entitled “Hand Written Digit Classification with CNN


” is developed using AI-ML and using basics of python(3.8.6
version)This project covers only the basic features required.

7. REFERENCES

 Wikipedia
 https://www.geeksforgeeks.org/python-gui-tkinter/

 https://www.javatpoint.com/python-tkinter

https://www.1stop.ai/projects

36
8. APPENDICES

8.1 FUTURE ENHANCEMENT

 Visually Coherent Image Mix-up for Object


Detection (+3.55% mAP Boost)
 Data Pre-processing 
 Training Scheduler Revamping 
 Synchronized Batch Normalization

37

You might also like