0% found this document useful (0 votes)
2 views

python microproject

The document outlines a micro-project proposal focused on developing a Handwritten Digit Recognition program using Python. It details the project's aim, action plan, required resources, and the actual procedure followed, including the use of Keras and TensorFlow for model training. Additionally, it includes an evaluation sheet for assessing the project's components and student performance.

Uploaded by

Kunal Kanoja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

python microproject

The document outlines a micro-project proposal focused on developing a Handwritten Digit Recognition program using Python. It details the project's aim, action plan, required resources, and the actual procedure followed, including the use of Keras and TensorFlow for model training. Additionally, it includes an evaluation sheet for assessing the project's components and student performance.

Uploaded by

Kunal Kanoja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Micro-Project Proposal-A

For 6th semester

Handwritten Digit Recognition


1.0 Brief Introduction:
Python is a high-level, interpreted, general-purpose programming language. Its
design philosophy emphasizes code readability with the use of significant
indentation.

Python is dynamically-typed and garbage-collected. It supports multiple


programming paradigms, including structured (particularly procedural),
objectoriented and functional programming. It is often described as a "batteries
included" language due to its comprehensive standard library.

Guido van Rossum began working on Python in the late 1980s as a successor to
the ABC programming language and first released it in 1991 as Python 0.9.0.
Python 2.0 was released in 2000 and introduced new features such as list
comprehensions, cycle-detecting garbage collection, reference counting, and
Unicode support. Python 3.0, released in 2008, was a major revision that is not
completely backward-compatible with earlier versions. Python 2 was
discontinued with version 2.7.18 in 2020.

Python consistently ranks as one of the most popular programming languages

2.0 Aim of the Micro-Project:

To develop a program of Handwritten digit recognition using python.

The main objective of the Project interface is to know functioning of


Recognition of Handwritten digits.
3.0 Action Plan:
Sr No. Details of activity Planned Start Planned Name of Responsible
Date Finish Date team member

1. Searching for topic 20/4/2022 20/4/2022


2. Surveying Information 21/4/2022 21/4/2022 PRAJWAL WAGHMARE
3. Requirement Analysis 22/4/2022 22/4/2022
4. Finalizing Layout 23/4/2022 23/4/2022
5. Generating Program and Final 25/4/2022 25/4/2022
Execution
6. Report Generation 27/4/2022 27/4/2022
7. Final submission

4.0 Resources required


Sr.No. Name of Resources/material Specification Quantity Remarks

1 Computer system Any desktop/laptop with One computer system


Linux distribution for each student

2 Office software Package MS office or Libre Not applicable


Office
3 Software required Google colab /Pycharm Community Version

Micro-Project Proposal-B
For 6th semester
Handwritten digit recognition

1.0 Brief Introduction:

Python is a high-level, interpreted, general-purpose programming


language. Its design philosophy emphasizes code readability with the use
of significant indentation.

Hangman is a guessing game for two or more players. One player thinks
of a word, phrase or sentence and the other(s) tries to guess it by
suggesting letters within a certain number of guesses. Originally a
Paperand-pencil game, there are now electronic versions.

Python consistently ranks as one of the most popular programming


languages

2.0 Aim of the Micro-Project:

1) To develop a program of Handwritten digit recognition using python. 2) The


main objective of the Project interface is to know functioning of Recognition of
Handwritten digits.

3.0 Course Outcomes Integrated:

• Display message on screen using Python script on IDE. 

Develop Python program to demonstrate use of Operators 


Develop functions for given problem.
• Design classes for given problem.
• Handle exceptions.

4.0 Actual Procedure Followed


Python is a high-level, interpreted, general-purpose programming language.
Its design philosophy emphasizes code readability with the use of significant
indentation.

Python is dynamically-typed and garbage-collected. It supports multiple


programming paradigms, including structured (particularly procedural),
object-oriented and functional programming. It is often described as a
"batteries included" language due to its comprehensive standard library.

Guido van Rossum began working on Python in the late 1980s as a successor
to the ABC programming language and first released it in 1991 as Python
0.9.0. Python 2.0 was released in 2000 and introduced new features such as
list comprehensions, cycle-detecting garbage collection, reference counting,
and Unicode support. Python 3.0, released in 2008, was a major revision that
is not completely backward-compatible with earlier versions. Python 2 was
discontinued with version 2.7.18 in 2020

Hangman is a guessing game for two or more players. One player thinks of a
word, phrase or sentence and the other(s) tries to guess it by suggesting
letters within a certain number of guesses. Originally a Paper-and-pencil
game, there are now electronic versions.

Though the origins of the game are unknown, a variant is mentioned in a


book of children's games assembled by Alice Gomme in 1894 called Birds,
Beasts, and Fishes. This version lacks the image of a hanged man, instead
relying on keeping score as to the number of attempts it took each player to
fill in the blanks.

A version which incorporated hanging imagery was described in a 1902


Philadelphia Inquirer article, which stated that it was popular at "White Cap"
parties hosted by "Vigilance Committees" where guests would wear "white
peaked caps with masks".

Packages Imported in the Code:

Keras Module :
Keras is an Open Source Neural Network library written in Python that runs on top of Theano
or Tensorflow. It is designed to be modular, fast and easy to use. It was developed by François
Chollet, a Google engineer. Keras doesn’t handle low-level computation. Instead, it uses another
library to do it, called the “Backend.
Keras is high-level API wrapper for the low-level API, capable of running on top of TensorFlow,
CNTK, or Theano. Keras High-Level API handles the way we make models, defining layers, or
set up multiple input-output models. In this level, Keras also compiles our model with loss and
optimizer functions, training process with fit function. Keras in Python doesn’t handle Low-
Level API such as making the computational graph, making tensors or other variables because it
has been handled by the “backend” engine.

Theano, Tensorflow, and CNTK Backend

Theano is an open source project that was developed by the MILA group at the University of
Montreal, Quebec, Canada. It was the first widely used Framework. It is a Python library that
helps in multi-dimensional arrays for mathematical operations using Numpy or Scipy. Theano
can use GPUs for faster computation, it also can automatically build symbolic graphs for
computing gradients. On its website, Theano claims that it can recognize numerically unstable
expressions and compute them with more stable algorithms, this is very useful for our unstable
expressions.

On the other hand, Tensorflow is the rising star in deep learning framework. Developed by
Google’s Brain team it is the most popular deep learning tool. With a lot of features, and
researchers contribute to help develop this framework for deep learning purposes.
Another backend engine for Keras is The Microsoft Cognitive Toolkit or CNTK. It is an
opensource deep learning framework that was developed by Microsoft Team. It can run on multi
GPUs or multi-machine for training deep learning model on a massive scale. In some cases,
CNTK was reported faster than other frameworks such as Tensorflow or Theano. Next in this
Keras CNN tutorial, we will compare the backends of Theano, TensorFlow and CNTK.

IDE:
Google colab

Colaboratory, or “Colab” for short, is a product from Google Research. Colab


allows anybody to write and execute arbitrary python code through the browser,
and is especially well suited to machine learning, data analysis and education.
Program Code:

from keras.models import load_model


from tkinter import * import tkinter as
tk import win32gui from PIL import
ImageGrab, ImageOps import numpy
as np

model = load_model('mnist.h5')

def predict_digit(img):
#resize image to 28×28 pixels
img = img.resize((28,28))
#convert rgb to grayscale
img = img.convert('L') img =
ImageOps.invert(img) img =
np.array(img)
#reshaping to support our model input and normalizing
img = img.reshape(1,28,28,1) img = img/255.0
#predicting the class
res = model.predict([img])[0]
return np.argmax(res), max(res)

class App(tk.Tk): def


__init__(self):
tk.Tk.__init__(self)

self.x = self.y = 0

# Creating elements self.canvas = tk.Canvas(self, width=300,


height=300, bg = "white", cursor="cross") self.label =
tk.Label(self, text="Draw..", font=("Helvetica", 48))
self.classify_btn = tk.Button(self, text = "Recognise", command =
self.classify_handwriting) self.button_clear = tk.Button(self, text
= "Clear", command = self.clear_all)

# Grid structure self.canvas.grid(row=0, column=0,


pady=2, sticky=W, ) self.label.grid(row=0,
column=1,pady=2, padx=2) self.classify_btn.grid(row=1,
column=1, pady=2, padx=2)
self.button_clear.grid(row=1, column=0, pady=2)

#self.canvas.bind("<Motion>", self.start_pos)
self.canvas.bind("<B1-Motion>", self.draw_lines)

def clear_all(self):
self.canvas.delete("all")

def classify_handwriting(self):
HWND = self.canvas.winfo_id() # get the handle of the canvas
rect = win32gui.GetWindowRect(HWND) # get the coordinate of the
canvas
a,b,c,d = rect
rect=(a+4,b+4,c-4,d-4) im =
ImageGrab.grab(rect)

digit, acc = predict_digit(im) self.label.configure(text=


str(digit)+', '+ str(int(acc*100))+'%')

def draw_lines(self, event):


self.x = event.x self.y = event.y r=8
self.canvas.create_oval(self.x-r, self.y-r, self.x + r, self.y + r,
fill='black')

app = App()
mainloop() Output:

Interface of Recognisor :

Drawn Digit that is 5 was recognized with accuracy 99%


Drawn Digit that is 3 was recognized with accuracy 99%

Conclusion:
The course is designed to provide Basic knowledge of Python. Python
programming is intended for software engineers, system analysts, program
managers and user support personnel who wish to learn the Python
programming language. Learning Outcomes: Problem solving and
programming capability.

Understanding the syntax of Python is great and all, and Python by itself is
indeed a great language, but the fundamentals of Python are why Python is a
successful language.

5.0 Actual Resources used:


i. List the software:-
a. MS Office Word 2021.
b. PYCHARM IDE 2021
c. Google colab
ii. Hardware resources used :-
a. HP victus ryzen 5 8gb ram

6.0 Skill Developed/learning out of this Micro-Project:


Able to implement:-

a. The Object Oriented Methodology

b. Handling of Input /Output and File Streams.


c. Exception Handling.
Micro-Project Evaluation Sheet
Roll Student Enrollment Process Product Total
No. Name Number Assessment Assessment Mark
(10)
Part A – Project Part B – Individu
Project Method Project al
Proposa ology report/ Presentat
l (2) (2) working ion/Viva
model (4)
(2)
14 Prajwal
waghmare

Comments/Suggestion about team work/Leadership/inter personal


communication (if any):

Any other comments:

Name of the Faculty Member Signature (Prof.

You might also like