Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 87

Chapter 1

CSE 231 Soft Computing


Module 1
• Introduction to Soft Computing: Concept
of computing systems, "Soft" computing
versus "Hard" computing, Characteristics of
Soft computing, Some applications of Soft
computing techniques. Brief descriptions of
different components of soft computing
including Artificial intelligence systems,
Neural networks, fuzzy logic, genetic
algorithms.
CSE 231 Soft Computing 2
Outline
• Soft Computing
• Hard vs Soft Computing
• Characteristics of Soft Computing
• Some applications of Soft Computing

CSE 231 Soft Computing 3


Concept of Computing

CSE 231 Soft Computing 4


Important Characteristics

1. Should provide precise solution.


2. Control action should be unambiguous and
accurate.
3. Suitable for problem, which is easy to
model mathematically

CSE 231 Soft Computing 5


Hard Computing

CSE 231 Soft Computing 6


Soft Computing, What is it?
• The idea behind soft computing is to model cognitive
behavior of human mind.
• Soft computing is foundation of conceptual
intelligence in machines.
• Use inexact solution to computationally hard tasks
(such as solution for NP-Complete problems, for
which there is no known algorithm that can compute
an exact solution in polynomial
CSE 231 Soft Computing time) 7
Soft Computing, What is it?

• Unlike hard computing , Soft computing is tolerant of


imprecision, uncertainty, partial truth, and
approximation.
• The idea of soft computing was initiated in 1981
when Lofti A.Zadeh published his first paper on soft
data analysis “what is soft computing”,
softcomputing. Springer-Verlag Germany/ USA, 1997.
CSE 231 Soft Computing 8
Soft Computing, What is it?
• Zedeh, define soft computing into one multidisciplinary
system as the fusion of the fields of Fuzzy Logic, Neuro-
computing, Evolutionary computing and Probabilistic
Computing.
• Lofti A. Zedah, 1992: “soft computing is an emerging
approach to computing which parallel the remarkable
ability of human mind to reason and learn in the
environment of uncertainly and imprecision”
CSE 231 Soft Computing 9
Soft Computing, What is it?

• Unlike hard computing , Soft computing is


tolerant of
– imprecision,
– uncertainty,

– partial truth, and


– approximation

CSE 231 Soft Computing 10


Characteristics of Soft Computing

CSE 231 Soft Computing 11


Hard Vs Soft Computing
• Hard computing
– Based on the concept of precise modelling
(mathematical or analytical) and analyzing to
yield accurate results.
– Works well for simple problems, but is bound
by the NP Complete set.

CSE 231 Soft Computing 12


Hard Vs Soft Computing
• Soft computing
– Aims to surmount NP-complete problems.
– Uses inexact methods to give useful but inexact
answers to intractable problems.
– Represents a significant paradigm shift in the
aims of computing - a shift which reflects the
human mind.
– Tolerant to imprecision, uncertainty, partial
truth, and approximation.
– Well suited for real world problems where ideal
models are not available.
CSE 231 Soft Computing 13
Hard Vs Soft Computing

CSE 231 Soft Computing 14


Possibility Vs Soft Computing

CSE 231 Soft Computing 15


Constituents of Soft Computing
• Fuzzy Logic (FL)
• Evolutionary Computation (EC) - based on
the origin of the species
• Genetic Algorithm
• Swarm Intelligence
• Ant Colony Optimizations
• Neural Network (NN)
• Machine Learning (ML)

CSE 231 Soft Computing 16


Hybrid Computing

CSE 231 Soft Computing 17


SC development history

CSE 231 Soft Computing 18


Fuzzy Logic

CSE 231 Soft Computing 19


Fuzzy Logic
• Fuzzy Logic (FL) is a method of reasoning
that resembles human reasoning.
– The approach of FL imitates the way of decision
making in humans that involves all intermediate
possibilities between digital values YES and NO.
• The conventional logic block that a
computer can understand takes precise
input and produces a definite output as
TRUE or FALSE, which is equivalent to
human’s YES or NO.CSE 231 Soft Computing 20
Fuzzy Logic
• The inventor of fuzzy logic, Lotfi Zadeh,
– observed that unlike computers, the human
decision making includes a range of possibilities
between YES and NO, such as −
CERTAINLY YES
POSSIBLY YES
CANNOT SAY
POSSIBLY NO
CERTAINLY NO

CSE 231 Soft Computing 21


Fuzzy Logic
• The fuzzy logic works on the levels of
possibilities of input to achieve the definite
output.
• Implementation
– It can be implemented in systems with various
sizes and capabilities ranging from small micro-
controllers to large, networked, workstation-
based control systems.
– It can be implemented in hardware, software, or
a combination of both.
CSE 231 Soft Computing 22
Why Fuzzy Logic?

• Fuzzy logic is useful for commercial and


practical purposes.
– It can control machines and consumer products.
– It may not give accurate reasoning, but
acceptable reasoning.
– Fuzzy logic helps to deal with the uncertainty in
engineering. CSE 231 Soft Computing 23
Fuzzy Logic Systems Architecture
• Fuzzification Module 
– It transforms the system inputs, which are crisp
numbers, into fuzzy sets.
– It splits the input signal into five steps such as −

LP x is Large Positive
MP x is Medium Positive
S x is Small
MN x is Medium Negative
LN x is Large Negative
CSE 231 Soft Computing 24
Fuzzy Logic Systems Architecture

• Knowledge Base 
– It stores IF-THEN rules provided by experts.

• Inference Engine 
– It simulates the human reasoning process by
making fuzzy inference on the inputs and IF-
THEN rules.

CSE 231 Soft Computing 25


Fuzzy Logic Systems Architecture
• Defuzzification Module 
– It transforms the fuzzy set obtained by the
inference engine into a crisp value.

CSE 231 Soft Computing 26


Membership Function
• Membership functions allow you to quantify
linguistic term and represent a fuzzy set
graphically.
• A membership function for a fuzzy set A on the
universe of discourse X is defined as μA:X → [0,1].
• Here, each element of X is mapped to a value
between 0 and 1. It is called membership
value or degree of membership.
• It quantifies the degree of membership of the
element in X to the fuzzy set A.
CSE 231 Soft Computing 27
Membership Function
– x axis represents the universe of discourse.
– y axis represents the degrees of membership in
the [0, 1] interval.
• There can be multiple membership
functions applicable to fuzzify a numerical
value.
• Simple membership functions are used as
use of complex functions does not add more
precision in the output.
CSE 231 Soft Computing 28
Membership Function
• All membership functions for LP, MP, S,
MN, and LN are shown as below −

CSE 231 Soft Computing 29


Membership Function
• The triangular membership function shapes
are most common among various other
membership function shapes such as
trapezoidal, singleton, and Gaussian.
• Here, the input to 5-level fuzzifier varies
from -10 volts to +10 volts.
• Hence the corresponding output also
changes.

CSE 231 Soft Computing 30


Membership Function

CSE 231 Soft Computing 31


Membership Function

CSE 231 Soft Computing 32


Membership Function

CSE 231 Soft Computing 33


Example of a Fuzzy Logic System
• Let us consider an air conditioning system
with 5-level fuzzy logic system.
• This system adjusts the temperature of air
conditioner by comparing the room
temperature and the target temperature
value.

CSE 231 Soft Computing 34


Example of a Fuzzy Logic System

CSE 231 Soft Computing 35


Example of a Fuzzy Logic System
• Define linguistic Variables and terms (start)
• Construct membership functions for them. (start)
• Construct knowledge base of rules (start)
• Convert crisp data into fuzzy data sets using
membership functions. (fuzzification)
• Evaluate rules in the rule base. (Inference Engine)
• Combine results from each rule. (Inference
Engine)
• Convert output data into non-fuzzy values.
(defuzzification)
CSE 231 Soft Computing 36
Step 1 − Define linguistic variables and terms
• Linguistic variables are input and output
variables in the form of simple words or
sentences.
• For room temperature, cold, warm, hot, etc.,
are linguistic terms.
• Temperature (t) = {very-cold, cold, warm,
very-warm, hot}
• Every member of this set is a linguistic term
and it can cover some portion of overall
temperature values.
CSE 231 Soft Computing 37
Step 2 − Construct membership functions for them

• The membership functions of temperature


variable are as shown −

CSE 231 Soft Computing 38


Step3 − Construct knowledge base rules

• Create a matrix of room temperature values


versus target temperature values that an air
conditioning system is expected to provide.
RoomTemp Very_Cold Cold Warm Hot Very_Hot
. /Target
Very_Cold No_Change Heat Heat Heat Heat
Cold Cool No_Change Heat Heat Heat
Warm Cool Cool No_Change Heat Heat
Hot Cool Cool Cool No_Change Heat
Very_Hot Cool Cool Cool Cool No_Change

CSE 231 Soft Computing 39


Step3 − Construct knowledge base rules

• Build a set of rules into the knowledge base


in the form of IF-THEN-ELSE structures.
Sr. Condition Action
No.
IF temperature=(Cold OR Very_Cold) AND target=Warm Heat
1 THEN
IF temperature=(Hot OR Very_Hot) AND target=Warm THEN Cool
2

IF (temperature=Warm) AND (target=Warm) THEN No_Change


3

CSE 231 Soft Computing 40


Step 4 − Obtain fuzzy value
• Fuzzy set operations perform evaluation of
rules.
• The operations used for OR and AND are
Max and Min respectively.
• Combine all results of evaluation to form a
final result.
• This result is a fuzzy value.

CSE 231 Soft Computing 41


Step 5 − Perform defuzzification
• Defuzzification is then performed according
to membership function for output variable.

CSE 231 Soft Computing 42


Application Areas of Fuzzy Logic
• Automotive Systems
– Automatic Gearboxes
– Four-Wheel Steering
– Vehicle environment control
• Consumer Electronic Goods
– Hi-Fi Systems
– Photocopiers
– Still and Video Cameras
– Television
CSE 231 Soft Computing 43
Application Areas of Fuzzy Logic
• Domestic Goods
– Microwave Ovens
– Refrigerators
– Toasters
– Vacuum Cleaners
– Washing Machines
• Environment Control
– Air Conditioners/Dryers/Heaters
– Humidifiers
CSE 231 Soft Computing 44
Fuzzy Logic Applications
Product Company Fuzzy Logic
Anti-lock Nissan Use fuzzy logic to controls brakes in
brakes hazardous cases depend on car speed,
acceleration, wheel speed, and
acceleration
Auto NOK/Nissan Fuzzy logic is used to control the fuel
transmission injection and ignition based on throttle
setting, cooling water temperature, RPM,
etc.
Auto engine Honda, Use to select geat based on engine load,
Nissan driving style, and road conditions.

Copy Canon Using for adjusting drum voltage based on


machine picture density, humidity, and temperature.
CSE 231 Soft Computing 45
Fuzzy Logic Applications
Product Company Fuzzy Logic
Cruise control Nissan, Isuzu, Use it to adjusts throttle setting to set car
Mitsubishi speed and acceleration

Dishwasher Matsushita Use for adjusting the cleaning cycle, rinse


and wash strategies based depend upon
the number of dishes and the amount of
food served on the dishes.

Elevator Fujitec, Use it to reduce waiting for time-based


control Mitsubishi on passenger traffic
Electric, Toshiba
Golf Maruman Golf Selects golf club based on golfer's swing
diagnostic and physique.
system
CSE 231 Soft Computing 46
Fuzzy Logic Examples
Product Company Fuzzy Logic
Fitness Omron Fuzzy rules implied by them
management to check the fitness of their
employees.

Kiln control Nippon Steel Mixes cement


Microwave Mitsubishi Sets lunes power and cooking
oven Chemical strategy
Palmtop Hitachi, Sharp, Recognizes handwritten Kanji
computer Sanyo, Toshiba characters

Plasma etching Mitsubishi Sets etch time and strategy


Electric
CSE 231 Soft Computing 47
Neural Networks
• Inspired from the natural neural network of
human nervous system.
• The inventor of the first neurocomputer, Dr.
Robert Hecht-Nielsen, defines a neural
network as −
"...a computing system made up of a number of
simple, highly interconnected processing
elements, which process information by their
dynamic state response to external inputs.”
CSE 231 Soft Computing 48
Basic Structure of ANNs
• The human brain is composed of 86 billion nerve
cells called neurons. 
• They are connected to other thousand cells
by Axons. 
• Stimuli from external environment or inputs from
sensory organs are accepted by dendrites.
• These inputs create electric impulses, which
quickly travel through the neural network.
• A neuron can then send the message to other
neuron to handle the issue or does not send it
forward. CSE 231 Soft Computing 49
Basic Structure of ANNs

CSE 231 Soft Computing 50


Basic Structure of ANNs
• The idea of ANNs is based on the belief that
working of human brain by making the right
connections, can be imitated using silicon and
wires as living neurons and dendrites.
• ANNs are composed of multiple nodes, which
imitate biological neurons of human brain.
• The neurons are connected by links and they
interact with each other.
• The nodes can take input data and perform simple
operations on the data.
CSE 231 Soft Computing 51
Basic Structure of ANNs
• The result of these operations is passed to other
neurons. The output at each node is called
its activation or node value.
• Each link is associated with weight. ANNs are
capable of learning, which takes place by altering
weight values.

CSE 231 Soft Computing 52


Basic Structure of ANNs

CSE 231 Soft Computing 53


Types of Artificial Neural Networks
• There are two Artificial Neural Network
topologies
– FeedForward
– Feedback

CSE 231 Soft Computing 54


FeedForward ANN
• In this ANN, the information flow is
unidirectional.
• A unit sends information to other unit from
which it does not receive any information.
• There are no feedback loops.
• They are used in pattern
generation/recognition/classification.
• They have fixed inputs and outputs.

CSE 231 Soft Computing 55


FeedForward ANN

CSE 231 Soft Computing 56


FeedBack ANN
• Here, feedback loops are allowed. They are
used in content addressable memories.

CSE 231 Soft Computing 57


Working of ANNs
• In the topology diagrams shown, each arrow
represents a connection between two
neurons and indicates the pathway for the
flow of information.
• Each connection has a weight, an integer
number that controls the signal between the
two neurons. CSE 231 Soft Computing 58
Working of ANNs
• If the network generates a “good or desired”
output, there is no need to adjust the
weights.
• However, if the network generates a “poor
or undesired” output or an error, then the
system alters the weights in order to
improve subsequent results.
CSE 231 Soft Computing 59
Machine Learning in ANNs
• ANNs are capable of learning and they need
to be trained.
• There are several learning strategies
– Supervised Learning
– Unsupervised Learning
– Reinforcement Learning

CSE 231 Soft Computing 60


Applications of Neural Networks
• Aerospace − Autopilot aircrafts, aircraft fault
detection.
• Automotive − Automobile guidance systems.
• Military − Weapon orientation and steering, target
tracking, object discrimination, facial recognition,
signal/image identification.
• Electronics − Code sequence prediction, IC chip
layout, chip failure analysis, machine vision, voice
synthesis.

CSE 231 Soft Computing 61


Applications of Neural Networks
• Financial − Real estate appraisal, loan advisor,
mortgage screening, corporate bond rating, portfolio
trading program, corporate financial analysis,
currency value prediction, document readers, credit
application evaluators.
• Industrial − Manufacturing process control, product
design and analysis, quality inspection systems,
welding quality analysis, paper quality prediction,
chemical product design analysis, dynamic modeling
of chemical process systems, machine maintenance
analysis, project bidding, planning, and management.
CSE 231 Soft Computing 62
Applications of Neural Networks
• Speech − Speech recognition, speech
classification, text to speech conversion.
• Telecommunications − Image and data
compression, automated information services,
real-time spoken language translation.
• Transportation − Truck Brake system diagnosis,
vehicle scheduling, routing systems.
• Software − Pattern Recognition in facial
recognition, optical character recognition, etc.

CSE 231 Soft Computing 63


Applications of Neural Networks
• Time Series Prediction − ANNs are used to make
predictions on stocks and natural calamities.
• Signal Processing − Neural networks can be
trained to process an audio signal and filter it
appropriately in the hearing aids.
• Control − ANNs are often used to make steering
decisions of physical vehicles.
• Anomaly Detection − As ANNs are expert at
recognizing patterns, they can also be trained to
generate an output when something unusual
occurs that misfits the pattern.
CSE 231 Soft Computing 64
Genetic Algorithms
• Genetic Algorithm (GA) is a search-based
optimization technique based on the principles
of Genetics and Natural Selection.
• It is frequently used to find optimal or near-
optimal solutions to difficult problems which
otherwise would take a lifetime to solve.
• It is frequently used to solve optimization
problems, in research,
CSE 231and in machine learning.
Soft Computing 65
Introduction to Optimization
• Optimization is the process of making
something better.
• In any process, we have a set of inputs and a
set of outputs as shown in the following
figure.

CSE 231 Soft Computing 66


Introduction to Optimization
• Optimization refers to finding the values of
inputs in such a way that we get the “best”
output values.
• The definition of “best” varies from problem
to problem, but in mathematical terms, it
refers to maximizing or minimizing one or
more objective functions, by varying the
input parameters.

CSE 231 Soft Computing 67


Introduction to Optimization
• The set of all possible solutions or values
which the inputs can take make up the
search space.
• In this search space, lies a point or a set of
points which gives the optimal solution.
• The aim of optimization is to find that point
or set of points in the search space.

CSE 231 Soft Computing 68


What are Genetic Algorithms?
• Nature has always been a great source of
inspiration to all mankind.
• Genetic Algorithms (GAs) are search based
algorithms based on the concepts of natural
selection and genetics.
• GAs are a subset of a much larger branch of
computation known as Evolutionary
Computation.

CSE 231 Soft Computing 69


What are Genetic Algorithms?

• GAs were developed by John Holland and


his students and colleagues at the
University of Michigan, most notably David
E. Goldberg and has since been tried on
various optimization problems with a high
degree of success.
CSE 231 Soft Computing 70
What are Genetic Algorithms?

• In GAs, we have a pool or a population of


possible solutions to the given problem.
• These solutions then undergo
recombination and mutation (like in natural
genetics), producing new children, and the
process is repeated over various
generations. CSE 231 Soft Computing 71
What are Genetic Algorithms?
• Each individual (or candidate solution) is
assigned a fitness value (based on its
objective function value) and the fitter
individuals are given a higher chance to
mate and yield more “fitter” individuals.
• This is in line with the Darwinian Theory of
“Survival of the Fittest”.
CSE 231 Soft Computing 72
What are Genetic Algorithms?
• In this way we keep “evolving” better
individuals or solutions over generations,
till we reach a stopping criterion.
• Genetic Algorithms are sufficiently
randomized in nature,
– but they perform much better than random
local search (in which we just try various
random solutions, keeping track of the best so
far),
– as they exploit historical information as well.
CSE 231 Soft Computing 73
Advantages of GAs
• Does not require any derivative information
(which may not be available for many real-
world problems).
• Is faster and more efficient as compared to
the traditional methods.
• Has very good parallel capabilities.
• Optimizes both continuous and discrete
functions and also multi-objective problems.

CSE 231 Soft Computing 74


Advantages of GAs
• Provides a list of “good” solutions and not
just a single solution.
• Always gets an answer to the problem,
which gets better over the time.
• Useful when the search space is very large
and there are a large number of parameters
involved.

CSE 231 Soft Computing 75


Limitations of GAs
• GAs are not suited for all problems, especially
problems which are simple and for which
derivative information is available.
• Fitness value is calculated repeatedly which might
be computationally expensive for some problems.
• Being stochastic, there are no guarantees on the
optimality or the quality of the solution.
• If not implemented properly, the GA may not
converge to the optimal solution.

CSE 231 Soft Computing 76


GA – Motivation
• Genetic Algorithms have the ability to
deliver a “good-enough” solution “fast-
enough”.
• This makes genetic algorithms attractive for
use in solving optimization problems.
• The reasons why GAs are needed are as
follows −

CSE 231 Soft Computing 77


GA – Motivation
• Solving Difficult Problems
– In computer science, there is a large set of
problems, which are NP-Hard.
– What this essentially means is that, even the
most powerful computing systems take a very
long time (even years!) to solve that problem.
– In such a scenario,
• GAs prove to be an efficient tool to provide usable
near-optimal solutions in a short amount of time.

CSE 231 Soft Computing 78


GA – Motivation
• Failure of Gradient Based Methods
– Traditional calculus based methods work by
starting at a random point and by moving in the
direction of the gradient, till we reach the top of
the hill.
– This technique is efficient and works very well
for single-peaked objective functions like the
cost function in linear regression.

CSE 231 Soft Computing 79


GA – Motivation
• Failure of Gradient Based Methods
– But, in most real-world situations,
• we have a very complex problem called as
landscapes,
• which are made of many peaks and many valleys,
• which causes such methods to fail,
• as they suffer from an inherent tendency of getting
stuck at the local optima as shown in the following
figure.

CSE 231 Soft Computing 80


GA – Motivation

CSE 231 Soft Computing 81


GA – Motivation
• Getting a Good Solution Fast
– Some difficult problems like the Travelling
Salesperson Problem (TSP), have real-world
applications like path finding and VLSI Design.
– Now imagine that you are using your GPS
Navigation system, and it takes a few minutes
(or even a few hours) to compute the “optimal”
path from the source to destination.
– Delay in such real world applications is not
acceptable and therefore a “good-enough”
solution, which is delivered “fast” is what is
required. CSE 231 Soft Computing 82
Genetic Algorithms - Application
• Optimization − Genetic Algorithms are most
commonly used in optimization problems wherein
we have to maximize or minimize a given objective
function value under a given set of constraints. The
approach to solve Optimization problems has been
highlighted throughout the tutorial.
• Economics − GAs are also used to characterize
various economic models like the cobweb model,
game theory equilibrium resolution, asset pricing,
etc.
• Neural Networks − GAs are also used to train neural
networks, particularly recurrent neural networks. 83
CSE 231 Soft Computing
Genetic Algorithms - Application
• Parallelization − GAs also have very good parallel
capabilities, and prove to be very effective means in
solving certain problems, and also provide a good
area for research.
• Image Processing − GAs are used for various digital
image processing (DIP) tasks as well like dense pixel
matching.
• Vehicle routing problems − With multiple soft time
windows, multiple depots and a heterogeneous fleet.

CSE 231 Soft Computing 84


Genetic Algorithms - Application
• Scheduling applications − GAs are used to solve
various scheduling problems as well, particularly the
time tabling problem.
• Machine Learning − as already discussed, genetics
based machine learning (GBML) is a niche area in
machine learning.
• Robot Trajectory Generation − GAs have been used
to plan the path which a robot arm takes by moving
from one point to another.

CSE 231 Soft Computing 85


Genetic Algorithms - Application
• Parametric Design of Aircraft − GAs have been used to
design aircrafts by varying the parameters and evolving
better solutions.
• DNA Analysis − GAs have been used to determine the
structure of DNA using spectrometric data about the
sample.
• Multimodal Optimization − GAs are obviously very good
approaches for multimodal optimization in which we have
to find multiple optimum solutions.
• Traveling salesman problem and its applications − GAs
have been used to solve the TSP, which is a well-known
combinatorial problem using novel crossover and packing
strategies.
CSE 231 Soft Computing 86

You might also like