Docsity

Handwriting Recognition using Fuzzy Logic: A Project Report, Lecture notes of Logic

Toggle sidebar
bg1
1
OFFLINE HANDWRITING
RECOGNITION USING FUZZY
LOGIC
By
MEHUL SENGUPTA
ARIJIT BAGCHI
SUBHADEEP BHOWMICK
PALLAVI CHATTERJEE
UNDER THE GUIDANCE OF
Ms PARAMA BAGCHI
PROJECT REPORT SUBMITTED IN PARTIAL FULFILLMENT OF
THE REQUIREMENTS FOR THE DEGREE OF
BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND
ENGINEERING
RCC INSTITUTE OF INFORMATION TECHNOLOGY
Session 2017-2018
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
RCC INSTITUTE OF INFORMATION TECHNOLOGY
[Affiliated to West Bengal University of Technology]
CANAL SOUTH ROAD, BELIAGHATA, KOLKATA-700015
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Handwriting Recognition using Fuzzy Logic: A Project Report and more Lecture notes Logic in PDF only on Docsity!

OFFLINE HANDWRITING

RECOGNITION USING FUZZY

LOGIC

By

MEHUL SENGUPTA

ARIJIT BAGCHI

SUBHADEEP BHOWMICK

PALLAVI CHATTERJEE

UNDER THE GUIDANCE OF

Ms PARAMA BAGCHI

PROJECT REPORT SUBMITTED IN PARTIAL FULFILLMENT OF

THE REQUIREMENTS FOR THE DEGREE OF

BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND

ENGINEERING

RCC INSTITUTE OF INFORMATION TECHNOLOGY

Session 2017- 2018

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

RCC INSTITUTE OF INFORMATION TECHNOLOGY

[Affiliated to West Bengal University of Technology]

CANAL SOUTH ROAD, BELIAGHATA, KOLKATA- 700015

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING RCC INSTITUTE OF INFORMATION TECHNOLOGY TO WHOM IT MAY CONCERN

I hereby recommend that the Project entitled Offline Handwriting Recognition using

Fuzzy Logic, prepared under my supervision by

Student’s Name Class Roll Registration No.

Mehul Sengupta CSE/2014/084 141170110040

Arijit Bagchi CSE/2014/091 141170110009

Subhadeep Bhowmick CSE/2014/094 141170110076

Pallavi Chatterjee CSE/2015/B01 141170110390

of B.Tech (8th Semester), may be accepted in partial fulfilment for the degree of

Bachelor of Technology in Computer Science & Engineering under Maulana Abul

Kalam Azad University of Technology(MAKAUT) formerly West Bengal University of

Technology(WBUT).

Project Supervisor

Department of Computer Science and Engineering

RCC Institute of Information Technology

Countersigned:

Head

Department of Computer Sc. & Engg,

RCC Institute of Information Technology

Kolkata – 700015.

ACKNOWLEDGEMENT

We would like to thank to our supervisor of this project, Ms.Parama Bagchi for the

valuable guidance and advice. She inspired us greatly to work in this project. Besides,

we would like to thank the authority of our college for providing us with a good

environment and facilities to complete this project.

___________________________ ___________________________

Mehul Sengupta Arijit Bagchi CSE/2014/084 CSE/2014/

___________________________ ___________________________

Subhadeep Bhowmick Pallavi Chatterjee CSE/2014/ 094 CSE/2015/B

Table of Contents

    1. Introduction ……………………………………………………. Page No.
    1. Review of Literature …………………………………………… 6 -
    1. Objective of the Project…………………………………………
    1. System Design…………………………………………………… 15 -
    1. Methodology for implementation (Formulation/Algorithm)…… 16 -
    1. Implementation Details…………………………………………. 20 -
    1. Results/Sample output………………………………………….. 21 -
    1. Conclusion...……………………………………………………..
    1. References………………………………………………………

2.2 EVOLUTION OF FUZZY LOGIC

Fuzzy Logic was originally developed in the early 1960’s by Professor Lotfi Zadeh,

who claimed for the new kind of computational paradigm capable of modeling the

uncertainties of human reasoning. In 1965, Zadeh published the first ideas on fuzzy

sets, the key concept in Fuzzy Logic. One of its main advantages lies in the fact

that it offers methods to control non-linear plants, known difficult to model. At the

beginning, fuzzy logic was not accepted by the highly deterministic scientific

community. According to the investigation of the Market Intelligence Research

Corporation of California in 1991, Japan captured 80% of the world wide market.

In 1992, the return in fuzzy products doubled with respect to the previous year

whereas companies like OMROM, held about 700 patents at that date. Germany,

India, France, Korea, Taiwan and China followed Japan in Fuzzy Logic Research

and Development projects.

2.3 IMPLEMENTATION OF FUZZY LOGIC

It is a problem-solving control system methodology that lends itself to implementation in systems ranging from simple, small, embedded micro-controllers to large, networked, multi- channel PC or workstation-based data acquisition and control systems. It can be implemented in hardware, software or a combination of both. Fuzzy Logic provides a simple way to arrive at a definite conclusion based upon vague, ambiguous, imprecise, noisy or missing input information. Using Fuzzy Logic a person can make his decision faster. Fuzzy logic is a form of many-valued logic derived from fuzzy set theory to deal with reasoning that is fluid or approximate rather than fixed and exact. In simple words, fuzzy logic is a super set of conventional logic that has been extended to handle the concept of partial truth--the truth values between completely true and completely false. Both fuzzy implementations have a diverse range of applications including medicine, avionics, security and machine learning. Rule based systems explicitly collect the expert’s knowledge. These rules

and thinking patterns are then programmed into the system. Rule based systems do not

require a large training set like that of neural network solution .Unlike rule-based

fuzzy logic, neural network do not require thinking patterns to be explicitly specified. Typically two datasets are created to program a neural network. The first dataset is the trainer. This set of input is passed into the neural network and processed. The processing phase consists of storing the input values among an array of memory structures called nodes. Each node remains some information and sorts the remaining information between the neighbouring nodes.[1] Once all the information has been processed it is evaluated and stored as the template for which all other datasets will be compared. The advantage of the rule based fuzzy logic system is that it is easier for the system to rationalize its behaviour to users. Rule based fuzzy logic system behaviour is determined by rules or parameters and the changes to these parameters represent the incentives to take action.

2.4 RESEARCH AND DEVELOPMENT FIELDS OF FUZZY LOGIC

In the early stages, the applications of Fuzzy Logic were confined to control systems and process control where the mathematical model of the plant is unknown, complex and not well defined. But later, the areas where Fuzzy Control has been applied comprise a wide variety of applications, with different complexity and performances. At present, the application of Fuzzy Logic exceeds the control domain since it is also employed for other knowledge based decision making tasks.[2] It involves medical diagnosis, business

forecasting, traffic control, network management, image processing, signal processing, computer vision, geology and many more (Costa A.,et al., 1995). Table 2.1 covers a range of research areas related to Fuzzy Logic as reported in the IEEE 2001 International Conference on Fuzzy Systems. Table 2.

Research and Development area Main Topics

Fuzzy Mathematics Foundations of Fuzzy Logic, appropriate reasoning, evolutionary computation, identification and learning algorithms, rule base optimization. Control Systems Fuzzy control theory and applications, process and environmental control, stability criterions issues, multilevel-supervisory control. Pattern Recognition and Image Processing Supervised and Unsupervised learning, classifiers design and integration, signal/image processing and analysis, computer vision, multimedia applications. Soft Computing and Hybrid Systems Intelligent information systems, database systems, data mining intelligent systems,reliability engineering, Neuro-Fuzzy systems, Internet computing, networks traffic modellingand control. Electronic Systems Fuzzy hardware implementation andembedded applications. Robotics and Automation Fuzzy Logic in robotics, industrial automation and other industrial applications. Table 2.2 shows some successful fuzzy systems presently at work.

Table 2.

SOME SUCCESSFUL FUZZY SYSTEMS PRESENTLY AT WORK

Industrial Cement kiln Control (Denmark) Automatic train operation (Japan) Water treatment system (Fuji electric, Japan) Water treatment system (Fuji electric, Japan) Smart sensors (Fisher Rosemount, USA) Blast furnace control (NKK Fukoyama, Japan) Nuclear reactor control (Art Fugen, Japan) Fire detector (Cerberus, Switzerland) Camera tracking (NASA, USA) Target tracker in Patriot missile (MMES, USA) Commercial Washing machine (Matsushita, Japan) Home heating system and air conditions Photocopy machine (Sanyo, Japan) Fuzzy auto focus still camera (Japan) Vacuum cleaner (Sony, Hitachi, Sanyo,

is a crucial task in intensive care. Many automated systems based on fuzzy logic have been developedwhich are capable of distinguishing between critical situations and artifacts. For online monitoring of patients in ICU, a system for breath detection was developed based on fuzzy sets and noninvasive sensor fusion. Endocrinology An expert system (PROTIS) used for deduction of fuzzy rules was developed for treatment of diabetes. Another decision support system for treatment of diabetic outpatients using fuzzy classification was described by Stadelmann. Fuzzy inference was utilized for a diagnostic system of diabetic patients by quantitative analysis of the dynamical responses of glucose tolerance tests. A knowledge-based system was also developed for monitoring diabetics which consisted of fuzzy rules and hierarchical neural networks. Oncology The use of fuzzy logic for oncology has been concerned with classification (for discriminating cancer from normal tissue) and therapy advice. Therapy was mainly based on advanced image processing magnetic resonance image analysis for tumor treatment planning and ovarian cancer has been attempted. Gerontology This is a good example of how fuzzy logic could be applied in a flexible way. A fuzzy relational system was used to implement the databases for building a veterinary expert system. Later on, a few broader applications started to emerge such as the work by Lim who analyzed the difficulties of designing an inference system for the diagnosis of arthritic diseases including variations of disease manifestations under various situations and conditions. Anesthesia The first real-time expert system for advice and control (RESAC) in anesthesia was developed to advice on the concentration of inhaled volatile anesthetics. Anesthetists were confident enough to follow the dosage advice given by RESAC in most of the patients. On the other hand, direct application of fuzzy logic rule-based controllers has been implemented for controlling drug infusion to maintain an adequate level of anesthesia by monitoring blood pressure and muscle relaxation. Evoked potentials were also used as a measure of depth of anesthesia for controlling drug infusion using fuzzy logic controllers and EEG monitoring, supervisory control or a safety shell has been used to oversee the performance of a controller and to direct the controller to take corrective actions in the case of special situation such as disturbances. Based on this indication, fuzzy logic is used to decide the amount of drug infused to maintain a constant depth of anesthesia. Gynecology The time intervals between two subsequent tests have been modeled as fuzzy sets, since they allow the formal description of the temporal uncertainties.

2.7 FUZZY SETS

Prof. LotfiZadeh discovered fuzzy logic in 1965 from his idea about fuzzy sets. As defined by Zadeh, a fuzzy set is a class of objects with a continuous of grades of membership. A fuzzy set is characterized by a membership function. The representation depends not only on the concept, but also on the context in which it is used. The word fuzzy has become common knowledge and a household term. The terms associated with fuzzy – imprecision, uncertainty, approximate, inexact, incomplete or not totally reliable, unclear or ambiguous.[3] The concept of high temperature in the

context of weather and in the concept of furnace would necessarily be represented by very difficult fuzzy sets.

  • A Fuzzy set is defined by naming all its members - I. Possible only for finite sets. II. Example – Set of one digit even numbers i.e. A= {2, 4, 6, 8}.
  • A Fuzzy set is defined a property satisfied by its members – I. A={x | P(x)}, where P(x) designates a proposition or property of x. II. Example – A={x | 0<x<10} and x is even} for x ∈ X, where X is the universal set.
  • A Fuzzy set is also defined by a characteristics function (FA) – I. It declares which elements of the universal set (X) are members of the set and which are not. II. Example – Set A is defined by its characteristics function FA as follows FA(x) = 1 for x ∈ A = 0 for x ∉ A

2.8 CRISP SETS:

The sets which we used in our daily life are crisp sets. Crisp Set’s member may or may not be a member of the set. Universal set is always a Crisp set. For example, a jelly bean belongs in the class of food known as candy. Mashed potatoes do not.

2.9 MEMBERSHIP FUNCTIONS:

Characteristics function of a crisp set assigns a value either 0 or 1 to each individual in the universal set. This function can be generalised such that the values assigned to the elements of the universal set fall within a specified range and indicate the membership grade of these elements in the set in question. Larger values denote higher degrees of set membership. Such a function is called Membership Function. Membership Functions may be different shapes. Membership Functions may be separate or they may overlap. Notations to denote membership function – μΑ: x → [0, 1] where μΑis the membership function of a fuzzy set A. A: x → [0, 1] An example of membership functions are shown in Figure 1. u is the degree of membership in the set.

2.12 FEW DEFINITIONS RELATED TO FUZZY SETS

SUPPORT The support of a fuzzy set A is the set of all points x in X such that μΑ(x) > 0, i.e. Support (A) = { x | μΑ(x) > 0 }, (see figure 3) CORE The core of a fuzzy set A is the set of all points x in X such that μΑ(x) = 1, i.e. Core (A) = { x | μΑ(x) = 1 }, (see figure 3) NORMALITY The fuzzy set A is said to be normal if its core is non-empty, i.e. we can always find a point x ∈ X, such that μΑ(x) = 1 CROSSOVER POINTS A crossover point of a fuzzy set A is a point of x ∈ X at which μΑ(x) = 0. i.e. Crossover (A) = { x | μΑ(x) = 0.5 }, (see figure 3) Fig 2.1: 2 - 3 Complement Fig 2.1: 2 - 1 Complement Fig 2.1: 2 - 2 Complement

α− CUT OR α− LEVEL SET Given a fuzzy set A defined on x and any number α∈[0, 1]. The α−cut of A, denoted by αA or Aα is the crisp set that contains all the elements of the universal set X, whose membership grades in A are greater than or equal to specific value of α. Mathematically, αA or Aα = {x | μΑ(x) ≥α }, (see figure 4) STRONG α− CUT OR STRONG α− LEVEL SET Given a fuzzy set A defined on x and any number α∈[0, 1]. The strong α−cut of A, denoted by α+Aor Aα is the crisp set that contains all the elements of the universal set X, whose membershipgrades in A are greater than the specific value of α. Mathematically, α+A or Aα = {x | μΑ(x) >α } Fig 4: Strong α-cut CONVEXITY A fuzzy set A is said to be convex, if and only if for any x 1 and x 2 and any λ∈ [0, 1] μΑ( λx 1 + (1 - λ) x 2 ) ≥ min { μΑ (x 1 ), μΑ (x 2 ) } A fuzzy set A is convex, if all its α−level cuts are convex, (see figure 5) Fig 5: Convexity Fig 3: Crossover Point

Fig 7: Flow chart of the working principle of the system

5. METHODOLOGY FOR IMPLEMENTATION

5.1 IMAGE ACQUIRIZATION

This is the first and foremost task in processing an image. Image can be acquired from taking pictures through camera of from internet so on. But in our case we have written a word, scanned it so that we can get the handwritten text and then work with it. Fig 8: Original Image Input

5.2 PREPROCESSING

Pre-processing is the initial task for handling any type of image. It consists of many different methods like Cropping , Resizing , Binarizing , Noise Removal or Filtering and Inversion of an image. Different type of image needs different pre-processing methods. In our case the acquired image has gone through the following steps:

  1. At first we converted the original i.e. the scanned image to a binary image.
  2. For better results noise should be removed. So we removed the noise from the image using some methods like median, Gaussian and Laplacian filtering etc.
  3. After that we inverted the image because to do our job precisely we have to have the handwritten text in white pixel and the background in black pixel. Fig 9 : Binarized Image

Fig 10 : Noise Filtered Image

Fuzzy Rule for extraction:- Table 5.5. Table according to the initial feature extraction rule

INPUT

IMAGE

DATA

HORIZENTAL

LINE

VERTICAL

LINE

45 DEGREE

LINE

135 DEGREE

LINE

A YES NO YES YES

B YES YES NO NO

C YES YES NO NO

D YES YES NO NO

E YES YES NO NO

F YES YES NO NO

G YES YES NO NO

H YES YES NO NO

I YES YES NO NO

J YES YES NO NO

K YES NO YES YES

L YES YES NO NO

M NO YES YES YES

N NO YES YES NO

O YES YES NO NO

P YES YES NO NO

Q NO YES NO YES

R YES YES YES NO

S YES YES NO NO

T YES YES NO NO

U YES YES NO NO

V NO NO YES YES

W NO NO YES YES

X NO NO YES YES

Y NO YES YES YES

Z YES NO YES NO

Thus each and every character will have one of the following four different features-

  • Horizental,vertical,45 degree
  • Horizental,vertical,135 degree
  • Vertical,45 degree,135 degree
  • Horizental,45 degree,135 degree And we can extract their features according to these groups.

Another method called fuzzy rule based feature extraction:

We define a variable g which will return the result from fuzzy toolbox. g is calculated using the formulae g=squareroot(x^2-y^2). We use the value the value of g to decide the range of each character. If it falls within the given range the character is recognized. For example if value of g lies in between 0.5 and 1.5 then the character is A. Thus a little distortion in the characters can easily be handled using this algorithm.[4]

6. IMPLEMENTATION DETAILS (PROPOSED)

Characters that are been extracted at first will then go through some segmentation

according to geometry. The primary goal of a rule base generation method is to create a

minimum number of rules. This is important under two observed aspects in pattern

recognition systems. The discrimination power of the classification process is inversely

dependent on the number of classification rules. The number of selected features within a

rule has a direct impact on the computational time of the recognition process.[8][9][10]

For the feature extraction we will be following the algorithm mentioned below.

Algorithm: ( Rule based handwriting recognition)

Step 1: Divide the data space into smaller pattern domains like segments in on-line handwriting

(Level L1 ). Step 2 : Compute the geometrical features as fuzzy linguistic variables for each domain (Level L2 ). Step 3: Aggregate the features for all domains (from step 2) to form global features (Level L3 ). Step 4: (a) Learning Phase: Form linguistic rules with global linguistic features from Step 3 and integrate them in afuzzy rule base. (b) Classification Phase: Classify the unknown information by parsing the rule base created in Step 4(a). “CharactersLevel”. (Level L4 ) Step 5: Cross-check the “recognized” character in the given context. In case of error go to Step 4(b) for the next option. In case of failure go to Step 4(a) for adapting. Else list recognized character. (Level L5 )