You are on page 1of 27

Write short notes:

---------------------------------------------------------------------------

1.Machine Vision
---------------------------------------------------------------------------
A. Definition

1. Machine vision systems are a set of integrated components that are


designed to use information extracted from digital images to
automatically guide manufacturing and production operations such as
go/no testing and quality control processes.
2. These systems can also play a role in automated assembly verification
and inspection operations through their ability to guide material
handling equipment to position products or materials as needed in a
given process.

B. General Working of machine vision system:


 First, the sensor detects if a product is present. If there is indeed
a product passing by the sensor, the sensor will trigger a camera to
capture the image, and a light source to highlight key features.

 Next, a digitizing device called a frame-grabber takes the camera’s


image and translates it into digital output, which is then stored in
computer memory so it can be manipulated and processed by software.

 In order to process an image, computer software must perform several


tasks. First, the image is reduced in gradation to a simple black and
white format. Next, the image is analyzed by system software to
identify defects and proper components based on predetermined
criteria. After the image has been analyzed, the product will either
pass or fail inspection based on the machine vision system’s findings.

C. Machine Vision Components


These components of machine vision systems typically include the following
five elements:

 The lighting system


 The optical system or lens
 The sensor
 The vision processing system
 The communications system
Machine vision systems can be comprised of discrete elements or may be
integrated together into one unit such as a smart camera that combines the
functions of the individual elements into a single package.
Lighting
 The selection of lighting for use in a machine vision system should be
made with the goal of maximizing the contrast for whatever features
are of interest to be measured or observed while minimizing the
contrast of all other features of the part.

 Achieving this goal may require varying the amount of light used
(intensity), the style of lighting (dome vs. ring light, for example)
and the placement of the light source relative to the part and the
optical system or camera.

 Altering these basic parameters can markedly improve a machine vision


system’s ability to consistently identify and measure the part
feature(s) being monitored.

 Lighting options include LED lighting and strobe lights for capturing
images with fast shutter speeds.
Optical System
 The optical components in a machine vision system are typically a lens
or a camera, which integrates the lens with other elements such as the
sensor. The lens selection will establish the field of view, which is
the two-dimensional area over which observations can be made.

 The lens also will determine the depth of focus and the focal point,
both of which will relate to the ability to observe features on the
parts being processed by the system.

 Lenses may be interchangeable or may be fixed as part of some designs


that use a smart camera for the optical system. Lenses that have a
longer focal length will provide higher magnification of the image but
will reduce the field of view.

 The selection of the lens or optical system for use is dependent on


the specific function being performed by the machine vision system and
by the dimensions of the feature under observation.

 Color recognition capability is another characteristic of the optical


system element.
Sensor
 Sensors used in machine vision systems serve to capture the light from
the optical system and convert that into a digital image.

 Sensors use CMOS or CCD technology to capture the light and convert
that to a set of pixels that show the presence of light in the
different areas of the original part being observed.

 Sensors are measured by their resolution, which is an indication of


the number of pixels available in the digital image. Sensors that have
higher resolution can produce images with more pixels, which generally
translates to more image quality and a greater ability to resolve
details.

 The resolution of the sensor is related to the sizes of the parts


being observed, the dimensions of the measurements being made, the
tolerances of those measurements, and other application parameters.
Higher resolutions will increase the accuracy of measurements made by
the machine vision system.
Vision Processing
The vision processing element of the machine vision system takes the data
from the digital image and uses software to perform specific functions that
are then used to evaluate the part under observation. These evaluations are
pre-programmed conditions that define the acceptance and rejection criteria
for the part being observed.
The steps performed by the vision processing system include:
1.Acquiring the digital image from the sensor
2.Pre-processing the image as needed to optimize it for measurements
3.Analyzing the image to locate the specific features of the part that
need to be measured or observed
4.Collecting measurements of the needed features and comparing those
values against the defined dimensional criteria for that feature
5.Establishing a result, usually as a pass-fail or go/no-go condition
for that part
Communications
 Once the vision processing element has completed its steps, the last
element in the machine vision system involves the communications
protocol. The purpose of this element is to provide a usable output in
a standardized format that can provide a usable signal to drive other
components in the production process based upon the output from the
vision processing system. Standardized outputs include discrete I/O
signals or serial data such as RS-232 or Ethernet sent to a logging
device or other system that will make use of the data.

 A discrete I/O signal may be fed to a PLC that will use that to light
a stack light, or power solenoid driven actuator to move a rejected
part out of the main production pathway.

 A serial RS-232 data feed might be fed to an HMI screen to display


information to an operator overseeing the production process.

 System integrators can assist with the process of embedding


communication signals between machine vision systems and other
machines in the production cell.

D. Machine Vision Functions


Machine vision systems perform tasks that can be organized around four
basic categories or functions, which are:

 Measurement
 Counting
 Decoding
 Location
Measurement functions are done through the comparison of a recorded
dimension from a digital image against a standard value to establish a
tolerance or to determine if the observed value of the dimension is within
acceptable levels of tolerance as called for in the design specification
for that part.
Counting functions are used to establish whether the correct quantity of
product is in place or whether the proper number of components or elements
in a design has been produced. As an example, machine vision could be used
to determine whether a six-pack of soft drinks coming off a production line
at a bottling plant has six cans or bottles, or whether one or more is
missing. At a manufacturing facility, machine vision might be used to
inspect flanges that have been put through an automated drilling operation
to determine if the proper number of holes has been drilled into each
flange.
Decoding functions are used to decode or read one dimensional and two-
dimensional symbologies used to uniquely tag products, such as linear bar
codes, stacked symbologies, data matrix codes, QR codes, or Optical
Character Recognition (OCR) fonts. This functional capability allows for
the recording of historical data on a production process so that a record
is available of a part’s production. It can also enable automation of
product sorting and serve to validate that the correct item is coming
through the process at the correct time.
Location functions deal with establishing the position and orientation of a
part in a process. This type of capability is valuable in automated
assembly operations, as it can be used to verify that the component needed
is in the correct place and is properly aligned within allowed tolerances,
for the next step in the assembly process to occur. Machine vision systems
can also be used to identify a specific part or component by locating a
unique pattern or feature of that part, thus assuring that the item needed
is not only in the correct position but that it is the correct item and not
something else of similar appearance.
Periodic calibration of machine vision systems should take place just as
with other types of metrology equipment.

E. Specific applications
The applications for machine vision systems are widespread and cross many
types of industries. Here are a few examples of applications for machine
vision systems in different industrial settings to provide a general sense
of the diverse nature of these systems:

 Automotive manufacturing
 Guiding assembly or welding robots
 Verifying orientation of parts
 Counting the number of welds
 Checking for surface defects prior to painting
 Electronics
 Verifying the shape and position of connector pins
 Parts selection and orientation for robotic pick & place systems
 Checking for solder connection issues or other conditions on
PCBs
 General inspection of manufactured components such as LEDs
 Semiconductors
 Inspecting wafers and masks using deep ultraviolet wavelength
light (DUV) to achieve the needed high speed and high
resolution.

F. Advantages of Machine Vision Systems


Machine vision systems provide several direct benefits to manufacturers and
production line processes. The benefits of using machine vision technology
include:

 Reduction in the number of defects


Reduced defects translate into a fewer number of product recalls from
issues such as mislabeling of products, where the label applied to the
product does not match the product contents. These situations cost
manufacturers money to recall and replace mislabeled stock. The
consequences of these recalls include damage to the perceived
reputation of the manufacturer’s brand, and can also involve issues
impacting the safety of consumers, such as in the case of mislabeled
pharmaceuticals or products that contain ingredients to which some
consumers may have allergies.
 Increase in production yield
Improved yield is a direct result of having an improved ability to
catch incorrect or bad parts before they are built into larger
assemblies. The sooner that defective items can be detected and
removed from a production process, the less waste in the process,
which allows more of the raw material used in the process to be turned
into completed goods that can be sold. Scrapped material and reworked
assemblies cost time and money and show up as lower yield in
production processes.
 Reduction in downtime
The ability of machine vision systems to detect the position and
orientation of components in an assembly line allows for misaligned
components to be detected and removed from the process prior to them
potentially causing a machine to jam, resulting in downtime for that
process line. This avoids the potentially large costs associated with
production downtime.
 Improved ability to track and trace parts and products in a production
process
 Facilitation with compliance to regulations that apply to specific
product classes

---------------------------------------------------------------------------
2. Natural Language Processing (NLP):
---------------------------------------------------------------------------
A. Definition:

 Natural language processing (NLP) is a subfield of linguistics,


computer science, and artificial intelligence concerned with the
interactions between computers and human language, in particular how
to program computers to process and analyze large amounts of natural
language data. The goal is a computer capable of "understanding" the
contents of documents, including the context of the language within
them.
B. NLP Methods:
1. Statistical Approach:

 These algorithms take as input a large set of "features" that are


generated from the input data. Increasingly, however, research has
focused on statistical models, which make soft, probabilistic
decisions based on attaching real-valued weights to each input feature
(complex-valued embeddings, and neural networks in general have also
been proposed, for e.g. speech.
 Such models have the advantage that they can express the relative
certainty of many different possible answers rather than only one,
producing more reliable results when such a model is included as a
component of a larger system.
 Some of the earliest-used machine learning algorithms, such as
decision trees, produced systems of hard if-then rules similar to
existing hand-written rules. However, part-of-speech tagging
introduced the use of hidden Markov models to natural language
processing, and increasingly, research has focused on statistical
models, which make soft, probabilistic decisions based on attaching
real-valued weights to the features making up the input data. The
cache language models upon which many speech recognition systems now
rely are examples of such statistical models. Such models are
generally more robust when given unfamiliar input, especially input
that contains errors (as is very common for real-world data), and
produce more reliable results when integrated into a larger system
comprising multiple subtasks.
2. Neural Networks Approach:

 A major drawback of statistical methods is that they require elaborate


feature engineering. Popular techniques include the use of word
embeddings to capture semantic properties of words, and an increase in
end-to-end learning of a higher-level task e.g., question answering)
instead of relying on a pipeline of separate intermediate tasks (e.g.,
part-of-speech tagging and dependency parsing.
 deep neural network-based approaches may be viewed as a new paradigm
distinct from statistical natural language processing. For instance,
the term neural machine translation (NMT) emphasizes the fact that
deep learning-based approaches to machine translation directly learn
sequence-to-sequence transformations, obviating the need for
intermediate steps such as word alignment and language modeling that
was used in statistical machine translation (SMT). Latest works tend
to use non-technical structure of a given task to build proper neural
network.

C. Common NLP tasks


The following is a list of some of the most commonly researched tasks in
natural language processing. Some of these tasks have direct real-world
applications, while others more commonly serve as subtasks that are used to
aid in solving larger tasks.
Though natural language processing tasks are closely intertwined, they can
be subdivided into categories for convenience. A coarse division is given
below.
Text and speech processing
Optical character recognition (OCR)
Given an image representing printed text, determine the corresponding
text.

Speech recognition
 Given a sound clip of a person or people speaking, determine the
textual representation of the speech. This is the opposite of
text to speech and is one of the extremely difficult problems
colloquially termed "AI-complete".
 In natural speech there are hardly any pauses between successive
words, and thus speech segmentation is a necessary subtask of
speech recognition (see below). In most spoken languages, the
sounds representing successive letters blend into each other in
a process termed coarticulation, so the conversion of the analog
signal to discrete characters can be a very difficult process.
 Also, given that words in the same language are spoken by people
with different accents, the speech recognition software must be
able to recognize the wide variety of input as being identical
to each other in terms of its textual equivalent.

Speech segmentation
Given a sound clip of a person or people speaking, separate it into
words. A subtask of speech recognition and typically grouped with it.

Text-to-speech
Given a text, transform those units and produce a spoken
representation. Text-to-speech can be used to aid the visually impaired

Word segmentation (Tokenization)


 Separate a chunk of continuous text into separate words. For a
language like English, this is fairly trivial, since words are
usually separated by spaces. However, some written languages like
Chinese, Japanese and Thai do not mark word boundaries in such a
fashion, and in those languages text segmentation is a
significant task requiring knowledge of the vocabulary and
morphology of words in the language.

 Sometimes this process is also used in cases like bag of words


(BOW) creation in data mining.

Morphological analysis
Lemmatization
The task of removing inflectional endings only and to return the base
dictionary form of a word which is also known as a lemma. Lemmatization
is another technique for reducing words to their normalized form. But
in this case, the transformation actually uses a dictionary to map
words to their actual form.[22]
Morphological segmentation
Separate words into individual morphemes and identify the class of the
morphemes. The difficulty of this task depends greatly on the
complexity of the morphology (i.e., the structure of words) of the
language being considered. English has fairly simple morphology,
especially inflectional morphology, and thus it is often possible to
ignore this task entirely and simply model all possible forms of a word
(e.g., "open, opens, opened, opening") as separate words. In languages
such as Turkish or Meitei,[23] a highly agglutinated Indian language,
however, such an approach is not possible, as each dictionary entry has
thousands of possible word forms.
Part-of-speech tagging
Given a sentence, determine the part of speech (POS) for each word.
Many words, especially common ones, can serve as multiple parts of
speech. For example, "book" can be a noun ("the book on the table") or
verb ("to book a flight"); "set" can be a noun, verb or adjective; and
"out" can be any of at least five different parts of speech.

Stemming
The process of reducing inflected (or sometimes derived) words to a
base form (e.g., "close" will be the root for "closed", "closing",
"close", "closer" etc.). Stemming yields similar results as
lemmatization, but does so on grounds of rules, not a dictionary.

Syntactic analysis
Grammar induction[24]
Generate a formal grammar that describes a language's syntax.
Sentence breaking (also known as "sentence boundary disambiguation")
Given a chunk of text, find the sentence boundaries. Sentence
boundaries are often marked by periods or other punctuation marks, but
these same characters can serve other purposes (e.g., marking
abbreviations).
Parsing
Determine the parse tree (grammatical analysis) of a given sentence.
The grammar for natural languages is ambiguous and typical sentences
have multiple possible analyses: perhaps surprisingly, for a typical
sentence there may be thousands of potential parses (most of which will
seem completely nonsensical to a human). There are two primary types of
parsing: dependency parsing and constituency parsing. Dependency
parsing focuses on the relationships between words in a sentence
(marking things like primary objects and predicates), whereas
constituency parsing focuses on building out the parse tree using a
probabilistic context-free grammar (PCFG) (see also stochastic
grammar).

Lexical semantics (of individual words in context)


Lexical semantics
What is the computational meaning of individual words in context?
Distributional semantics
How can we learn semantic representations from data?
Named entity recognition (NER)
Given a stream of text, determine which items in the text map to proper
names, such as people or places, and what the type of each such name is
(e.g. person, location, organization). Although capitalization can aid
in recognizing named entities in languages such as English, this
information cannot aid in determining the type of named entity, and in
any case, is often inaccurate or insufficient. For example, the first
letter of a sentence is also capitalized, and named entities often span
several words, only some of which are capitalized. Furthermore, many
other languages in non-Western scripts (e.g. Chinese or Arabic) do not
have any capitalization at all, and even languages with capitalization
may not consistently use it to distinguish names. For example, German
capitalizes all nouns, regardless of whether they are names, and French
and Spanish do not capitalize names that serve as adjectives.

Sentiment analysis (see also Multimodal sentiment analysis)


Extract subjective information usually from a set of documents, often
using online reviews to determine "polarity" about specific objects. It
is especially useful for identifying trends of public opinion in social
media, for marketing.

Terminology extraction
The goal of terminology extraction is to automatically extract relevant
terms from a given corpus.
Word sense disambiguation (WSD)
Many words have more than one meaning; we have to select the meaning
which makes the most sense in context. For this problem, we are
typically given a list of words and associated word senses, e.g. from a
dictionary or an online resource such as WordNet.
Entity linking
Many words - typically proper names - refer to named entities; here we
have to select the entity (a famous individual, a location, a company,
etc.) which is referred to in context.

Relational semantics (semantics of individual sentences)


 Relationship extraction
Given a chunk of text, identify the relationships among named
entities (e.g. who is married to whom).
 Semantic parsing
Given a piece of text (typically a sentence), produce a
formal representation of its semantics, either as a graph
(e.g., in AMR parsing) or in accordance with a logical
formalism (e.g., in DRT parsing). This challenge typically
includes aspects of several more elementary NLP tasks from
semantics (e.g., semantic role labelling, word sense
disambiguation) and can be extended to include full-fledged
discourse analysis (e.g., discourse analysis, coreference;
see Natural language understanding below).
 Semantic role labelling
Given a single sentence, identify and disambiguate semantic
predicates (e.g., verbal frames), then identify and classify
the frame elements (semantic roles).

Discourse (semantics beyond individual sentences)


Coreference resolution
Given a sentence or larger chunk of text, determine which words
("mentions") refer to the same objects ("entities"). Anaphora
resolution is a specific example of this task, and is specifically
concerned with matching up pronouns with the nouns or names to which
they refer. The more general task of coreference resolution also
includes identifying so-called "bridging relationships" involving
referring expressions. For example, in a sentence such as "He entered
John's house through the front door", "the front door" is a referring
expression and the bridging relationship to be identified is the fact
that the door being referred to is the front door of John's house
(rather than of some other structure that might also be referred to).
Discourse analysis
This rubric includes several related tasks. One task is discourse
parsing, i.e., identifying the discourse structure of a connected text,
i.e. the nature of the discourse relationships between sentences (e.g.
elaboration, explanation, contrast). Another possible task is
recognizing and classifying the speech acts in a chunk of text (e.g.
yes-no question, content question, statement, assertion, etc.).

Implicit semantic role labelling


Given a single sentence, identify and disambiguate semantic predicates
(e.g., verbal frames) and their explicit semantic roles in the current
sentence (see Semantic role labelling above). Then, identify semantic
roles that are not explicitly realized in the current sentence,
classify them into arguments that are explicitly realized elsewhere in
the text and those that are not specified, and resolve the former
against the local text. A closely related task is zero anaphora
resolution, i.e., the extension of coreference resolution to pro-drop
languages.

Recognizing textual entailment


Given two text fragments, determine if one being true entails the
other, entails the other's negation, or allows the other to be either
true or false.[25]

Topic segmentation and recognition


Given a chunk of text, separate it into segments each of which is
devoted to a topic, and identify the topic of the segment.

Argument mining
The goal of argument mining is the automatic extraction and
identification of argumentative structures from natural language text
with the aid of computer programs.[26] Such argumentative structures
include the premise, conclusions, the argument scheme and the
relationship between the main and subsidiary argument, or the main and
counter-argument within discourse.[27][28]

Higher-level NLP applications


Automatic summarization (text summarization)
Produce a readable summary of a chunk of text. Often used to provide
summaries of the text of a known type, such as research papers,
articles in the financial section of a newspaper.
Book generation
Not an NLP task proper but an extension of natural language generation
and other NLP tasks is the creation of full-fledged books. The first
machine-generated book was created by a rule-based system in 1984
(Racter, The policeman's beard is half-constructed).[29] The first
published work by a neural network was published in 2018, 1 the Road,
marketed as a novel, contains sixty million words. Both these systems
are basically elaborate but non-sensical (semantics-free) language
models. The first machine-generated science book was published in 2019
(Beta Writer, Lithium-Ion Batteries, Springer, Cham).[30] Unlike Racter
and 1 the Road, this is grounded on factual knowledge and based on text
summarization.
Dialogue management
Computer systems intended to converse with a human.
Document AI
A Document AI platform sits on top of the NLP technology enabling users
with no prior experience of artificial intelligence, machine learning
or NLP to quickly train a computer to extract the specific data they
need from different document types. NLP-powered Document AI enables
non-technical teams to quickly access information hidden in documents,
for example, lawyers, business analysts and accountants.[31]
Grammatical error correction
Grammatical error detection and correction involves a great band-width
of problems on all levels of linguistic analysis
(phonology/orthography, morphology, syntax, semantics, pragmatics).
Grammatical error correction is impactful since it affects hundreds of
millions of people that use or acquire English as a second language. It
has thus been subject to a number of shared tasks since 2011.[32][33]
[34] As far as orthography, morphology, syntax and certain aspects of
semantics are concerned, and due to the development of powerful neural
language models such as GPT-2, this can now (2019) be considered a
largely solved problem and is being marketed in various commercial
applications.
Machine translation
Automatically translate text from one human language to another. This
is one of the most difficult problems, and is a member of a class of
problems colloquially termed "AI-complete", i.e. requiring all of the
different types of knowledge that humans possess (grammar, semantics,
facts about the real world, etc.) to solve properly.
Natural language generation (NLG):
Convert information from computer databases or semantic intents into
readable human language.
Natural language understanding (NLU)
Convert chunks of text into more formal representations such as first-
order logic structures that are easier for computer programs to
manipulate. Natural language understanding involves the identification
of the intended semantic from the multiple possible semantics which can
be derived from a natural language expression which usually takes the
form of organized notations of natural language concepts. Introduction
and creation of language metamodel and ontology are efficient however
empirical solutions. An explicit formalization of natural language
semantics without confusions with implicit assumptions such as closed-
world assumption (CWA) vs. open-world assumption, or subjective Yes/No
vs. objective True/False is expected for the construction of a basis of
semantics formalization.[35]
Question answering
Given a human-language question, determine its answer. Typical
questions have a specific right answer (such as "What is the capital of
Canada?"), but sometimes open-ended questions are also considered (such
as "What is the meaning of life?").

---------------------------------------------------------------------------
3. Industry 4:
 The first industrial revolution came with the advent of mechanisation,
steam power and water power.

 This was followed by the second industrial revolution, which revolved


around mass production and assembly lines using electricity.

 The third industrial revolution came with electronics, I.T. systems


and automation, which led to the fourth industrial revolution that is
associated with cyber physical systems.

Industry 4.0 Technologies


Generally-speaking, Industry 4.0 describes the growing trend towards
automation and data exchange in technology and processes within the
manufacturing industry, including:

 The internet of things (IoT)


 The industrial internet of things (IIoT)
 Cyber-physical systems (CPS)
 Smart manufacture
 Smart factories
 Cloud computing
 Cognitive computing
 Artificial intelligence
This automation creates a manufacturing system whereby machines in
factories are augmented with wireless connectivity and sensors to monitor
and visualise an entire production process and make autonomous decisions.
---------------------------------------------------------------------------
4.Genetic Algorithms
---------------------------------------------------------------------------
Genetic Algorithms(GAs) are adaptive heuristic search algorithms that
belong to the larger part of evolutionary algorithms. Genetic algorithms
are based on the ideas of natural selection and genetics. These are
intelligent exploitation of random search provided with historical data to
direct the search into the region of better performance in solution space.
They are commonly used to generate high-quality solutions for optimization
problems and search problems.
Genetic algorithms simulate the process of natural selection which means
those species who can adapt to changes in their environment are able to
survive and reproduce and go to next generation. In simple words, they
simulate “survival of the fittest” among individual of consecutive
generation for solving a problem. Each generation consist of a population
of individuals and each individual represents a point in search space and
possible solution. Each individual is represented as a string of
character/integer/float/bits. This string is analogous to the Chromosome.

Genetic algorithms are based on an analogy with genetic structure and


behavior of chromosomes of the population. Following is the foundation of
GAs based on this analogy –  

1.Individual in population compete for resources and mate


2.Those individuals who are successful (fittest) then mate to create
more offspring than others
3.Genes from “fittest” parent propagate throughout the generation, that
is sometimes parents create offspring which is better than either
parent.
4.Thus each successive generation is more suited for their environment.
Search space
The population of individuals are maintained within search space. Each
individual represents a solution in search space for given problem. Each
individual is coded as a finite length vector (analogous to chromosome) of
components. These variable components are analogous to Genes. Thus a
chromosome (individual) is composed of several genes (variable
components). 
Fitness Score
A Fitness Score is given to each individual which shows the ability of an
individual to “compete”. The individual having optimal fitness score (or
near optimal) are sought. 
The GAs maintains the population of n individuals (chromosome/solutions)
along with their fitness scores.The individuals having better fitness
scores are given more chance to reproduce than others. The individuals with
better fitness scores are selected who mate and produce better offspring by
combining chromosomes of parents. The population size is static so the room
has to be created for new arrivals. So, some individuals die and get
replaced by new arrivals eventually creating new generation when all the
mating opportunity of the old population is exhausted. It is hoped that
over successive generations better solutions will arrive while least fit
die. 
Each new generation has on average more “better genes” than the individual
(solution) of previous generations. Thus each new generations have better
“partial solutions” than previous generations. Once the offspring produced
having no significant difference from offspring produced by previous
populations, the population is converged. The algorithm is said to be
converged to a set of solutions for the problem.
Operators of Genetic Algorithms

Once the initial generation is created, the algorithm evolves the


generation using following operators – 
1) Selection Operator: The idea is to give preference to the individuals
with good fitness scores and allow them to pass their genes to successive
generations. 
2) Crossover Operator: This represents mating between individuals. Two
individuals are selected using selection operator and crossover sites are
chosen randomly. Then the genes at these crossover sites are exchanged thus
creating a completely new individual (offspring).
3) Mutation Operator: The key idea is to insert random genes in offspring
to maintain the diversity in the population to avoid premature convergence
The whole algorithm can be summarized as –  
1) Randomly initialize populations p
2) Determine fitness of population
3) Until convergence repeat:
a) Select parents from population
b) Crossover and generate new population
c) Perform mutation on new population
d) Calculate fitness for new population

Example problem and solution using Genetic Algorithms


Given a target string, the goal is to produce target string starting from a
random string of the same length. In the following implementation,
following analogies are made – 

 Characters A-Z, a-z, 0-9, and other special symbols are considered as
genes
 A string generated by these characters is considered as
chromosome/solution/Individual
Fitness score is the number of characters which differ from characters in
target string at a particular index. So individual having lower fitness
value is given more preference.
Why use Genetic Algorithms 

 They are Robust


 Provide optimisation over large space state.
 Unlike traditional AI, they do not break on slight change in input or
presence of noise
Application of Genetic Algorithms
Genetic algorithms have many applications, some of them are – 

 Recurrent Neural Network


 Mutation testing
 Code breaking
 Filtering and signal processing
 Learning fuzzy rule base etc
---------------------------------------------------------------------------
5. Expert Systems:
---------------------------------------------------------------------------
Artificial Intelligence is a piece of software that simulates the behaviour
and judgement of a human or an organization that has experts in a
particular domain is known as an expert system. It does this by acquiring
relevant knowledge from its knowledge base and interpreting it according to
the user’s problem. The data in the knowledge base is added by humans that
are expert in a particular domain and this software is used by a non-expert
user to acquire some information. It is widely used in many areas such as
medical diagnosis, accounting, coding, games etc. 
An expert system is AI software that uses knowledge stored in a knowledge
base to solve problems that would usually require a human expert thus
preserving a human expert’s knowledge in its knowledge base. They can
advise users as well as provide explanations to them about how they reached
a particular conclusion or advice. Knowledge Engineering is the term used
to define the process of building an Expert System and its practitioners
are called Knowledge Engineers. The primary role of a knowledge engineer is
to make sure that the computer possesses all the knowledge required to
solve a problem. The knowledge engineer must choose one or more forms in
which to represent the required knowledge as a symbolic pattern in the
memory of the computer.
Attention reader! Don’t stop learning now. Get hold of all the important
Machine Learning Concepts with the Machine Learning Foundation Course at a
student-friendly price and become industry ready.
Example : There are many examples of an expert system. Some of them are
given below –

 MYCIN
One of the earliest expert systems based on backward chaining. It can
identify various bacteria that can cause severe infections and can
also recommend drugs based on the person’s weight.
 DENDRAL
It was an artificial intelligence-based expert system used for
chemical analysis. It used a substance’s spectrographic data to
predict its molecular structure.
 R1/XCON
It could select specific software to generate a computer system wished
by the user.
 PXDES
It could easily determine the type and the degree of lung cancer in a
patient based on the data.
 CaDet
It is a clinical support system that could identify cancer in its
early stages in patients.
 DXplain
It was also a clinical support system that could suggest a variety of
diseases based on the findings of the doctor.
Components of an Expert System : 

Architecture of an Expert System

 Knowledge Base –
The knowledge base represents facts and rules. It consists of
knowledge in a particular domain as well as rules to solve a problem,
procedures and intrinsic data relevant to the domain.
 Inference Engine –
The function of the inference engine is to fetch the relevant
knowledge from the knowledge base, interpret it and to find a solution
relevant to the user’s problem. The inference engine acquires the
rules from its knowledge base and applies them to the known facts to
infer new facts. Inference engines can also include an explanation and
debugging abilities.
 Knowledge Acquisition and Learning Module –
The function of this component is to allow the expert system to
acquire more and more knowledge from various sources and store it in
the knowledge base.
 User Interface –
This module makes it possible for a non-expert user to interact with
the expert system and find a solution to the problem.
 Explanation Module –
This module helps the expert system to give the user an explanation
about how the expert system reached a particular conclusion.
The Inference Engine generally uses two strategies for acquiring knowledge
from the Knowledge Base, namely –

 Forward Chaining
 Backward Chaining
Forward Chaining –
Forward Chaining is a strategic process used by the Expert System to answer

the questions – What will happen next. This strategy is mostly used for
managing tasks like creating a conclusion, result or effect. Example –
prediction or share market movement status.
Backward Chaining –
Backward Chaining is a storage used by the Expert System to answer the
questions – Why this has happened. This strategy is mostly used to find out
the root cause or reason behind it, considering what has already happened.
Example – diagnosis of stomach pain, blood cancer or dengue, etc.

Backward Chaining
Characteristics of an Expert System :

 Human experts are perishable, but an expert system is permanent.


 It helps to distribute the expertise of a human.
 One expert system may contain knowledge from more than one human
experts thus making the solutions more efficient.
 It decreases the cost of consulting an expert for various domains such
as medical diagnosis.
 They use a knowledge base and inference engine.
 Expert systems can solve complex problems by deducing new facts
through existing facts of knowledge, represented mostly as if-then
rules rather than through conventional procedural code.
 Expert systems were among the first truly successful forms of
artificial intelligence (AI) software.
Limitations :

 Do not have human-like decision-making power.


 Cannot possess human capabilities.
 Cannot produce correct result from less amount of knowledge.
 Requires excessive training.
Advantages :

 Low accessibility cost.


 Fast response.
 Not affected by emotions, unlike humans.
 Low error rate.
 Capable of explaining how they reached a solution.
Disadvantages : 

 The expert system has no emotions.


 Common sense is the main issue of the expert system.
 It is developed for a specific domain.
 It needs to be updated manually. It does not learn itself.
 Not capable to explain the logic behind the decision.
Applications :
The application of an expert system can be found in almost all areas of
business or government. They include areas such as –

 Different types of medical diagnosis like internal medicine, blood


diseases and show on.
 Diagnosis of the complex electronic and electromechanical system.
 Diagnosis of a software development project.
 Planning experiment in biology, chemistry and molecular genetics.
 Forecasting crop damage.
 Diagnosis of the diesel-electric locomotive system.
 Identification of chemical compound structure.
 Scheduling of customer order, computer resources and various
manufacturing task.
 Assessment of geologic structure from dip meter logs.
 Assessment of space structure through satellite and robot.
 The design of VLSI system.
 Teaching students specialize task.
 Assessment of log including civil case evaluation, product liability
etc.
--------------------------------------------------------------------------
6.Deep Learning
--------------------------------------------------------------------------

 Deep learning is a type of machine learning and artificial


intelligence (AI) that imitates the way humans gain certain types of
knowledge. Deep learning is an important element of data science,
which includes statistics and predictive modeling. It is extremely
beneficial to data scientists who are tasked with collecting,
analyzing and interpreting large amounts of data; deep learning makes
this process faster and easier.
 At its simplest, deep learning can be thought of as a way to automate
predictive analytics.

 While traditional machine learning algorithms are linear, deep


learning algorithms are stacked in a hierarchy of increasing
complexity and abstraction.

 Deep learning achieves recognition accuracy at higher levels.This


helps consumer electronics meet user expectations, and it is crucial
for safety-critical applications like driverless cars. Recent advances
in deep learning have improved to the point where deep learning
outperforms humans in some tasks like classifying objects in images.
While deep learning was first theorized in the 1980s, there are two main
reasons it has only recently become useful:
1.Deep learning requires large amounts of labeled data. For example,
driverless car development requires millions of images and thousands
of hours of video.
2.Deep learning requires substantial computing power. High-performance
GPUs have a parallel architecture that is efficient for deep learning.
When combined with clusters or cloud computing, this enables
development teams to reduce training time for a deep learning network
from weeks to hours or less.

How Deep Learning Works


 Most deep learning methods use neural network architectures, which is
why deep learning models are often referred to as deep neural
networks.

 The term “deep” usually refers to the number of hidden layers in the
neural network. Traditional neural networks only contain 2-3 hidden
layers, while deep networks can have as many as 150.
Deep learning models are trained by using large sets of labeled data and
neural network architectures that learn features directly from the data
without the need for manual feature extraction.
Figure 1: Neural networks, which are organized in layers consisting of a
set of interconnected nodes. Networks can have tens or hundreds of hidden
layers.
One of the most popular types of deep neural networks is known as
convolutional neural networks (CNN or ConvNet). A CNN convolves learned
features with input data, and uses 2D convolutional layers, making this
architecture well suited to processing 2D data, such as images.
CNNs eliminate the need for manual feature extraction, so you do not need
to identify features used to classify images. The CNN works by extracting
features directly from images. The relevant features are not pretrained;
they are learned while the network trains on a collection of images. This
automated feature extraction makes deep learning models highly accurate for
computer vision tasks such as object classification.
Figure 2: Example of a network with many convolutional layers. Filters are
applied to each training image at different resolutions, and the output of
each convolved image serves as the input to the next layer.
CNNs learn to detect different features of an image using tens or hundreds
of hidden layers. Every hidden layer increases the complexity of the
learned image features. For example, the first hidden layer could learn how
to detect edges, and the last learns how to detect more complex shapes
specifically catered to the shape of the object we are trying to recognize.
Difference Between Machine Learning and Deep Learning?
Deep learning is a specialized form of machine learning. A machine learning
workflow starts with relevant features being manually extracted from
images. The features are then used to create a model that categorizes the
objects in the image. With a deep learning workflow, relevant features are
automatically extracted from images. In addition, deep learning performs
“end-to-end learning” – where a network is given raw data and a task to
perform, such as classification, and it learns how to do this
automatically.
Another key difference is deep learning algorithms scale with data, whereas
shallow learning converges. Shallow learning refers to machine learning
methods that plateau at a certain level of performance when you add more
examples and training data to the network.
A key advantage of deep learning networks is that they often continue to
improve as the size of your data increases.

Figure 3. Comparing a machine learning approach to categorizing vehicles


(left) with deep learning (right).
In machine learning, you manually choose features and a classifier to sort
images. With deep learning, feature extraction and modeling steps are
automatic.
How to Create and Train Deep Learning Models
The three most common ways people use deep learning to perform object
classification are:
Training from Scratch
To train a deep network from scratch, you gather a very large labeled data
set and design a network architecture that will learn the features and
model. This is good for new applications, or applications that will have a
large number of output categories. This is a less common approach because
with the large amount of data and rate of learning, these networks
typically take days or weeks to train.
Transfer Learning
Most deep learning applications use the transfer learning approach, a
process that involves fine-tuning a pretrained model. You start with an
existing network, such as AlexNet or GoogLeNet, and feed in new data
containing previously unknown classes. After making some tweaks to the
network, you can now perform a new task, such as categorizing only dogs or
cats instead of 1000 different objects. This also has the advantage of
needing much less data (processing thousands of images, rather than
millions), so computation time drops to minutes or hours.
Transfer learning requires an interface to the internals of the pre-
existing network, so it can be surgically modified and enhanced for the new
task.
Feature Extraction
A slightly less common, more specialized approach to deep learning is to
use the network as a feature extractor. Since all the layers are tasked
with learning certain features from images, we can pull these features out
of the network at any time during the training process. These features can
then be used as input to a machine learning model such as support vector
machines (SVM).
Applications of Deep Learning

1. Virtual Assistants
Virtual Assistants are cloud-based applications that understand natural
language voice commands and complete tasks for the user. Amazon Alexa,
Cortana, Siri, and Google Assistant are typical examples of virtual
assistants. They need internet-connected devices to work with their full
capabilities. Each time a command is fed to the assistant, they tend to
provide a better user experience based on past experiences using Deep
Learning algorithms.

2. Chatbots
Chatbots can solve customer problems in seconds. A chatbot is an AI
application to chat online via text or text-to-speech. It is capable of
communicating and performing actions similar to a human. Chatbots are used
a lot in customer interaction, marketing on social network sites, and
instant messaging the client. It delivers automated responses to user
inputs. It uses machine learning and deep learning algorithms to generate
different types of reactions.
The next important deep learning application is related to Healthcare.

3. Healthcare
Deep Learning has found its application in the Healthcare sector. Computer-
aided disease detection and computer-aided diagnosis have been possible
using Deep Learning. It is widely used for medical research, drug
discovery, and diagnosis of life-threatening diseases such as cancer and
diabetic retinopathy through the process of medical imaging.
4.
Deep learning applications are used in industries from automated driving to
medical devices.
Automated Driving: Automotive researchers are using deep learning to
automatically detect objects such as stop signs and traffic lights. In
addition, deep learning is used to detect pedestrians, which helps decrease
accidents.
Aerospace and Defense: Deep learning is used to identify objects from
satellites that locate areas of interest, and identify safe or unsafe zones
for troops.
Medical Research: Cancer researchers are using deep learning to
automatically detect cancer cells. Teams at UCLA built an advanced
microscope that yields a high-dimensional data set used to train a deep
learning application to accurately identify cancer cells.
Industrial Automation: Deep learning is helping to improve worker safety
around heavy machinery by automatically detecting when people or objects
are within an unsafe distance of machines.
Electronics: Deep learning is being used in automated hearing and speech
translation. For example, home assistance devices that respond to your
voice and know your preferences are powered by deep learning applications.

You might also like