AISC Notes2
AISC Notes2
Soft Computing
Soft computing is the reverse of hard (conventional) computing. It refers to a group of
computational techniques that are based on artificial intelligence (AI) and natural selection.
It provides cost-effective solutions to the complex real-life problems for which hard
computing solution does not exist.
Zadeh coined the term of soft computing in 1992. The objective of soft computing is to
provide precise approximation and quick solutions for complex real-life problems.
EXAMPLE:-
1. Problem 1
2. Are string1 and string2 same?
3. Solution
4. No, the solution is simply No. It does not require any algorithm to analyze this.
1. Problem 2
2. How much string1 and string2 are same?
3. Solution
4. Through conventional programming, either the answer is Yes or No. But these strings
might be 80% similar according to soft computing.
You have noticed that soft computing gave us the approximate solution.
o Hard computing is used for solving mathematical problems that need a precise
answer. It fails to provide solutions for some real-life problems. Thereby for real-
life problems whose precise solution does not exist, soft computing helps.
o When conventional mathematical and analytical models fail, soft computing
helps, e.g., You can map even the human mind using soft computing.
o Analytical models can be used for solving mathematical problems and valid for
ideal cases. But the real-world problems do not have an ideal case; these exist
in a non-ideal environment.
o Soft computing is not only limited to theory; it also gives insights into real-life
problems.
o Like all the above reasons, Soft computing helps to map the human mind, which
cannot be possible with conventional mathematical and analytical models.
Any problems can be resolved effectively using these components. Following are three types
of techniques used by soft computing:
o Fuzzy Logic
o Artificial Neural Network (ANN)
o Genetic Algorithms
Fuzzy Logic (FL)
Fuzzy logic is nothing but mathematical logic which tries to solve problems with an open and
imprecise spectrum of data. It makes it easy to obtain an array of precise conclusions.
Fuzzy logic is basically designed to achieve the best possible solution to complex problems
from all the available information and input data. Fuzzy logics are considered as the best
solution finders.
An artificial neural network (ANN) emulates a network of neurons that makes a human brain
(means a machine that can think like a human mind). Thereby the computer or a machine can
learn things so that they can take decisions like the human brain.
Artificial Neural Networks (ANN) are mutually connected with brain cells and created
using regular computing programming. It is like as the human neural system.
PART-B
What is a neural network?
A neural network is a method in artificial intelligence that teaches computers to process data in a
way that is inspired by the human brain. It is a type of machine learning process, called deep
learning, that uses interconnected nodes or neurons in a layered structure that resembles the
human brain. It creates an adaptive system that computers use to learn from their mistakes and
improve continuously. Thus, artificial neural networks attempt to solve complicated problems, like
summarizing documents or recognizing faces, with greater accuracy.
Neural networks can comprehend unstructured data and make general observations without
explicit training. For instance, they can recognize that two different input sentences have a
similar meaning:
A neural network would know that both sentences mean the same thing. Or it would be able to
broadly recognize that Baxter Road is a place, but Baxter Smith is a person’s name.
Computer vision is the ability of computers to extract information and insights from images and
videos. With neural networks, computers can distinguish and recognize images similar to
humans. Computer vision has several applications, such as the following:
• Visual recognition in self-driving cars so they can recognize road signs and other road
users
• Content moderation to automatically remove unsafe or inappropriate content from image
and video archives
• Facial recognition to identify faces and recognize attributes like open eyes, glasses, and
facial hair
• Image labeling to identify brand logos, clothing, safety gear, and other image details
Speech recognition
Neural networks can analyze human speech despite varying speech patterns, pitch, tone,
language, and accent. Virtual assistants like Amazon Alexa and automatic transcription software
use speech recognition to do tasks like these:
Natural language processing (NLP) is the ability to process natural, human-created text. Neural
networks help computers gather insights and meaning from text data and documents. NLP has
several use cases, including in these functions:
Neural networks can track user activity to develop personalized recommendations. They can also
analyze all user behavior and discover new products or services that interest a specific user. For
example, Curalate, a Philadelphia-based startup, helps brands convert social media posts into
sales. Brands use Curalate’s intelligent product tagging (IPT) service to automate the collection
and curation of user-generated social content. IPT uses neural networks to automatically find and
recommend products relevant to the user’s social media activity. Consumers don't have to hunt
through online catalogs to find a specific product from a social media image. Instead, they can
use Curalate’s auto product tagging to purchase the product with ease.
Input Layer
Information from the outside world enters the artificial neural network from the input layer. Input
nodes process the data, analyze or categorize it, and pass it on to the next layer.
Hidden Layer
Hidden layers take their input from the input layer or other hidden layers. Artificial neural
networks can have a large number of hidden layers. Each hidden layer analyzes the output from
the previous layer, processes it further, and passes it on to the next layer.
Output Layer
The output layer gives the final result of all the data processing by the artificial neural network. It
can have single or multiple nodes. For instance, if we have a binary (yes/no) classification
problem, the output layer will have one output node, which will give the result as 1 or 0. However,
if we have a multi-class classification problem, the output layer might consist of more than one
output node.
Backpropagation algorithm
Artificial neural networks learn continuously by using corrective feedback loops to improve their
predictive analytics. In simple terms, you can think of the data flowing from the input node to the
output node through many different paths in the neural network. Only one path is the correct one
that maps the input node to the correct output node. To find this path, the neural network uses a
feedback loop, which works as follows:
1. Each node makes a guess about the next node in the path.
2. It checks if the guess was correct. Nodes assign higher weight values to paths that lead
to more correct guesses and lower weight values to node paths that lead to incorrect
guesses.
3. For the next data point, the nodes make a new prediction using the higher weight paths
and then repeat Step 1.
Convolutional neural networks
The hidden layers in convolutional neural networks perform specific mathematical functions, like
summarizing or filtering, called convolutions. They are very useful for image classification
because they can extract relevant features from images that are useful for image recognition and
classification. The new form is easier to process without losing features that are critical for
making a good prediction. Each hidden layer extracts and processes different image features,
like edges, color, and depth.
Supervised learning
In supervised learning, data scientists give artificial neural networks labeled datasets that provide
the right answer in advance. For example, a deep learning network training in facial recognition
initially processes hundreds of thousands of images of human faces, with various terms related
to ethnic origin, country, or emotion describing each image.
The neural network slowly builds knowledge from these datasets, which provide the right answer
in advance. After the network has been trained, it starts making guesses about the ethnic origin
or emotion of a new image of a human face that it has never processed before.
UnSupervised learning
Reinforcement learning
Reinforcement Learning (RL) is the science of decision making. It is about
learning the optimal behavior in an environment to obtain maximum
reward. This optimal behavior is learned through interactions with the
environment and observations of how it responds, similar to children
exploring the world around them and learning the actions that help them
achieve a goal.
In the absence of a supervisor, the learner must independently discover the
sequence of actions that maximize the reward. This discovery process is
akin to a trial-and-error search. The quality of actions is measured by not
just the immediate reward they return, but also the delayed reward they
might fetch. As it can learn the actions that result in eventual success in an
unseen environment without the help of a supervisor, reinforcement
learning is a very powerful algorithm.
UNSUPERVISED
SUPERVISED LEARNING LEARNING
In supervised learning
training data is used to In unsupervised learning
Training data infer model training data is not used.
Supervised learning is also Unsupervised learning is also
Another name called classification. called clustering.
Test of model We can test our model. We can not test our model.
Optical Character
Example Recognition Find a face in an image.
Perceptron uses the step function that returns +1 if the weighted sum of its input 0
and -1.
The activation function is used to map the input between the required value like (0, 1)
or (-1, 1).
a. In the first step, all the inputs x are multiplied with their weights w.
b. In this step, add all the increased values and call them the Weighted sum.
c. In our last step, apply the weighted sum to a correct Activation Function.
For Example:
This is the first proposal when the neural model is built. The content of the neuron's
local memory contains a vector of weight.
The single vector perceptron is calculated by calculating the sum of the input vector
multiplied by the corresponding element of the vector, with each increasing the
amount of the corresponding component of the vector by weight. The value that is
displayed in the output is the input of an activation function.
Let us focus on the implementation of a single-layer perceptron for an image
classification problem using TensorFlow. The best example of drawing a single-layer
perceptron is through the representation of "logistic regression."
o The weights are initialized with the random values at the origination of each
training.
o For each element of the training set, the error is calculated with the difference
between the desired output and the actual output. The calculated error is used
to adjust the weight.
o The process is repeated until the fault made on the entire training set is less
than the specified limit until the maximum number of iterations has been
reached.
The hidden neural network is set up in some techniques. In many cases, weighted
inputs are randomly assigned. On the other hand, they are fine-tuned and calibrated
through a process called backpropagation.
The artificial neuron in the hidden layer of perceptron works as a biological neuron in
the brain- it takes in its probabilistic input signals, and works on them. And it converts
them into an output corresponding to the biological neuron's axon.
Layers after the input layer are called hidden because they are directly resolved to the
input. The simplest network structure is to have a single neuron in the hidden layer
that directly outputs the value.
MLP networks are used for supervised learning format. A typical learning algorithm for
MLP networks is also called back propagation's algorithm.
A multilayer perceptron (MLP) is a feed forward artificial neural network that generates
a set of outputs from a set of inputs. An MLP is characterized by several layers of input
nodes connected as a directed graph between the input nodes connected as a directed
graph between the input and output layers. MLP uses backpropagation for training
the network. MLP is a deep learning method.
The main features of Backpropagation are the iterative, recursive and efficient method
through which it calculates the updated weight to improve the network until it is not
able to perform the task for which it is being trained. Derivatives of the activation
function to be known at network design time is required to Backpropagation.
Now, how error function is used in Backpropagation and how Backpropagation works?
Let start with an example and do it mathematically to understand how exactly updates
the weight using Backpropagation.
Advantages of Using the Backpropagation
Algorithm in Neural Networks
In this condition, this type of memory is robust and fault-tolerant because of this type
of memory model, and some form of error-correction capability.
There are two types of associate memory- an auto-associative memory and hetero associative
memory.
Auto-associative memory:
An auto-associative memory recovers a previously stored pattern that most closely relates to
the current pattern. It is also known as an auto-associative correlator.
Consider x[1], x[2], x[3],….. x[M], be the number of stored pattern vectors, and
let x[m] be the element of these vectors, showing characteristics obtained from the patterns.
The auto-associative memory will result in a pattern vector x[m] when putting a noisy or
incomplete version of x[m].
Hetero-associative memory:
In a hetero-associate memory, the recovered pattern is generally different from the input
pattern not only in type and format but also in content. It is also known as a hetero-
associative correlator.
Consider we have a number of key response pairs {a(1), x(1)}, {a(2),x(2)},…..,{a(M),
x(M)}. The hetero-associative memory will give a pattern vector x(m) when a noisy or
incomplete version of the a(m) is given.
Neural networks are usually used to implement these associative memory models
called neural associative memory (NAM). The linear associate is the easiest artificial
neural associative memory.
If the memory is produced with an input pattern, may say α, the associated
pattern ω is recovered automatically.
These are the terms which are related to the Associative memory network:
Encoding or memorization:
Where,
The input pattern may hold errors and noise or may contain an incomplete version of
some previously encoded pattern. If a corrupted input pattern is presented, the
network will recover the stored Pattern that is adjacent to the actual input pattern. The
existence of noise or errors results only in an absolute decrease rather than total
degradation in the efficiency of the network. Thus, associative memories are robust
and error-free because of many processing units performing highly parallel and
distributed computations.
Performance Measures:
The measures taken for the associative memory performance to correct recovery are
memory capacity and content addressability. Memory capacity can be defined as the
maximum number of associated pattern pairs that can be stored and correctly
recovered. Content- addressability refers to the ability of the network to recover the
correct stored pattern.
If input patterns are mutually orthogonal, perfect recovery is possible. If stored input
patterns are not mutually orthogonal, non-perfect recovery can happen due to
intersection among the patterns.
The neural network architectures of these given models and the structure of the
corresponding association weight matrix w of the associative memory are depicted.
The linear associator model is a feed-forward type network where produced output is
in the form of single feed-forward computation. The model comprises of two layers of
processing units, one work as an input layer while the other work as an output layer.
The input is directly associated with the outputs, through a series of weights. The
connections carrying weights link each input to every output. The addition of the
products of the weights and the input is determined in each neuron node. The
architecture of the linear associator is given below.
All p inputs units are associated to all q output units via associated weight matrix
The connection weight matrix stores the z different associated pattern pairs {(Xk,Yk);
k= 1,2,3,…,z}. Constructing an associative memory is building the connection weight
matrix w such that if an input pattern is presented, the stored pattern associated with
the input pattern is recovered.
Gains control empowers L1 and L2 to recognize the current stages of the running cycle.
STM reset wave prevents active L2 cells when mismatches between bottom-up and
top-down signals happen at L1. The comparison layer gets the binary external input
passing it to the recognition layer liable for coordinating it to a classification category.
This outcome is given back to the comparison layer to find out when the category
coordinates the input vector. If there is a match, then a new input vector is read, and
the cycle begins once again. If there is a mismatch, then the orienting system is in
charge of preventing the previous category from getting a new category match in the
recognition layer. The given two gains control the activity of the recognition and the
comparison layer, respectively. The reset wave specifically and enduringly prevents
active L2 cell until the current is stopped. The offset of the input pattern ends its
processing L1 and triggers the offset of Gain2. Gain2 offset causes consistent decay of
STM at L2 and thereby prepares L2 to encode the next input pattern without bais.
ART1 Implementation process:
ART1 is a self-organizing neural network having input and output neurons mutually
couple using bottom-up and top-down adaptive weights that perform recognition. To
start our methodology, the system is first trained as per the adaptive resonance theory
by inputting reference pattern data under the type of 5*5 matrix into the neurons for
clustering within the output neurons. Next, the maximum number of nodes in L2 is
defined following by the vigilance parameter. The inputted pattern enrolled itself as
short term memory activity over a field of nodes L1. Combining and separating
pathways from L1 to coding field L2, each weighted by an adaptive long-term memory
track, transform into a net signal vector T. Internal competitive dynamics at L2 further
transform T, creating a compressed code or content addressable memory. With strong
competition, activation is concentrated at the L2 node that gets the maximal L1 → L2
signal. The primary objective of this work is divided into four phases as follows
Comparision, recognition, search, and learning.
It can be coordinated and utilized with different techniques to give more precise
outcomes.
It can be used in different fields such as face recognition, embedded system, and
robotics, target recognition, medical diagnosis, signature verification, etc.
It shows stability and is not disturbed by a wide range of inputs provided to inputs.
It has got benefits over competitive learning. The competitive learning cant include new
clusters when considered necessary.
Application of ART:
ART stands for Adaptive Resonance Theory. ART neural networks used for fast, stable
learning and prediction have been applied in different areas. The application incorporates
target recognition, face recognition, medical diagnosis, signature verification, mobile control
robot.
Target recognition:
Fuzzy ARTMAP neural network can be used for automatic classification of targets depend on
their radar range profiles. Tests on synthetic data show the fuzzy ARTMAP can result in
substantial savings in memory requirements when related to k nearest neighbor(kNN)
classifiers. The utilization of multiwavelength profiles mainly improves the performance of
both kinds of classifiers.
Medical diagnosis:
Automatic signature verification is a well known and active area of research with
various applications such as bank check confirmation, ATM access, etc. the training of
the network is finished using ART1 that uses global features as input vector and the
verification and recognition phase uses a two-step process. In the initial step, the input
vector is coordinated with the stored reference vector, which was used as a training
set, and in the second step, cluster formation takes place.
Limitations of ART:
Some ART networks are contradictory as they rely on the order of the training data, or
upon the learning rate.
PART-C
Fuzzy logic contains the multiple logical values and these values are the truth values
of a variable or problem between 0 and 1. This concept was introduced by Lofti
Zadeh in 1965 based on the Fuzzy Set Theory. This concept provides the possibilities
which are not given by computers, but similar to the range of possibilities generated
by humans.
In the Boolean system, only two possibilities (0 and 1) exist, where 1 denotes the
absolute truth value and 0 denotes the absolute false value. But in the fuzzy system,
there are multiple possibilities present between the 0 and 1, which are partially false
and partially true.
1. This concept is flexible and we can easily understand and implement it.
2. It is used for helping the minimization of the logics created by the human.
3. It is the best method for finding the solution of those problems which are suitable for
approximate or uncertain reasoning.
4. It always offers two values, which denote the two possible solutions for a problem and
statement.
5. It allows users to build or create the functions which are non-linear of arbitrary
complexity.
6. In fuzzy logic, everything is a matter of degree.
7. In the Fuzzy logic, any system which is logical can be easily fuzzified.
8. It is based on natural language processing.
9. It is also used by the quantitative analysts for improving their algorithm's execution.
10. It also allows users to integrate with the programming.
1. Rule Base
2. Fuzzification
3. Inference Engine
4. Defuzzification
2. Fuzzification
Fuzzification is a module or component for transforming the system inputs, i.e., it
converts the crisp number into fuzzy steps. The crisp numbers are those inputs which
are measured by the sensors and then fuzzification passed them into the control
systems for further processing. This component divides the input signals into following
five states in any Fuzzy Logic system:
3. Inference Engine
This component is a main component in any Fuzzy Logic system (FLS), because all the
information is processed in the Inference Engine. It allows users to find the matching degree
between the current fuzzy input and the rules. After the matching degree, this system
determines which rule is to be added according to the given input field. When all rules are
fired, then they are combined for developing the control actions.
4. Defuzzification
Defuzzification is a module or component, which takes the fuzzy set inputs generated by
the Inference Engine, and then transforms them into a crisp value. It is the last step in the
process of a fuzzy logic system. The crisp value is a type of value which is acceptable by the
user. Various techniques are present to do this, but the user has to select the best one for
reducing the errors.
Membership Function
The membership function is a function which represents the graph of fuzzy sets, and
allows users to quantify the linguistic term. It is a graph which is used for mapping each
element of x to the value between 0 and 1.
This function of Membership was introduced in the first papers of fuzzy set by Zadeh. For
the Fuzzy set B, the membership function for X is defined as: μB:X → [0,1]. In this function
X, each element of set B is mapped to the value between 0 and 1. This is called a degree of
membership or membership value.
1. The run time of fuzzy logic systems is slow and takes a long time to produce
outputs.
2. Users can understand it easily if they are simple.
3. The possibilities produced by the fuzzy logic system are not always accurate.
4. Many researchers give various ways for solving a given statement using this
technique which leads to ambiguity.
5. Fuzzy logics are not suitable for those problems that require high accuracy.
6. The systems of a Fuzzy logic need a lot of testing for verification and validation.
Fuzzy set v/s Crisp set
5 Crisp set application used for Fuzzy set used in the fuzzy
digital design. controller.
Crisp logic
Crisp logic identifies a formal logics class that have been most
intensively studied and most widely used. The class is sometimes
called as standard logic also.
Crisp :
▪ Binary logic
▪ It may be occur or non occur
▪ indicator function
Fuzzy logic :
▪ Continuous valued logic
▪ membership function
▪ Consider about degree of membership
Precise data is
converted into Imprecise data is converted
1. Basic imprecise data. into precise data.
Intuition, inference,
rank ordering, Maximum membership
angular fuzzy sets, principle, centroid method,
neural network, weighted average method,
4. Methods etcetera. center of sums, etcetera.
MinMax composition
Fuzzy composition
Fuzzy composition can be defined just as it is for crisp (binary)
relations. Suppose R is a fuzzy relation on X × Y, S is a fuzzy relation
on Y × Z, and T is a fuzzy relation on X × Z; then,
Fuzzy Max–Min composition is defined as:
It obtains fuzzy relation T as a composition b/w fuzzy relation. It takes the maximum
value first, and then search for the minimum value.
FRBSs are an extension of classical rule-based systems (also known as production systems or expert
systems). Basically, they are expressed in the form “IF A THEN B” where A and B are fuzzy sets. A and
B are called the antecedent and consequent parts of the rule, respectively. Let us assume we are
trying to model the following problem: we need to determine the speed of a car considering some
factors such as the number of vehicles in the street and the width of the street. So, let us consider
three objects = {number of vehicles, width of street, speed of car} with linguistic values as follows:
Number of vehicles = {small, medium, large}. Width of street = {narrow, medium, wide}. Speed of car
= {slow, medium, fast}. Based on a particular condition, we can define a fuzzy IF-THEN rule as follows:
IF number of vehicles is small and width of street is medium THEN speed of car is fast.
Predicate Logic
A predicate is an expression of one or more variables determined on some specific domain.
A predicate with variables can be made a proposition by either authorizing a value to the
variable or by quantifying the variable.
Quantifier:
The variable of predicates is quantified by quantifiers. There are two types of quantifier in
predicate logic - Existential Quantifier and Universal Quantifier.
Existential Quantifier:
If p(x) is a proposition over the universe U. Then it is denoted as ∃x p(x) and read as "There
exists at least one value in the universe of variable x such that p(x) is true. The quantifier ∃ is
called the existential quantifier.
There are several ways to write a proposition, with an existential quantifier, i.e.,
(∃x∈A)p(x) or ∃x∈A such that p (x) or (∃x)p(x) or p(x) is true for some x ∈A.
Universal Quantifier:
If p(x) is a proposition over the universe U. Then it is denoted as ∀x,p(x) and read as "For
every x∈U,p(x) is true." The quantifier ∀ is called the Universal Quantifier.
Genetic Algorithm
A genetic algorithm is an adaptive heuristic search algorithm inspired by
"Darwin's theory of evolution in Nature." It is used to solve optimization problems
in machine learning. It is one of the important algorithms as it helps solve complex
problems that would take a long time to solve.
Genetic Algorithms are being widely used in different real-world applications, for
example, Designing electronic circuits, code-breaking, image processing, and
artificial creativity.
In this topic, we will explain Genetic algorithm in detail, including basic terminologies
used in Genetic algorithm, how it works, advantages and limitations of genetic
algorithm, etc.
o Population: Population is the subset of all possible or probable solutions, which can
solve the given problem.
o Chromosomes: A chromosome is one of the solutions in the population for the given
problem, and the collection of gene generate a chromosome.
o Gene: A chromosome is divided into a different gene, or it is an element of the
chromosome.
o Allele: Allele is the value provided to the gene within a particular chromosome.
o Fitness Function: The fitness function is used to determine the individual's fitness level
in the population. It means the ability of an individual to compete with other
individuals. In every iteration, individuals are evaluated based on their fitness function.
o Genetic Operators: In a genetic algorithm, the best individual mate to regenerate
offspring better than parents. Here genetic operators play a role in changing the
genetic composition of the next generation.
o Selection
After calculating the fitness of every existent in the population, a selection process is used to
determine which of the individualities in the population will get to reproduce and produce the
seed that will form the coming generation.
So, now we can define a genetic algorithm as a heuristic search algorithm to solve
optimization problems. It is a subset of evolutionary algorithms, which is used in computing.
A genetic algorithm uses genetic and natural selection concepts to solve optimization
problems.
It basically involves five phases to solve the complex optimization problems, which are given
as below:
o Initialization
o Fitness Assignment
o Selection
o Reproduction
o Termination
1. Initialization
The process of a genetic algorithm starts by generating the set of individuals, which is called
population. Here each individual is the solution for the given problem. An individual contains
or is characterized by a set of parameters called Genes. Genes are combined into a string
and generate chromosomes, which is the solution to the problem. One of the most popular
techniques for initialization is the use of random binary strings.
2. Fitness Assignment
Fitness function is used to determine how fit an individual is? It means the ability of an
individual to compete with other individuals. In every iteration, individuals are
evaluated based on their fitness function. The fitness function provides a fitness score
to each individual. This score further determines the probability of being selected for
reproduction. The high the fitness score, the more chances of getting selected for
reproduction.
3. Selection
The selection phase involves the selection of individuals for the reproduction of
offspring. All the selected individuals are then arranged in a pair of two to increase
reproduction. Then these individuals transfer their genes to the next generation.
4. Reproduction
After the selection process, the creation of a child occurs in the reproduction step. In
this step, the genetic algorithm uses two variation operators that are applied to the
parent population. The two operators involved in the reproduction phase are given
below:
o Crossover: The crossover plays a most significant role in the reproduction phase of the
genetic algorithm. In this process, a crossover point is selected at random within the
genes. Then the crossover operator swaps genetic information of two parents from the
current generation to produce a new individual representing the offspring.
The genes of parents are exchanged among themselves until the crossover point is
met. These newly generated offspring are added to the population. This process is also
called or crossover. Types of crossover styles available:
o One point crossover
o Two-point crossover
o Livery crossover
o Inheritable Algorithms crossover
o Mutation
The mutation operator inserts random genes in the offspring (new child) to maintain
the diversity in the population. It can be done by flipping some bits in the
chromosomes.
Mutation helps in solving the issue of premature convergence and enhances
diversification. The below image shows the mutation process:
Types of mutation styles available,
o Flip bit mutation
o Gaussian mutation
o Exchange/Swap mutation
5. Termination
After the reproduction phase, a stopping criterion is applied as a base for termination.
The algorithm terminates after the threshold fitness solution is reached. It will identify
the final solution as the best solution in the population.
Chromosome: All living organisms consist of cells. In each cell, there is the
same set of Chromosomes. Chromosomes are strings of DNA and consist of
genes, blocks of DNA. Each gene encodes a trait, for example, the color of
the eye.
Reproduction: During reproduction, combination (or crossover) occurs first.
Genes from parents combine to form a whole new chromosome. The newly
created offspring can then be mutated. The changes are mainly caused by
errors in copying genes from parents. The fitness of an organism is
measured by the success of the organism in its life.
Operation of Genetic Algorithms :
Two important elements required for any problem before a genetic
algorithm can be used for a solution are
• Method for representing a solution ex: a string of bits, numbers,
character ex: determination total weight.
• Method for measuring the quality of any proposed solution, using a
fitness function.
Basic principles :
Fitness Function of GA
Crossover in GA
Crossover is a genetic operator used to vary the programming of a
chromosome or chromosomes from one generation to the next. Crossover is
sexual reproduction. Two strings are picked from the mating pool at random
to crossover in order to produce superior offspring. The method chosen
depends on the Encoding Method.
Crossover mask: The choice of which parent contributes to the bit position
fI the offspring is given by an additional string called crossover mask
similar to bit masks in unity game engine.
The crossover between two good solutions may not always yield a better or
as good a solution. Since parents are good, the probability of the child being
good is high. If offspring is not good (poor solution), it will be removed in
the next iteration during “Selection”.
Problems with Crossover:
• Depending on coding, simple crossovers can have a high chance to
produce illegal offspring.
E.g. in TSP with simple binary or path coding, most offspring will
be illegal because not all cities will be in the offspring and some
cities will be there more than once.
• Uniform crossover can often be modified to avoid this problem
E.g. in TSP with simple path coding:
Where the mask is 1, copy cities from one parent
Where the mask is 0, choose the remaining cities in the order of
the other parent.
Mutation in GA
mutation may be defined as a small random tweak in the
chromosome, to get a new solution. It is used to maintain and
introduce diversity in the genetic population and is usually applied
with a low probability – pm. If the probability is very high, the GA
gets reduced to a random search.
Mutation Operators
In this section, we describe some of the most commonly used
mutation operators. Like the crossover operators, this is not an
exhaustive list and the GA designer might find a combination of
these approaches or a problem-specific mutation operator more
useful.
In this bit flip mutation, we select one or more random bits and
flip them. This is used for binary encoded GAs.
Random Resetting
Swap Mutation
Scramble Mutation
Inversion Mutation
Convergence in GA
Convergence in terms of genetic algorithms is a special case when a genetic algorithm needs to
stop due to the fact that every identity in the population is identical. There is full convergence and
premature convergence. Full convergence can be seen in algorithms only using cross-over.
Premature convergence occurs when a population has converged to a single solution, but that
solution is not as high of quality as expected, for example the population has gotten stuck. To
avoid convergence, a variety of diversity generating techniques can be used. Convergence does
not always indicate a negative sign.
Multilevel optimization
GA are stochastic methods for global search and optimization and belong to the
group of nature-inspired metaheuristics leading to the so-called natural
computing. It is a fast-growing interdisciplinary field in which a range of
techniques and methods are studied for dealing with large, complex, and dynamic
problems with various sources of potential uncertainties. GAs simultaneously
examine and manipulate a set of possible solutions. A gene is a part of a
chromosome (solution), which is the smallest unit of genetic information. Every
gene is able to assume different values called allele. All genes of an organism form
a genome, which affects the appearance of an organism called phenotype. The
chromosomes are encoded using a chosen representation and each can be
thought of as a point in the search space of candidate solutions. Each individual is
assigned a score (fitness) value that allows assessing its quality. The members of
the initial population may be randomly generated or by using sophisticated
mechanisms by means of which an initial population of high-quality chromosomes
is produced. The reproduction operator selects (randomly or based on the
individual’s fitness) chromosomes from the population to be parents and enter
them in a mating pool. Parent individuals are drawn from the mating pool and
combined so that information is exchanged and passed to off-springs depending
on the probability of the crossover operator. The new population is then subjected
to mutation and enters into an intermediate population. The mutation operator
acts as an element of diversity into the population and is generally applied with a
low-probability to avoid disrupting crossover results. Finally, a selection scheme is
used to update the population giving rise to a new generation. The individuals
from the set of solutions, which is called population will evolve from generation to
generation by repeated applications of an evaluation procedure that is based on
genetic operators. Over many generations, the population becomes increasingly
uniform until it ultimately converges to optimal or near-optimal solutions. The
different steps of the multilevel weighted genetic algorithm are described as
follows:
Hybrid systems
Hybrid systems: A Hybrid system is an intelligent system that is framed by
combining at least two intelligent technologies like Fuzzy Logic, Neural
networks, Genetic algorithms, reinforcement learning, etc. The combination
of different techniques in one computational model makes these systems
possess an extended range of capabilities. These systems are capable of
reasoning and learning in an uncertain and imprecise environment. These
systems can provide human-like expertise like domain knowledge,
adaptation in noisy environments, etc.
Types of Hybrid Systems:
• Neuro-Fuzzy Hybrid systems
• Neuro Genetic Hybrid systems
• Fuzzy Genetic Hybrid systems
(A) Neuro-Fuzzy Hybrid systems:
The Neuro-fuzzy system is based on fuzzy system which is trained on the
basis of the working of neural network theory. The learning process
operates only on the local information and causes only local changes in the
underlying fuzzy system. A neuro-fuzzy system can be seen as a 3-layer
feedforward neural network. The first layer represents input variables, the
middle (hidden) layer represents fuzzy rules and the third layer represents
output variables. Fuzzy sets are encoded as connection weights within the
layers of the network, which provides functionality in processing and
training the model.
Working flow:
• In the input layer, each neuron transmits external crisp signals
directly to the next layer.
• Each fuzzification neuron receives a crisp input and determines the
degree to which the input belongs to the input fuzzy set.
• The fuzzy rule layer receives neurons that represent fuzzy sets.
• An output neuron combines all inputs using fuzzy operation
UNION.
• Each defuzzification neuron represents the single output of the
neuro-fuzzy system.
Advantages:
• It can handle numeric, linguistic, logic, etc kind of information.
• It can manage imprecise, partial, vague, or imperfect information.
• It can resolve conflicts by collaboration and aggregation.
• It has self-learning, self-organizing and self-tuning capabilities.
• It can mimic the human decision-making process.
Disadvantages:
• Hard to develop a model from a fuzzy system
• Problems of finding suitable membership values for fuzzy systems
• Neural networks cannot be used if training data is not available.
Applications:
• Student Modelling
• Medical systems
• Traffic control systems
• Forecasting and predictions
(B) Neuro Genetic Hybrid systems:
A Neuro Genetic hybrid system is a system that combines Neural networks:
which are capable to learn various tasks from examples, classify objects and
establish relations between them, and a Genetic algorithm: which serves
important search and optimization techniques. Genetic algorithms can be
used to improve the performance of Neural Networks and they can be used
to decide the connection weights of the inputs. These algorithms can also
be used for topology selection and training networks.
Working Flow:
• GA repeatedly modifies a population of individual solutions. GA
uses three main types of rules at each step to create the next
generation from the current population:
1. Selection to select the individuals, called parents, that
contribute to the population at the next generation
2. Crossover to combine two parents to form children for
the next generation
3. Mutation to apply random changes to individual parents
in order to form children
• GA then sends the new child generation to ANN model as a new
input parameter.
• Finally, calculating the fitness by the developed ANN model is
performed.
Advantages:
• GA is used for topology optimization i.e to select the number of
hidden layers, number of hidden nodes, and interconnection
pattern for ANN.
• In GAs, the learning of ANN is formulated as a weight optimization
problem, usually using the inverse mean squared error as a fitness
measure.
• Control parameters such as learning rate, momentum rate,
tolerance level, etc are also optimized using GA.
• It can mimic the human decision-making process.
Disadvantages:
• Highly complex system.
• The accuracy of the system is dependent on the initial population.
• Maintenance costs are very high.
Applications:
• Face recognition
• DNA matching
• Animal and human research
• Behavioral system
(C) Fuzzy Genetic Hybrid systems:
A Fuzzy Genetic Hybrid System is developed to use fuzzy logic-based
techniques for improving and modeling Genetic algorithms and vice-versa.
Genetic algorithm has proved to be a robust and efficient tool to perform
tasks like generation of the fuzzy rule base, generation of membership
function, etc.
Three approaches that can be used to develop such a system are:
• Michigan Approach
• Pittsburgh Approach
• IRL Approach
Working Flow:
• Start with an initial population of solutions that represent the first
generation.
• Feed each chromosome from the population into the Fuzzy logic
controller and compute performance index.
• Create a new generation using evolution operators till some
condition is met.
Advantages:
• GAs are used to develop the best set of rules to be used by a fuzzy
inference engine
• GAs are used to optimize the choice of membership functions.
• A Fuzzy GA is a directed random search over all discrete fuzzy
subsets.
• It can mimic the human decision-making process.
Disadvantages:
• Interpretation of results is difficult.
• Difficult to build membership values and rules.
• Takes lots of time to converge.
Applications:
• Mechanical Engineering
• Electrical Engine
• Artificial Intelligence
• Economics