soft computing unit- 3
soft computing unit- 3
FLOWCHART:
How It Works
1. Initialization:
• Each neuron starts with random weights that correspond to the
input features.
2. Input Presentation:
• The SOM receives input data one piece at a time.
3. Finding the Best Matching Unit (BMU):
• For each input, the neuron closest to it (the Best Matching Unit) is
identified based on distance.
4. Weight Update:
• The weights of the BMU and nearby neurons are adjusted to be
closer to the input. This adjustment is guided by a learning rate and
a neighborhood function.
5. Iterative Learning:
• Steps 2 to 4 are repeated many times with different inputs. Over
time, the SOM organizes itself, with neurons adapting to represent
different areas of the input data.
Advantages of Kohonen Self-Organizing Map (SOM)
1. Unsupervised learning capability.
2. Maintains relationships between data points.
3. Effective for data visualization.
4. Robust against noise and variations.
5. Versatile applications in various fields.
Disadvantages of Kohonen Self-Organizing Map (SOM)
1. Slow training with large datasets.
2. Sensitive to parameter choices.
3. Fixed grid size limits adaptability.
4. Prone to local minima.
5. Can be hard to interpret results.
Convolutional Neural Network (CNN)
Types of layers:
Take an example by running a Convolutional neural network on of
image of dimension 32 x 32 x 3.
Types Of RNN
There are four types of RNNs based on the number of inputs and outputs
in the network.
1. One to One
This type of RNN behaves the same as any simple Neural network it is
also known as Vanilla Neural Network. In this Neural network, there is
only one input and one output.
2. One To Many
In this type of RNN, there is one input and many outputs associated with
it. One of the most used examples of this network is Image captioning
where given an image we predict a sentence having Multiple words.
3. Many to One
In this type of network, Many inputs are fed to the network at several
states of the network generating only one output. This type of network is
used in the problems like sentimental analysis. Where we give multiple
words as input and predict only the sentiment of the sentence as output.
4.Many to Many
In this type of neural network, there are multiple inputs and multiple
outputs corresponding to a problem. One Example of this Problem will be
language translation. In language translation, we provide multiple words
from one language as input and predict multiple words from the second
language as output.
Applications of RNNs:
Disadvantages of RNNs
Fuzzy Set :
A fuzzy set is a collection where each element has a value between 0 and
1, showing how much it belongs to the set. This allows for partial
membership, handling uncertain or vague information.
Introduction to Fuzzy Sets
A fuzzy set is a mathematical concept used to represent uncertainty and partial
membership, unlike traditional sets where elements either fully belong or don’t
belong at all. Fuzzy sets allow for degrees of belonging, which makes them
useful for handling imprecise or vague data, as commonly seen in real-life
scenarios.
Fuzzy sets are foundational in fuzzy logic, which is applied in fields like
artificial intelligence, control systems, and decision-making, where binary
true/false logic is not sufficient.
Properties on sets play an important role for obtaining the solution. Following
are the different properties of classical sets −
1. Commutative Property
Having two sets A and B, this property states −
A∪B=B∪A
A∩B=B∩A
2. Associative Property
Having three sets A, B and C, this property states −
A∪(B∪C)=(A∪B)∪C
A∩(B∩C)=(A∩B)∩C
3. Distributive Property
Having three sets A, B and C, this property states −
A∪(B∩C)=(A∪B)∩(A∪C)
A∩(B∪C)=(A∩B)∪(A∩C)
4. Idempotency Property
For any set A, this property states −
A∪A=A
A∩A=A
5. Identity Property
For set A and universal set X, this property states −
A∪φ=A
A∩X=A
A∩φ=φ
A∪X=X
6. Transitive Property
Having three sets A, B and C, the property states −
If A⊆B⊆C, then A⊆C
7. Involution Property
For any set A, this property states −
8. De Morgan’s Law
It is a very important law and supports in proving tautologies and
contradiction. This law states −
Set-theoretic Operations :
Intersection
The intersection of sets A and B (denoted by A ∩ B) is the set of elements
which are in both A and B.
Hence, A ∩ B = {x|x ∈ A AND x ∈ B}.
Difference
The set difference of sets A and B (denoted by A–B) is the set of elements
which are only in A but not in B. Hence, A − B = {x|x ∈ A AND x ∉ B}.
Example − If A = {10, 11, 12, 13} and B = {13, 14, 15}, then (A − B) = {10,
11, 12} and (B − A) = {14, 15}. Here, we can see (A − B) ≠ (B − A)
Fuzzy Relations
Fuzzy relations are an extension of classical (crisp) relations that allow for
partial or graded membership rather than a strict "belong" or "not belong"
classification.
They are fundamental in fuzzy set theory and are particularly useful in
applications where vagueness or ambiguity is present.
Max-Min Composition
The Max-Min Composition is a method for combining two fuzzy
relations, often used in fuzzy set theory and fuzzy logic.
Properties;
R R ( x , z ) [ R ( x , y ) R ( y , z )]
1 2 1 2
y
Associativity:
R (S T ) ( R S ) T
Distributivity over union
R ( S T ) ( R S ) ( R T )
Week distributivity over intersection
R ( S T ) ( R S ) ( R T )
Monotonicity
S T (R S) (RT)
Applications
Fuzzy Control Systems: To determine control actions based on fuzzy
rules.
Pattern Recognition: To compute similarity between objects with fuzzy
relations.
Decision Making: In systems with multiple criteria, where relationships
between criteria may be fuzzy.
Fuzzy logic is based on the idea that not all reasoning can be described
using binary true/false (1/0) logic. Instead, fuzzy logic allows for
reasoning with degrees of truth (between 0 and 1).
Fuzzy rules and fuzzy reasoning are key components in fuzzy inference
systems (FIS), which are used to model decision-making processes that
involve uncertainty or imprecision.
1. Fuzzy Rules
Fuzzy rules are the foundation of fuzzy reasoning and are typically
written in an "IF-THEN" format. These rules capture the relationships
between variables in a system and are used to make inferences based on
fuzzy logic.
IF A IS X THEN B IS Y
Where:
A and B are the fuzzy variables.
X and Y are fuzzy sets describing possible conditions (e.g., low, medium,
high).
Fuzzy Reasoning
Fuzzy reasoning refers to the process of deriving conclusions from fuzzy rules.
It involves applying the rules to the input data (which is often fuzzy) to
determine an output (also in fuzzy form)
1. Qualitative Reasoning
For example:
Key Idea:
2. Syllogistic Reasoning
Structure of Syllogism:
Key Idea:
In syllogistic reasoning, you start with two premises and use logic to
make a definite conclusion.
3. Dispositional Reasoning
For example:
A glass has a disposition to break when dropped. The glass doesn't break
unless it's dropped, but it has the potential to break in that situation.
A student may have a disposition to study well but only shows this when
faced with exams.
Key Idea:
Summary:
Fuzzy rules and reasoning are widely used in areas where uncertainty,
imprecision, and subjectivity need to be addressed, such as:
For example:
In these rules:
Assignment Statements
These kinds of statements use “=” (equal to sign) for the purpose of assignment.
They are of the following form −
a = hello
climate = summer
Conditional Statements
These kinds of statements use the “IF-THEN” rule base form for the purpose of
condition. They are of the following form −
Unconditional Statements
GOTO 10
A Fuzzy Inference System (FIS) is a system that uses fuzzy logic to make
decisions or solve problems based on fuzzy input data. It processes imprecise
or uncertain information using fuzzy rules and produces a crisp output through
a process called defuzzification.
In simple terms, FIS takes vague or unclear input (like "temperature is high"),
applies fuzzy rules (like "IF temperature IS high THEN fan speed IS fast"), and
gives a precise output (like "fan speed = 80%").
Working of FIS:
1. Fuzzification Unit:
o The fuzzification unit takes crisp input values (like a temperature
of 30°C) and converts them into fuzzy values (e.g., "medium"
temperature).
o It uses different fuzzification methods to handle this conversion.
2. Knowledge Base:
o The knowledge base combines two things:
Rule Base: The collection of fuzzy IF-THEN rules that
define how the system responds to different inputs.
Database: The membership functions that define the fuzzy
sets (e.g., "low", "medium", "high") for the inputs and
outputs.
o After the fuzzification step, the crisp input is now in fuzzy form and
is processed using these rules and membership functions.
3. Defuzzification Unit:
o The defuzzification unit takes the fuzzy output (which could be in
terms like "low", "medium", or "high") and converts it back into a
crisp output (like a specific fan speed or temperature).
o This is done to give a precise value that can be acted upon.
Summary:
The working of FIS involves:
Converting crisp input to fuzzy input (fuzzification),
Using rules and membership functions to process the fuzzy input
(knowledge base),
And then converting the fuzzy output back to a crisp value
(defuzzification).
1. Control Systems
Temperature Control: In HVAC systems or air conditioners, fuzzy logic
is used to adjust the temperature smoothly by considering vague inputs like
"warm," "hot," or "cold" and controlling the fan or heating elements based
on fuzzy rules.
Washing Machines: Fuzzy logic helps in deciding the washing cycle
duration, water temperature, and spin speed based on the load size and
fabric type, using fuzzy sets like "light," "medium," or "heavy."
Automatic Transmission Systems: In vehicles, fuzzy logic is used to
control gear shifts, ensuring smoother transitions by interpreting inputs like
"engine speed" and "vehicle load" in fuzzy terms.
2. Robotics
Robot Navigation: Robots use fuzzy logic to navigate in an uncertain
environment, interpreting vague sensor data like "close" or "far" to avoid
obstacles and make decisions on movement.
Motion Control: Fuzzy logic is used in controlling robotic arms, adjusting
the speed, force, and position of joints based on fuzzy inputs to perform
delicate tasks like assembly or surgery.
3. Image Processing
Edge Detection: Fuzzy logic helps in edge detection by applying fuzzy
rules to determine the boundaries between different regions in an image,
handling the imprecision in pixel intensity values.
Image Enhancement: It is used to enhance images by adjusting
brightness, contrast, and sharpness based on vague or unclear pixel data,
improving the quality of images in applications like medical imaging.
4. Signal Processing
Noise Reduction: Fuzzy logic can be used in filtering noise from signals
(such as audio or video) by interpreting the noise level as a fuzzy variable,
helping in clearer communication or data transmission.
Speech Recognition: It helps in dealing with varying voice patterns and
background noise, converting speech into text by handling uncertainties in
pronunciation and ambient sounds.
5. Power Systems
Load Forecasting: Fuzzy logic is used to predict electricity consumption
in power systems by considering uncertain factors like weather, time of
day, or user behavior.
Fault Detection: It helps in detecting faults in electrical circuits or systems
by analyzing vague sensor data and identifying anomalies in power supply,
ensuring early detection and maintenance.
7. Civil Engineering
Structural Health Monitoring: Fuzzy logic is applied to assess the
condition of structures such as bridges or buildings, interpreting vague data
from sensors that measure factors like stress, strain, and vibrations.
Traffic Control Systems: It is used in controlling traffic lights by
analyzing traffic flow in real-time and making decisions based on fuzzy
inputs like "heavy traffic," "moderate traffic," and "light traffic."
8. Environmental Engineering
Water Quality Monitoring: Fuzzy logic can be used to monitor and
control water quality in treatment plants by analyzing fuzzy input data such
as turbidity, pH levels, and chemical composition.
Air Pollution Control: It helps in managing air quality by processing
uncertain data about pollutants and taking actions to reduce pollution levels
in urban environments.
9. Consumer Electronics
Air Conditioners and Refrigerators: Fuzzy logic is applied to
automatically adjust the internal temperature and humidity based on user
preferences, environmental conditions, and fuzzy inputs like "too warm"
or "too cold."
Smart Home Devices: Fuzzy logic helps smart home systems adapt to
environmental conditions, adjusting lighting, heating, or cooling
automatically based on fuzzy inputs such as "dimming" or "brightening"
of lights.