ARTIFICIAL INTELLIGENCE
ARTIFICIAL INTELLIGENCE
Artificial Intelligence : Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial
defines "man-made," and intelligence defines "thinking power", hence AI means "a man-made thinking power."
So, we can define AI as:
"It is a branch of computer science by which we can create intelligent machines which can behave like a human, think
like humans, and able to make decisions."
Goals of Artificial Intelligence
Following are the main goals of Artificial Intelligence:
1. Replicate human intelligence
2. Solve Knowledge-intensive tasks
3. An intelligent connection of perception and action
4. Building a machine which can perform tasks that requires human intelligence such as:
o Proving a theorem
o Playing chess
o Plan some surgical operation
o Driving a car in traffic
5. Creating some system which can exhibit intelligent behavior, learn new things by itself, demonstrate, explain, and
can advise to its user.
Applications of AI
AI in Astronomy
o Artificial Intelligence can be very useful to solve complex universe problems. AI technology can be helpful for
understanding the universe such as how it works, origin, etc.
2. AI in Healthcare
o In the last, five to ten years, AI becoming more advantageous for the healthcare industry and going to have a
significant impact on this industry.
o Healthcare Industries are applying AI to make a better and faster diagnosis than humans. AI can help doctors with
diagnoses and can inform when patients are worsening so that medical help can reach to the patient before
hospitalization.
3. AI in Gaming
o AI can be used for gaming purpose. The AI machines can play strategic games like chess, where the machine
needs to think of a large number of possible places.
4. AI in Finance
o AI and finance industries are the best matches for each other. The finance industry is implementing automation,
chatbot, adaptive intelligence, algorithm trading, and machine learning into financial processes.
5. AI in Data Security
o The security of data is crucial for every company and cyber-attacks are growing very rapidly in the digital world.
AI can be used to make your data more safe and secure. Some examples such as AEG bot, AI2 Platform,are used
to determine software bug and cyber-attacks in a better way.
6. AI in Social Media
o Social Media sites such as Facebook, Twitter, and Snapchat contain billions of user profiles, which need to be
stored and managed in a very efficient way. AI can organize and manage massive amounts of data. AI can analyze
lots of data to identify the latest trends, hashtag, and requirement of different users.
7. AI in Travel & Transport
o AI is becoming highly demanding for travel industries. AI is capable of doing various travel related works such as
from making travel arrangement to suggesting the hotels, flights, and best routes to the customers. Travel
industries are using AI-powered chatbots which can make human-like interaction with customers for better and
fast response.
8. AI in Automotive Industry
o Some Automotive industries are using AI to provide virtual assistant to their user for better performance. Such as
Tesla has introduced teslabot, an intelligent virtual assistant.
o Various Industries are currently working for developing self-driven cars which can make your journey more safe
and secure.
9. AI in Robotics:
o Artificial Intelligence has a remarkable role in Robotics. Usually, general robots are programmed such that they
can perform some repetitive task, but with the help of AI, we can create intelligent robots which can perform tasks
with their own experiences without pre-programmed.
o Humanoid Robots are best examples for AI in robotics, recently the intelligent Humanoid robot named as Erica
and Sophia has been developed which can talk and behave like humans.
10. AI in Entertainment
o We are currently using some AI based applications in our daily life with some entertainment services such as
Netflix or Amazon. With the help of ML/AI algorithms, these services show the recommendations for programs
or shows.
11. AI in Agriculture
o Agriculture is an area which requires various resources, labor, money, and time for best result. Now a day's
agriculture is becoming digital, and AI is emerging in this field. Agriculture is applying AI as agriculture robotics,
solid and crop monitoring, predictive analysis. AI in agriculture can be very helpful for farmers.
12. AI in E-commerce
o AI is providing a competitive edge to the e-commerce industry, and it is becoming more demanding in the e-
commerce business. AI is helping shoppers to discover associated products with recommended size, color, or
even brand.
13. AI in education:
o AI can automate grading so that the tutor can have more time to teach. AI chatbot can communicate with students
as a teaching assistant.
o AI in the future can be work as a personal virtual tutor for students, which will be accessible easily at any time
and any place.
Types of Artificial Intelligence:
Artificial Intelligence can be divided in various types, there are mainly two types of main categorization which are based
on capabilities and based on functionally of AI. Following is flow diagram which explain the types of AI.
1. User Interface
With the help of a user interface, the expert system interacts with the user, takes queries as an input in a readable format,
and passes it to the inference engine. After getting the response from the inference engine, it displays the output to the
user. In other words, it is an interface that helps a non-expert user to communicate with the expert system to find a
solution.
2. Inference Engine(Rules of Engine)
o The inference engine is known as the brain of the expert system as it is the main processing unit of the system. It
applies inference rules to the knowledge base to derive a conclusion or deduce new information. It helps in
deriving an error-free solution of queries asked by the user.
o With the help of an inference engine, the system extracts the knowledge from the knowledge base.
o There are two types of inference engine:
o Deterministic Inference engine: The conclusions drawn from this type of inference engine are assumed to be
true. It is based on facts and rules.
o Probabilistic Inference engine: This type of inference engine contains uncertainty in conclusions, and based on
the probability.
Inference engine uses the below modes to derive the solutions:
o Forward Chaining: It starts from the known facts and rules, and applies the inference rules to add their
conclusion to the known facts.
o Backward Chaining: It is a backward reasoning method that starts from the goal and works backward to prove
the known facts.
3. Knowledge Base
o The knowledgebase is a type of storage that stores knowledge acquired from the different experts of the particular
domain. It is considered as big storage of knowledge. The more the knowledge base, the more precise will be the
Expert System.
o It is similar to a database that contains information and rules of a particular domain or subject.
o One can also view the knowledge base as collections of objects and their attributes. Such as a Lion is an object
and its attributes are it is a mammal, it is not a domestic animal, etc.
o
Components of Knowledge Base
o Factual Knowledge: The knowledge which is based on facts and accepted by knowledge engineers comes under
factual knowledge.
o Heuristic Knowledge: This knowledge is based on practice, the ability to guess, evaluation, and experiences.
Knowledge Representation: It is used to formalize the knowledge stored in the knowledge base using the If-else rules.
Knowledge Acquisitions: It is the process of extracting, organizing, and structuring the domain knowledge, specifying
the rules to acquire the knowledge from various experts, and store that knowledge into the knowledge base.
Uninformed/Blind Search:
The uninformed search does not contain any domain knowledge such as closeness, the location of the goal. It operates in a
brute-force way as it only includes information about how to traverse the tree and how to identify leaf and goal nodes.
Uninformed search applies a way in which search tree is searched without any information about the search space like
initial state operators and test for the goal, so it is also called blind search.It examines each node of the tree until it
achieves the goal node.
It can be divided into five main types:
o Breadth-first search
o Uniform cost search
o Depth-first search
o Iterative deepening depth-first search
o Bidirectional Search
Informed Search
Informed search algorithms use domain knowledge. In an informed search, problem information is available which can
guide the search. Informed search strategies can find a solution more efficiently than an uninformed search strategy.
Informed search is also called a Heuristic search.
A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to find a good solution in
reasonable time.
Informed search can solve much complex problem which could not be solved in another way.
An example of informed search algorithms is a traveling salesman problem.
1. Greedy Search
2. A* Search
Hill Climbing Algorithm in Artificial Intelligence
o Hill climbing algorithm is a local search algorithm which continuously moves in the direction of increasing
elevation/value to find the peak of the mountain or best solution to the problem. It terminates when it reaches a
peak value where no neighbor has a higher value.
o Hill climbing algorithm is a technique which is used for optimizing the mathematical problems. One of the widely
discussed examples of Hill climbing algorithm is Traveling-salesman Problem in which we need to minimize the
distance traveled by the salesman.
o It is also called greedy local search as it only looks to its good immediate neighbor state and not beyond that.
o A node of hill climbing algorithm has two components which are state and value.
o Hill Climbing is mostly used when a good heuristic is available.
o In this algorithm, we don't need to maintain and handle the search tree or graph as it only keeps a single current
state.
Features of Hill Climbing:
Following are some main features of Hill Climbing Algorithm:
o Generate and Test variant: Hill Climbing is the variant of Generate and Test method. The Generate and Test
method produce feedback which helps to decide which direction to move in the search space.
o Greedy approach: Hill-climbing algorithm search moves in the direction which optimizes the cost.
o No backtracking: It does not backtrack the search space, as it does not remember the previous states.
State-space Diagram for Hill Climbing:
The state-space landscape is a graphical representation of the hill-climbing algorithm which is showing a graph between
various states of algorithm and Objective function/Cost.
On Y-axis we have taken the function which can be an objective function or cost function, and state-space on the x-axis. If
the function on Y-axis is cost then, the goal of search is to find the global minimum and local minimum. If the function of
Y-axis is Objective function, then the goal of the search is to find the global maximum and local maximum.
The first step is to initialize the search by setting the initial state as the current state. After the initialization step, we check
if the current state is a goal state. Finally, if the current state is a goal state, we terminate the algorithm and return the
result.
However, if the current state is not the goal state, we generate the set of possible states that can be reached from the
current state. Additionally, these states are known as successor states. Furthermore, for each successor state, we check if it
has been previously visited. If the state is already explored, we skip the state. If it has not been visited, we add it to the
queue of states to be visited.
Moving forward, we set the next state in the queue as the current state and check if it’s a goal state. If we find the goal
state, we return the result. Otherwise, we repeat the previous step until we find the goal state or finish exploring all the
states. Furthermore, if all possible states have been explored and we can’t reach the target state, we return with no
solution.
Example
A common example of a state space search is the 8-puzzle problem. The 8-puzzle is a sliding puzzle that consists of 8
numbered tiles in a 3 3 grid and one blank space. The goal is to rearrange the tiles from a given initial state to a final goal
state by sliding the tiles into the blank space.
In this problem, we represent the state space by the 9 tiles in the puzzle and their positions in the grid. Additionally, we
present each state in the state space by a 3 3 array with values from 1 to 8. Finally, we represent a blank space with an
employ tile.
The initial state represents the starting configuration of the tiles. The goal state represents the desired configuration.
Furthermore, the search algorithms use the state space to find a sequence of moves that transform the initial state into the
goal state.
For example, we can use the breadth-first search to explore all possible states reachable from the initial state. It explores
all the states one by one in a sequence. It ensures the solution but can become very slow for large state spaces. Other
algorithms, such as A* search, use heuristics to guide the search more efficiently.
We’re taking a practical example of an 8-puzzle problem. Let’s pick current and target states for this example:
Here, we aim to start from the current state and reach the target state by sliding the numbers through the bank.
Furthermore, the approach is to explore all the states we can reach from the current state. For each new state, we check if
it’s the target state or not. Let’s take a look at how to reach the target state from the current state:
In this search example, we are using two lists which are OPEN and CLOSED Lists. Following are the iteration for
traversing the above example.
At each point in the search space, only those node is expanded which have the lowest value of f(n), and the algorithm
terminates when the goal node is found.
Algorithm of A* search:
Step1: Place the starting node in the OPEN list.
Step 2: Check if the OPEN list is empty or not, if the list is empty then return failure and stops.
Step 3: Select the node from the OPEN list which has the smallest value of evaluation function (g+h), if node n is goal
node then return success and stop, otherwise
Step 4: Expand node n and generate all of its successors, and put n into the closed list. For each successor n', check
whether n' is already in the OPEN or CLOSED list, if not then compute evaluation function for n' and place into Open list.
Step 5: Else if node n' is already in OPEN and CLOSED, then it should be attached to the back pointer which reflects the
lowest g(n') value.
Step 6: Return to Step 2.
Advantages:
o A* search algorithm is the best algorithm than other search algorithms.
o A* search algorithm is optimal and complete.
o This algorithm can solve very complex problems.
Disadvantages:
o It does not always produce the shortest path as it mostly based on heuristics and approximation.
o A* search algorithm has some complexity issues.
o The main drawback of A* is memory requirement as it keeps all generated nodes in the memory, so it is not
practical for various large-scale problems.
Example:
In this example, we will traverse the given graph using the A* algorithm. The heuristic value of all states is given in the
below table so we will calculate the f(n) of each state using the formula f(n)= g(n) + h(n), where g(n) is the cost to reach
any node from start state.
Here we will use OPEN and CLOSED list.
Solution:
Initialization: {(S, 5)}
Iteration1: {(S--> A, 4), (S-->G, 10)}
Iteration2: {(S--> A-->C, 4), (S--> A-->B, 7), (S-->G, 10)}
Iteration3: {(S--> A-->C--->G, 6), (S--> A-->C--->D, 11), (S--> A-->B, 7), (S-->G, 10)}
Iteration 4 will give the final result, as S--->A--->C--->G it provides the optimal path with cost 6.
AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent behavior:
o Perception
o Learning
o Knowledge Representation and Reasoning
o Planning
o Execution
The above diagram is showing how an AI system can interact with the real world and what components help it to show
intelligence. AI system has Perception component by which it retrieves information from its environment. It can be visual,
audio or another form of sensory input. The learning component is responsible for learning from data captured by
Perception comportment. In the complete cycle, the main components are knowledge representation and Reasoning. These
two components are involved in showing the intelligence in machine-like humans. These two components are independent
with each other but also coupled together. The planning and execution depend on analysis of Knowledge representation
and reasoning.
Approaches to knowledge representation:
There are mainly four approaches to knowledge representation, which are givenbelow:
1. Simple relational knowledge:
o It is the simplest way of storing facts which uses the relational method, and each fact about a set of the object is
set out systematically in columns.
o This approach of knowledge representation is famous in database systems where the relationship between
different entities is represented.
o This approach has little opportunity for inference.
Example: The following is the simple relational knowledge representation.
Player Weight Age
Player1 65 23
Player2 58 18
Player3 75 24
2. Inheritable knowledge:
o In the inheritable knowledge approach, all data must be stored into a hierarchy of classes.
o All classes should be arranged in a generalized form or a hierarchal manner.
o In this approach, we apply inheritance property.
o Elements inherit values from other members of a class.
o This approach contains inheritable knowledge which shows a relation between instance and class, and it is called
instance relation.
o Every individual frame can represent the collection of attributes and its value.
o In this approach, objects and values are represented in Boxed nodes.
o We use Arrows which point from objects to their values.
o Example:
3. Inferential knowledge:
o Inferential knowledge approach represents knowledge in the form of formal logics.
o This approach can be used to derive more facts.
o It guaranteed correctness.
o Example: Let's suppose there are two statements:
a. Marcus is a man
b. All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)s
4. Procedural knowledge:
o Procedural knowledge approach uses small programs and codes which describes how to do specific things, and
how to proceed.
o In this approach, one important rule is used which is If-Then rule.
o In this knowledge, we can use various coding languages such as LISP language and Prolog language.
o We can easily represent heuristic or domain-specific knowledge using this approach.
o But it is not necessary that we can represent all cases in this approach.
Requirements for knowledge Representation system:
A good knowledge representation system must possess the following properties.
1. 1. Representational Accuracy:
KR system should have the ability to represent all kind of required knowledge.
2. 2. Inferential Adequacy:
KR system should have ability to manipulate the representational structures to produce new knowledge
corresponding to existing structure.
3. 3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the most productive directions by storing
appropriate guides.
4. 4. Acquisitional efficiency- The ability to acquire the new knowledge easily using automatic methods.
Techniques of knowledge representation
There are mainly four ways of knowledge representation which are given as follows:
1. Logical Representation
2. Semantic Network Representation
3. Frame Representation
4. Production Rules
1. Logical Representation
Logical representation is a language with some concrete rules which deals with propositions and has no ambiguity in
representation. Logical representation means drawing a conclusion based on various conditions. This representation lays
down some important communication rules. It consists of precisely defined syntax and semantics which supports the
sound inference. Each sentence can be translated into logics using syntax and semantics.
Syntax:
o Syntaxes are the rules which decide how we can construct legal sentences in the logic.
o It determines which symbol we can use in knowledge representation.
o How to write those symbols.
Semantics:
o Semantics are the rules by which we can interpret the sentence in the logic.
o Semantic also involves assigning a meaning to each sentence.
Logical representation can be categorised into mainly two logics:
a. Propositional Logics
b. Predicate logics
Advantages of logical representation:
1. Logical representation enables us to do logical reasoning.
2. Logical representation is the basis for the programming languages.
Disadvantages of logical Representation:
1. Logical representations have some restrictions and are challenging to work with.
2. Logical representation technique may not be very natural, and inference may not be so efficient.
2. Semantic Network Representation
Semantic networks are alternative of predicate logic for knowledge representation. In Semantic networks, we can
represent our knowledge in the form of graphical networks. This network consists of nodes representing objects and arcs
which describe the relationship between those objects. Semantic networks can categorize the object in different forms and
can also link those objects. Semantic networks are easy to understand and can be easily extended.
This representation consist of mainly two types of relations:
a. IS-A relation (Inheritance)
b. Kind-of-relation
Example: Following are some statements which we need to represent in the form of nodes and arcs.
Statements:
a. Jerry is a cat.
b. Jerry is a mammal
c. Jerry is owned by Priya.
d. Jerry is brown colored.
e. All Mammals are animal.
In the above diagram, we have represented the different type of knowledge in the form of nodes and arcs. Each object is
connected with another object by some relation.
Drawbacks in Semantic representation:
1. Semantic networks take more computational time at runtime as we need to traverse the complete network tree to
answer some questions. It might be possible in the worst case scenario that after traversing the entire tree, we find
that the solution does not exist in this network.
2. Semantic networks try to model human-like memory (Which has 1015 neurons and links) to store the information,
but in practice, it is not possible to build such a vast semantic network.
3. These types of representations are inadequate as they do not have any equivalent quantifier, e.g., for all, for some,
none, etc.
4. Semantic networks do not have any standard definition for the link names.
5. These networks are not intelligent and depend on the creator of the system.
Advantages of Semantic network:
1. Semantic networks are a natural representation of knowledge.
2. Semantic networks convey meaning in a transparent manner.
3. These networks are simple and easily understandable.
3. Frame Representation
A frame is a record like structure which consists of a collection of attributes and its values to describe an entity in the
world. Frames are the AI data structure which divides knowledge into substructures by representing stereotypes situations.
It consists of a collection of slots and slot values. These slots may be of any type and sizes. Slots have names and values
which are called facets.
Facets: The various aspects of a slot is known as Facets. Facets are features of frames which enable us to put constraints
on the frames. Example: IF-NEEDED facts are called when data of any particular slot is needed. A frame may consist of
any number of slots, and a slot may include any number of facets and facets may have any number of values. A frame is
also known as slot-filter knowledge representation in artificial intelligence.
Frames are derived from semantic networks and later evolved into our modern-day classes and objects. A single frame is
not much useful. Frames system consist of a collection of frames which are connected. In the frame, knowledge about an
object or event can be stored together in the knowledge base. The frame is a type of technology which is widely used in
various applications including Natural language processing and machine visions.
Example: 1
Let's take an example of a frame for a book
Slots Filters
Title Artificial Intelligence
Genre Computer Science
Author Peter Norvig
Edition Third Edition
Year 1996
Page 1152
Example 2:
Let's suppose we are taking an entity, Peter. Peter is an engineer as a profession, and his age is 25, he lives in city London,
and the country is England. So following is the frame representation for this:
Slots Filter
Name Peter
Profession Doctor
Age 25
Marital status Single
Weight 78
Advantages of frame representation:
1. The frame knowledge representation makes the programming easier by grouping the related data.
2. The frame representation is comparably flexible and used by many applications in AI.
3. It is very easy to add slots for new attribute and relations.
4. It is easy to include default data and to search for missing values.
5. Frame representation is easy to understand and visualize.
Disadvantages of frame representation:
1. In frame system inference mechanism is not be easily processed.
2. Inference mechanism cannot be smoothly proceeded by frame representation.
3. Frame representation has a much generalized approach.
4. Production Rules
Production rules system consist of (condition, action) pairs which mean, "If condition then action". It has mainly three
parts:
o The set of production rules
o Working Memory
o The recognize-act-cycle
In production rules agent checks for the condition and if the condition exists then production rule fires and corresponding
action is carried out. The condition part of the rule determines which rule may be applied to a problem. And the action
part carries out the associated problem-solving steps. This complete process is called a recognize-act cycle.
The working memory contains the description of the current state of problems-solving and rule can write knowledge to
the working memory. This knowledge match and may fire other rules.
If there is a new situation (state) generates, then multiple production rules will be fired together, this is called conflict set.
In this situation, the agent needs to select a rule from these sets, and it is called a conflict resolution.
Example:
o IF (at bus stop AND bus arrives) THEN action (get into the bus)
o IF (on the bus AND paid AND empty seat) THEN action (sit down).
o IF (on bus AND unpaid) THEN action (pay charges).
o IF (bus arrives at destination) THEN action (get down from the bus).
Advantages of Production rule:
1. The production rules are expressed in natural language.
2. The production rules are highly modular, so we can easily remove, add or modify an individual rule.
Disadvantages of Production rule:
1. Production rule system does not exhibit any learning capabilities, as it does not store the result of the problem for
the future uses.
2. During the execution of the program, many rules may be active hence rule-based production systems are
inefficient.
Difference between Propositional Logic and Predicate Logic
Logical reasoning forms the basis for a huge domain of computer science and mathematics. They help in establishing
mathematical arguments, valid or invalid.
1. Propositional Logic :
A proposition is basically a declarative sentence that has a truth value. Truth value can either be true or false, but it needs
to be assigned any of the two values and not be ambiguous. The purpose of using propositional logic is to analyze a
statement, individually or compositely.
For example :
The following statements :
1. (a+b)2 = a2 + 2ab + b2
2. If x is real, then x2 >= 0
3. If x is real, then x2 < 0
4. The sun rises in the east.
5. The sun rises in the west.
Are all propositions because they have a specific truth value, true or false.
The branch of logic that deals with proposition is propositional logic.
2. Predicate Logic :
Predicates are properties, additional information to better express the subject of the sentence. A quantified predicate is a
proposition , that is, when you assign values to a predicate with variables it can be made a proposition.
For example :
In P(x) : x>5, x is the subject or the variable and ‘>5’ is the predicate.
P(7) : 7>5 is a proposition where we are assigning values to the variable x, and it has a truth value, i.e. True.
The set of values that the variables of the predicate can assume is called the Universe or Domain of Discourse or Domain
of Predicate.
Difference between Propositional Logic and Predicate Logic :
Propositional Equivalences
Introduction
Two logical expressions are said to be equivalent if they have the same truth value in all cases. Sometimes this fact helps
in proving a mathematical result by replacing one expression with another equivalent expression, without changing the
truth value of the original compound proposition.
Types of propositions based on Truth values
There are three types of propositions when classified according to their truth values
1. Tautology – A proposition which is always true, is called a tautology.
2. Contradiction – A proposition which is always false, is called a contradiction.
3. Contingency – A proposition that is neither a tautology nor a contradiction is called a contingency.
What is perception
Perception is the process of acquiring, interpreting, selecting, and organizing sensory information.
Perception presumes sensation, where various types of sensors each converts a certain type of simple signal into data of
the system. To put the data together and to make sense out of them is the job of the perception mechanism.
Perception can be seen as a special type of categorization (or classification, pattern recognition) where the inputs are
sensory data, and the outputs are categorical judgments and conceptual relations.
The difficulty of the task comes from the need of multiple levels of abstraction, where the relations among data items are
many-to-many, uncertain, and changing over time.
Accurately speaking, we never "see things as they are", and perception process of an intelligent system is often (and
should be) influenced by internal and external factors beside the signals themselves. Furthermore, perception is not a pure
passive process driven by the input.
In AI, the study on perception is mostly focused on the reproduction of human perception, especially on the perception of
aural and visual signals. However, this is not necessarily the case since the perception mechanism of a computer system
does not have to be identical to that of a human being.
Artificial Neural Network has a huge number of interconnected processing elements, also known as Nodes. These nodes
are connected with other nodes using a connection link. The connection link contains weights, these weights contain the
information about the input signal. Each iteration and input in turn leads to updation of these weights. After inputting all
the data instances from the training data set, the final weights of the Neural Network along with its architecture is known
as the Trained Neural Network. This process is called Training of Neural Networks.These trained neural networks solve
specific problems as defined in the problem statement.
Types of tasks that can be solved using an artificial neural network include Classification problems, Pattern Matching,
Data Clustering, etc.
Importance of Neural Networks
We use artificial neural networks because they learn very efficiently and adaptively. They have the capability to learn
“how” to solve a specific problem from the training data it receives. After learning, it can be used to solve that specific
problem very quickly and efficiently with high accuracy.
Some real-life applications of neural networks include Air Traffic Control, Optical Character Recognition as used by
some scanning apps like Google Lens, Voice Recognition, etc.
What are Neural Networks Used For?
Neural networks are employed across various domains for:
• Identifying objects, faces, and understanding spoken language in applications like self-driving cars and voice assistants.
• Analyzing and understanding human language, enabling sentiment analysis, chatbots, language translation, and text
generation.
• Diagnosing diseases from medical images, predicting patient outcomes, and drug discovery.
• Predicting stock prices, credit risk assessment, fraud detection, and algorithmic trading.
• Personalizing content and recommendations in e-commerce, streaming platforms, and social media.
• Powering robotics and autonomous vehicles by processing sensor data and making real-time decisions.
• Enhancing game AI, generating realistic graphics, and creating immersive virtual environments.
• Monitoring and optimizing manufacturing processes, predictive maintenance, and quality control.
• Analyzing complex datasets, simulating scientific phenomena, and aiding in research across disciplines.
• Generating music, art, and other creative content.
Types of Neural Network in Machine Learning
Explore different kinds of neural networks in machine learning in this section:
(i) ANN
ANN is also known as an artificial neural network. It is a feed-forward neural network because the inputs are sent in the
forward direction. It can also contain hidden layers which can make the model even denser. They have a fixed length as
specified by the programmer. It is used for Textual Data or Tabular Data. A widely used real-life application is Facial
Recognition. It is comparatively less powerful than CNN and RNN.
(ii) CNN
Convolutional Neural Networks is mainly used for Image Data. It is used for Computer Vision. Some of the real-life
applications are object detection in autonomous vehicles. It contains a combination of convolutional layers and neurons. It
is more powerful than both ANN and RNN.
(iii) RNN
It is also known as Recurrent Neural Networks. It is used to process and interpret time series data. In this type of model,
the output from a processing node is fed back into nodes in the same or previous layers. The most known types of RNN
are LSTM (Long Short Term Memory) Networks
Now that we know the basics about Neural Networks, We know that Neural Networks’ learning capability is what makes
it interesting. There are 3 types of learnings in Neural networks, namely
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement Learning
Supervised Learning
As the name suggests, it is a type of learning that is looked after by a supervisor. It is like learning with a teacher. There
are input training pairs that contain a set of input and the desired output. Here the output from the model is compared with
the desired output and an error is calculated, this error signal is sent back into the network for adjusting the weights. This
adjustment is done till no more adjustments can be made and the output of the model matches the desired output. In this,
there is feedback from the environment to the model.
Unsupervised Learning
Unlike supervised learning, there is no supervisor or a teacher here. In this type of learning, there is no feedback from the
environment, there is no desired output and the model learns on its own. During the training phase, the inputs are formed
into classes that define the similarity of the members. Each class contains similar input patterns. On inputting a new
pattern, it can predict to which class that input belongs based on similarity with other patterns. If there is no such class, a
new class is formed.
Reinforcement Learning
It gets the best of both worlds, that is, the best of both Supervised learning and Unsupervised learning. It is like learning
with a critique. Here there is no exact feedback from the environment, rather there is critique feedback. The critique tells
how close our solution is. Hence the model learns on its own based on the critique information. It is similar to supervised
learning in that it receives feedback from the environment, but it is different in that it does not receive the desired output
information, rather it receives critique information.
How Does a Neural Network work?
According to Arthur Samuel, one of the early American pioneers in the field of computer gaming and artificial
intelligence, he defined machine learning as:
Example
Suppose we arrange for some automatic means of testing the effectiveness of any current weight assignment in terms of
actual performance and provide a mechanism for altering the weight assignment so as to maximize the performance. We
need not go into the details of such a procedure to see that it could be made entirely automatic and to see that a machine so
programmed would “learn” from its experience.
The first neuron from the first layer is connected to all the inputs from the previous layer, Similarly, the second neuron
from the first hidden layer will also be connected to all the inputs from the previous layer and so on for all the neurons in
the first hidden layer.
For neurons in the second hidden layer (outputs of the previously hidden layer) are considered as inputs and each of these
neurons are connected to previous neurons, likewise. This whole process is called Forward propagation.
After this, there is an interesting thing that happens. Once we have predicted the output it is then compared to the actual
output. We then calculate the loss and try to minimize it. But how can we minimize this loss? For this, there comes
another concept which is known as Back Propagation. We will understand more about this in another article. I will tell
you how it works. First, the loss is calculated then weights and biases are adjusted in such a way that they try to minimize
the loss. Weights and biases are updated with the help of another algorithm called gradient descent. We will understand
more about gradient descent in a later section. We basically move in the direction opposite to the gradient. This concept is
derived from the Taylor series.
Deep Learning vs Machine Learning: Neural Networks
Here’s a comparison of Machine Learning and Deep Learning in the context of neural networks:
Aspect Machine Learning Deep Learning
Hierarchy of Layers Typically shallow architectures Deep architectures with many layers
Feature Extraction Manual feature engineering needed Automatic feature extraction and representation
learning
Feature Learning Limited ability to learn complex features Can learn intricate hierarchical features
Performance May have limitations on complex tasks Excels in complex tasks, especially with big data
Data Requirements Requires carefully curated features Can work with raw, unprocessed data
Training Complexity Relatively simpler to train Requires substantial computation power
Domain Specificity May need domain-specific tuning Can generalize across domains
Applications Effective for smaller datasets Particularly effective with large datasets
Representations Relies on handcrafted feature representations Learns hierarchical representations
Interpretability Offers better interpretability Often seen as a “black box”
Algorithm Diversity Utilizes various algorithms like SVM, Random Mostly relies on neural networks
Forest
Computational Lighter computational requirements Heavy computational demand
Demand
Scalability May have limitations in scaling up Scales well with increased data and resources
Supervised learning needs supervision to train the model, which is similar to as a student learns things in the presence of a
teacher. Supervised learning can be used for two types of problems: Classification and Regression.
Learn more Supervised Machine Learning
Example: Suppose we have an image of different types of fruits. The task of our supervised learning model is to identify
the fruits and classify them accordingly. So to identify the image in supervised learning, we will give the input data as
well as output for that, which means we will train the model by the shape, size, color, and taste of each fruit. Once the
training is completed, we will test the model by giving the new set of fruit. The model will identify the fruit and predict
the output using a suitable algorithm.
Unsupervised Machine Learning:
Unsupervised learning is another machine learning method in which patterns inferred from the unlabeled input data. The
goal of unsupervised learning is to find the structure and patterns from the input data. Unsupervised learning does not
need any supervision. Instead, it finds patterns from the data by its own.
Learn more Unsupervised Machine Learning
Unsupervised learning can be used for two types of problems: Clustering and Association.
Example: To understand the unsupervised learning, we will use the example given above. So unlike supervised learning,
here we will not provide any supervision to the model. We will just provide the input dataset to the model and allow the
model to find the patterns from the data. With the help of a suitable algorithm, the model will train itself and divide the
fruits into different groups according to the most similar features between them.
The main differences between Supervised and Unsupervised learning are given below:
Supervised Learning Unsupervised Learning
Supervised learning algorithms are trained using labeled data. Unsupervised learning algorithms are trained using
unlabeled data.
Supervised learning model takes direct feedback to check if it Unsupervised learning model does not take any feedback.
is predicting correct output or not.
Supervised learning model predicts the output. Unsupervised learning model finds the hidden patterns in
data.
In supervised learning, input data is provided to the model In unsupervised learning, only input data is provided to
along with the output. the model.
The goal of supervised learning is to train the model so that it The goal of unsupervised learning is to find the hidden
can predict the output when it is given new data. patterns and useful insights from the unknown dataset.
Supervised learning needs supervision to train the model. Unsupervised learning does not need any supervision to
train the model.
Supervised learning can be categorized Unsupervised Learning can be classified
in Classification and Regression problems. in Clustering and Associations problems.
Supervised learning can be used for those cases where we Unsupervised learning can be used for those cases where
know the input as well as corresponding outputs. we have only input data and no corresponding output
data.
Supervised learning model produces an accurate result. Unsupervised learning model may give less accurate
result as compared to supervised learning.
Supervised learning is not close to true Artificial intelligence Unsupervised learning is more close to the true Artificial
as in this, we first train the model for each data, and then only Intelligence as it learns similarly as a child learns daily
it can predict the correct output. routine things by his experiences.
It includes various algorithms such as Linear Regression, It includes various algorithms such as Clustering, KNN,
Logistic Regression, Support Vector Machine, Multi-class and Apriori algorithm.
Classification, Decision tree, Bayesian Logic, etc.
In other words, we can say that fuzzy logic is not logic that is fuzzy, but logic that is used to describe fuzziness. There can
be numerous other examples like this with the help of which we can understand the concept of fuzzy logic.
Fuzzy Logic was introduced in 1965 by Lofti A. Zadeh in his research paper “Fuzzy Sets”. He is considered as the father
of Fuzzy Logic.
Comparing the degrees of truth with Boolean logic vs. fuzzy logic
Fuzzy logic applications
Various types of AI systems and technologies use fuzzy logic. This includes vehicle intelligence, consumer electronics,
medicine, software, chemicals and aerospace.
• In automobiles, fuzzy logic is used for gear selection and is based on factors such as engine load, road conditions and
style of driving.
• In dishwashers, fuzzy logic is used to determine the washing strategy and power needed, which is based on factors
such as the number of dishes and the level of food residue on the dishes.
• In copy machines, fuzzy logic is used to adjust drum voltage based on factors such as humidity, picture density and
temperature.
• In aerospace, fuzzy logic is used to manage altitude control for satellites and spacecrafts based on environmental
factors.
• In medicine, fuzzy logic is used for computer-aided diagnoses, based on factors such as symptoms and medical
history.
• In chemical distillation, fuzzy logic is used to control pH and temperature variables.
• In natural language processing, fuzzy logic is used to determine semantic relations between concepts represented by
words and other linguistic variables.
• In environmental control systems, such as air conditioners and heaters, fuzzy logic determines output based on factors
such as current temperature and target temperature.
• In a business rules engine, fuzzy logic may be used to streamline decision-making according to predetermined
criteria.
Fuzzy Logic - Membership Function
We already know that fuzzy logic is not logic that is fuzzy but logic that is used to describe fuzziness. This fuzziness is
best characterized by its membership function. In other words, we can say that membership function represents the degree
of truth in fuzzy logic.