Machine Learning: Module II
Prepared by: Prof. V.P. Huggi
Department: Dept. of Civil Engineering
Institution: BLDEA CET VIJAYAPUR-586103
Introduction to Machine Learning
Machine Learning (ML) is a branch of artificial intelligence (AI) that concentrates on
creating algorithms and statistical models. These models empower computers to carry out
specific tasks without being directly programmed. Instead of following explicit instructions,
ML systems learn from data and use this knowledge to make predictions or decisions.
Learning is frequently regarded as the most crucial element of intelligence, as it allows an
agent, a computer, and a trained system to operate independently of its creator. This
independence is vital in situations where the designer lacks complete understanding of the
task environment. Consequently, learning grants the autonomy to the system, enabling it
to succeed without relying on the designer's knowledge and to move beyond the initial
assumptions built into its design.
Moreover, learning might be the sole method for developing highly complex intelligent
systems. In numerous application fields, the most effective systems are those developed
through a learning process rather than traditional programming or knowledge engineering
methods.
Definition and Scope
Machine Learning, a subset of AI, is recognized as a data analysis method that facilitates
the automatic creation of analytical models. It functions based on the concept that systems
have the capability to learn from data, identify patterns, and make decisions with minimal
human intervention. In engineering, Machine Learning is vital for improving the capacity
to analyze complex data, optimize processes, and create innovative solutions.
Machine learning is an extensive and dynamic area of research. This chapter offers a
concise overview of the fundamental principles, techniques, and findings, along with brief
references to the literature. While a few mathematical examples are included to illustrate
the analytical methods used, these can be easily skipped by readers without a technical
background. The focus is primarily on the applications within engineering domains.
The heart of the matter is that the applications in engineering domains improve efficiency,
accuracy, and predictive capabilities, driving advancements and operational excellence.
ML Applications Across Engineering Domains
A. Mechanical Engineering
Predictive Maintenance: By analysing data from machinery, ML algorithms can
forecast potential failures before they happen, helping to minimize downtime and
lower maintenance expenses.
Quality Control: Automated inspection systems use ML to detect defects in products
and ensure quality standards.
Design Optimization: ML models optimize design parameters to improve
performance and efficiency of mechanical systems.
B. Civil Engineering
Structural Health Monitoring: ML techniques assess the condition of infrastructure
(e.g., bridges, buildings) by analyzing sensor data to predict potential issues.
Construction Management: ML algorithms optimize scheduling, resource
allocation, and cost estimation for construction projects.
Urban Planning: ML helps in analyzing traffic patterns, predicting population
growth, and designing sustainable urban environments.
C. Industrial Engineering
Supply Chain Optimization: ML models predict demand, enhance inventory
management, and boost supply chain efficiency.
Production Scheduling: Algorithms optimize production schedules to enhance
throughput and reduce operational costs.
Process Improvement: ML identifies inefficiencies and suggests improvements in
manufacturing processes.
D. Electrical Engineering
Power Grid Management: ML algorithms predict energy consumption patterns and
optimize the distribution of electrical power.
Fault Detection: ML helps in identifying and diagnosing faults in electrical systems,
improving reliability and safety.
Smart Grids: ML enables the development of intelligent grid systems that adapt to
changing energy demands and integrate renewable sources.
E. Aeronautical Engineering
Flight Optimization: ML models optimize flight routes, fuel consumption, and
aircraft performance.
Predictive Maintenance: Similar to mechanical engineering, ML predicts potential
issues in aircraft components to ensure safety and reduce maintenance costs.
Flight Simulation: ML enhances flight simulation systems by predicting pilot
behaviour and optimizing training scenarios.
F. Automobile Engineering
Autonomous Vehicles: ML is fundamental in developing self-driving cars, including
object detection, path planning, and decision-making algorithms.
Vehicle Diagnostics: ML algorithms analyze data from vehicle sensors to diagnose
issues and predict maintenance needs.
Driver Assistance Systems: ML improves features like cruise control that can be
adaptive, lane-keeping assistance, and collision avoidance systems.
Significance of ML in Engineering
In essence, Machine Learning is transforming engineering domains by offering advanced
methods and tools for data analysis, optimization, and innovation. Its applications are
enhancing performance, safety, and efficiency across various engineering disciplines.
ML Process Model
Learning arises from the interaction between the environment (data) and an agent,
machine, or any system capable of learning, as well as from the agent's observation of its
own decision-making processes. It specifically involves modifying the agent's internal
structures to enhance its future performance. ML can stretch from simple memorization of
experiences to the scientific theories advancement.
Components of a Learning Agent
A learning agent comprises several conceptual components. The key distinction is between
the learning element, responsible for making improvements, and the performance
element, responsible for selecting external actions. The design of an agent's learning
element is heavily influenced by the design of its performance element.
When designing an agent to acquire a specific capability, the primary question is not the
way it learns but rather the kind of performance element the agent needs to utilize once it
has learned. For instance, the learning algorithms for generating rules for planning systems
substantially differ from those for creating neural networks.
Key Components
1. The Performance Element: Consists of a set of knowledge and procedures for
making decisions. For example, in an automated car, this would include turning,
accelerating, braking, and honking.
2. The Learning Element: Responsible for making improvements to the performance
element based on feedback and observations.
3. The Critic: Represents a fixed standard of performance (like error metrics, accuracy
metrics, convergence metrics), which it uses to provide feedback to the learning
element on the success or failure of its adjustments to the performance element. This
performance standard is essential because the data alone cannot indicate the
appropriate direction for improvement. It is crucial that the performance standard
remains fixed, otherwise the agent could simply meet its goals by adjusting the
standard to align with its current behavior.
4. The Problem Generator: This component is responsible for intentionally creating
new experiences, new data instances, or new patterns, rather than merely observing
the performance element in action. Although the resulting actions may not yield
immediate positive outcomes for the agent, they are valuable because the inferences
generated will help the agent learn useful information over the long term. This
approach mirrors the scientific method, where experiments are conducted to gain
knowledge.
Learning Process Example
Consider an automated car that must learn to drive safely before transporting passengers.
The performance element starts driving with its initial knowledge. The critic observes the
resulting bumps, detours, and skids, while the learning element sets goals to improve rules
related to braking and accelerating, to learn the geography of the area, and to understand
the effects of wet roads, among other things.
The car may then perform experiments under various conditions or continue to use
percepts to gather information and refine the missing rules. New rules and procedures can
be integrated into the performance element. Additionally, the accumulated knowledge in
the performance element can aid the learning element in better-interpreting observations.
Kinds of Machine Learning
Generally, machine learning broadly unfolds into several primary subfields: supervised
learning, unsupervised learning, semi-supervised learning, and reinforcement learning.
Supervised learning emphasizes making precise predictions, while unsupervised learning
focuses on generating concise summaries or representations of the data. In both cases, one
is interested in methods that generalize well to previously unseen data.
In this sense, one distinguishes between data objects utilized to train a model and the ones
that are used to test the performance of the trained model.
1. Supervised Learning
Supervised learning involves training a model on a labelled dataset, where each training
example is paired with an output label. The goal is for the model to learn a mapping from
inputs to the output. The dataset provided for the machine during the learning phase
consists of input-output pairs, where the input data is called features, and the output data is
the target variable or label.
The goal of the supervised learning algorithm is to learn a transformation from inputs to
outputs, enabling it to predict the target variable for new, unseen inputs.
Key Characteristics of Supervised Learning
Labeled Data: Supervised learning requires access to a dataset that has both input
variable values and target output values.
Objective: The primary goal of supervised learning is to make predictions or classify
data into predefined categories. Tasks include classification of images, sentiment
analysis, and predicting house prices.
Tasks in Supervised Learning
Two dedicated ML tasks under supervised learning include:
Classification: Labels different entities with different labels. The features could be
numerical and non-numerical (qualitative).
Regression: Predicts the future and is suitable only for numerical data.
Applications in Engineering
Supervised learning, through classification and regression, has the capability of solving a
wide range of problems across different branches of engineering. By leveraging labeled
data, engineers can develop models that have predictive capability. Such models will
enhance decision-making, optimize processes, and improve safety and reliability.
2. Unsupervised Learning
Unsupervised learning algorithm is trained on unlabeled data, i.e., data that do not come
with a target value to predict. The goal is to identify hidden patterns or intrinsic structures
in the input data. Unlike supervised learning, where the output labels guide the training
process, unsupervised learning relies solely on the input data to make inferences.
Key Characteristics of Unsupervised Learning
No Labeled Data: The algorithm works with data without labeled or target
responses. The machine has to learn itself by understanding the patterns inherent in
data.
Pattern Discovery: The primary objective is to discover the hidden patterns of the
data by eliciting similarities, non-similarities, differences, interrelations, etc.
Data Compression: This process often includes reducing the features in the data to
simplify its handling. It involves identifying the important variables and
disregarding those that are insignificant or redundant.
Types of Unsupervised Learning
Clustering: Grouping of data into different clusters.
Association Rule Learning: Identifying relationships or associations among
different entities. In a market basket study, rules are identified to associate among
items.
Dimensionality Reduction: Reducing an n-dimensional problem into 2 to 3
dimensions for visualization of data with reference to principal components or axes.
Anomaly Detection: Also referred to as outlier detection, this process in ML and
statistics is implemented to locate rare items, events, or observations that deviate
significantly from the majority of the data. These anomalies can signal important
issues, such as technical malfunctions, fraud, network breaches, or changes in
system behavior.
Applications in Engineering
Unsupervised learning is widely applicable across various engineering fields, aiding the
discovery of patterns in data, classify data, and detect anomalies without the presence of
any target output. These techniques enhance the ability to optimize processes, maintain
systems, and make informed decisions based on complex datasets.
3. Semi-Supervised Learning (SSL)
SSL is a type of ML that is a blend of supervised and unsupervised learning. It uses a small
amount of labelled data along with a large amount of unlabelled data to improve learning
accuracy.
This approach is useful when acquiring a large labelled dataset is expensive or time-
consuming, but unlabelled data is readily available.
Key Characteristics
Combination of Labelled and Unlabeled Data: Uses both labelled and unlabeled
data for training.
Improved Performance: Leveraging the patterns in the unlabeled data can lead to
better performance than labelled data alone.
Cost-Effective: Reduces the need for extensive labelling, which can be costly and
labour-intensive.
Applications in Engineering
SSL provides a potential way for improving ML models in various engineering fields by
leveraging both kinds of data. This approach is particularly valuable in situations where
data target values are scarce but data without target values are abundant, enabling more
precise and cost-effective solutions.
4. Reinforcement Learning (RL)
RL is where an agent learns to make decisions by interacting with an environment to
maximize a cumulative reward. Unlike supervised learning, which involves learning from
labeled data, RL focuses on learning from the outcomes of actions taken. It focuses on
exploring and exploiting the environment to discover the optimal policy for decision-
making.
Unlike supervised and unsupervised learning, reinforcement learning has a feedback type
of algorithm. For every result obtained, the algorithm gives feedback to the model under
training.
Dog Training Analogy
For an easier explanation, consider training a dog. You would order the dog to do certain
actions, and for every proper execution, you would give a biscuit as a reward. The dog will
remember that if it does a certain action, it would get biscuits. This way it will follow the
instructions properly next time.
Key Concepts in Reinforcement Learning
Conce
Definition
pt
The learner or decision-maker that interacts with the
Agent
environment.
Everything that the agent interacts with. It provides
Enviro
feedback in the form of rewards. A state represents the
nment
agent's current situation within the environment.
Action The set of all possible moves the agent can make.
Rewar Is a scalar feedback signal that indicates the success or
d failure of an action taken in a given state.
A strategy used by the agent to determine the next action
Policy
based on the current state.
Value
A function that estimates the expected cumulative reward of
Functi
states or state-action pairs.
on
RL in Classification Tasks
In a classification task using reinforcement learning, the environment consists of the data
samples and their features. Feedback is the correctness of the classifications, and the
reward is typically designed to reflect the accuracy and confidence of the agent's
classifications. By interacting with this environment and learning from feedback, the agent
aims to improve its classification performance over time.
Environment Components
1. Data Samples: Each data point that needs to be classified.
2. Feature Space: The collection of features or attributes related to each data sample.
3. True Labels: The correct classification labels for the data instances, that serve as
guidance and also while measuring the agent's performance.
Feedback Components
1. Correctness of the Classification: Information on whether the classification made
by the agent is correct or incorrect.
2. Updated State: The new state of the agent, which may include updates to any
internal variables or knowledge based on the classification outcome.
Reward Design
The reward signal guides the agent to improve its classification performance. It can be
designed in several ways:
Binary Reward:
Correct Classification: +1 reward
Incorrect Classification: -1 reward
Confidence-Based Reward: The reward could be proportional to the confidence of
the correct classification. Higher confidence in correct predictions yield a higher
reward, while higher confidence in incorrect predictions yield a higher penalty.
RL Algorithms
Several algorithms are dedicated to reinforcement learning, each with unique approaches
to solving the problem of sequential decision-making. These algorithms are fundamental to
reinforcement learning, each tailored to different types of environments and challenges,
ranging from simple discrete-action tasks to complex continuous-action problems.
Conclusion
Machine Learning represents a transformative approach to artificial intelligence, offering
powerful tools and techniques for solving complex problems across all engineering
disciplines. Through supervised, unsupervised, semi-supervised, and reinforcement
learning methodologies, ML enables systems to learn from data, adapt to changing
conditions, and make informed decisions with minimal human intervention.
The integration of ML into engineering practices promises to enhance efficiency, improve
safety, optimize resource utilization, and drive innovation across mechanical, civil,
electrical, aeronautical, automobile, and industrial engineering domains.
Thank you for your attention