0% found this document useful (0 votes)
11 views64 pages

CC 65 FD 71699019121330

The document discusses the application of Machine Learning (ML) and Artificial Intelligence (AI) in environmental monitoring, focusing on key concepts, terminology, and algorithms. It covers supervised and unsupervised learning, ML processes, and specific applications in renewable energy and waste management. The goal is to optimize renewable energy systems and enhance green technologies through AI and ML.

Uploaded by

devakis935
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views64 pages

CC 65 FD 71699019121330

The document discusses the application of Machine Learning (ML) and Artificial Intelligence (AI) in environmental monitoring, focusing on key concepts, terminology, and algorithms. It covers supervised and unsupervised learning, ML processes, and specific applications in renewable energy and waste management. The goal is to optimize renewable energy systems and enhance green technologies through AI and ML.

Uploaded by

devakis935
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Unit - VI

Applying Machine
Learning and AI in
Environmental Monitoring
Chapters for Discussion

Chapter - 1 Artificial Intelligence - Machine Learning Fundamentals

Chapter - 2 AI in Renewable Energy


DISCLAIMER
The content is curated from online/offline resources and
used for educational purpose only.
Learning Objectives

• Understand key AI concepts and terminology. Learn the basics of Machine Learning (ML)
and its applications. Recognize the relevance of AI and ML to green technologies.
• Grasp the concepts of supervised and unsupervised learning. Learn basic ML algorithms:
Linear regression, K-Means clustering. Implement ML models using environmental
datasets.
• Explore AI applications in waste management: Sorting, recycling, waste reduction. Utilize
AI for climate action and mitigating climate change impacts.
GOAL
• Learn applications of AI in optimizing renewable energy systems.

Source : www.freepik.com/
Chapter Fundamentals of
1 Artificial Intelligence
and Machine Learning
Basics of Artificial Intelligence

• Artificial Intelligence (AI) is a broad field that encompasses


various concepts, techniques, and applications aimed at creating
machines that can perform tasks that typically require human
intelligence.

• Here is an overview of key AI concepts and terminology

Learning
Machine Learning (ML): A subset of AI that enables machines to
learn from data and improve their performance over time without
being explicitly programmed.

Source : www.freepik.com/
Basics of Artificial Intelligence
Reasoning
Deductive Reasoning: Deriving conclusions from general rules.
Inductive Reasoning: Inferring general principles from specific examples.
Abductive Reasoning: Formulating the most likely explanation based on available evidence.

Problem Solving
Techniques like search algorithms, optimization methods, and heuristics are used to solve complex
problems.

Source : www.freepik.com/
Basics of Artificial Intelligence
Reasoning -Deductive Reasoning: Deriving conclusions from general rules.
Inductive Reasoning: Inferring general principles from specific examples.
Abductive Reasoning: Formulating the most likely explanation based on available evidence.

Problem Solving –
Techniques like search algorithms, optimization methods, and heuristics are used to solve complex
problems.

Perception - Involves interpreting data from the world, such as visual images, sounds, and other sensory
Inputs. Technologies include computer vision and speech recognition.

Source : www.freepik.com/
Basics of Artificial Intelligence
Natural Language Processing (NLP)
The ability of a machine to understand and generate human language. Applications include language
translation, sentiment analysis, and conversational agents (chatbots).

Motion and Manipulation


Robotics involves the integration of AI with mechanical systems to perform tasks like navigation, object
manipulation, and interaction with the environment.

Source : www.freepik.com/
Key Techniques and Technologies

 Neural Networks
Computing systems inspired by the human brain's network of neurons, essential for many AI applications, particularly in deep
learning.

 Deep Learning
A subset of ML using neural networks with many layers to model complex patterns in data. It's especially powerful in image and
speech recognition tasks.
 Natural Language Processing (NLP)
Techniques for understanding and generating human language, enabling applications like chatbots, translators, and voice-activated
assistants.

 Computer Vision
Techniques for interpreting visual data from the world, used in facial recognition, autonomous driving, and medical imaging.

Source : www.freepik.com/
Machine Learning: Definition

Machine learning (ML) is a subfield of artificial intelligence (AI) that focuses on developing algorithms and
statistical models that enable computers to perform specific tasks without explicit instructions. Instead, ML
systems learn from data, identifying patterns, making decisions, and improving their performance over time
based on the data they are exposed to.

Machine learning is a subfield of artificial intelligence (AI). AI is broadly defined as the capability of a
machine to imitate intelligent human behavior, performing complex tasks in a manner similar to human
problem-solving. ML provides the tools and techniques that enable AI systems to learn and adapt,
enhancing their ability to solve complex problems autonomously.

Source : www.freepik.com/
Machine Learning: Definition

Source : www.freepik.com/
Machine Learning: Definition

Input Past Data: In machine learning, we use data from the past to train our models.
This data is used to help the model learn patterns and relationships that can be used
to make predictions on new, unseen data

Machine learning: Machine learning is a type of artificial intelligence that involves


training models to make predictions or decisions based on data.

Algorithm An algorithm is a set of rules or instructions that a machine learning model


follows to make predictions or decisions.

Source : www.freepik.com/
Machine Learning: Definition

Model: A model is a mathematical representation of a system or process that can be used to make
predictions or decisions based on data.

Learn From Data: Machine learning models learn from data by identifying patterns and relationships
within the data.

New Data: Once a machine learning model has been trained on past data, it can be used to make
predictions or decisions on new, unseen data.

Source : www.freepik.com/
Terminology of Machine Learning

1. Algorithm: A set of rules or instructions given to an ML model to help it learn from data
and make predictions or decisions.
2. Model: A mathematical representation created by an algorithm that is used to make
predictions or decisions based on input data.
3. Training Data: The dataset used to train the model. It includes input-output pairs where
the output is known.
4. Test Data: A separate dataset used to evaluate the performance of the trained model. The
model's predictions are compared against the actual outcomes.
5. Validation Data: A subset of the training data used to tune the model’s parameters and
avoid overfitting.
Source : www.freepik.com/
Machine Learning Process

1. Data Collection - Gather the raw data needed for the machine learning model. he quality and
quantity of data collected will directly impact the performance of the model. Data can be collected
from various sources such as databases, web scraping, sensors, surveys, and logs. Ensure the data
is relevant, representative, and sufficient for the problem at hand.
2. Data Preparation- Clean, format, and engineer the data into an optimal format for modelling.
Handle missing values, remove duplicates, and correct errors, Normalize or standardize the data to
ensure consistency. Create new features from raw data that might improve model performance.
Reduce the number of features using techniques like Principal Component Analysis (PCA) to
eliminate irrelevant or redundant data. Proper data preparation enhances the model's ability to learn
and generalize from the data.

Source : www.freepik.com/
Machine Learning Process

3. Training (Fitting)- Train the machine learning algorithm using the prepared data. Split the data into
training and validation sets Feed the training data into the algorithm. The algorithm learns by
adjusting its parameters to minimize errors in predictions. A trained model that has learned the
patterns in the training data. Ensure the training process avoids overfitting by using techniques such
as cross-validation.
4. Evaluation - Assess the performance of the trained model on unseen data. Use the test data (or
validation set) to evaluate the model. Metrics to evaluate include accuracy, precision, recall, F1
score, and confusion matrix for classification tasks; mean absolute error, mean squared error, and R²
for regression tasks. Provides an indication of how well the model will perform in real-world scenarios

Source : www.freepik.com/
Machine Learning Process

5. Tuning (Hyperparameter Tuning) - Fine-tune the model to maximize its performance. Adjust
hyperparameters (parameters set before training) such as learning rate, number of layers in a neural
network, or number of trees in a random forest. Techniques include grid search, random search,
and Bayesian optimization. Optimizing hyperparameters can significantly improve model
performance and generalization.

Source : www.freepik.com/
Applications of Machine Learning

Source : www.freepik.com/
Relevance of AI and machine learning to green technologies.

 Smart Grids: AI optimizes the distribution and usage of electricity in smart grids. It predicts energy
demand, integrates renewable energy sources, and minimizes losses.
 Demand Response: ML algorithms forecast energy demand, allowing utilities to balance supply and
demand dynamically, reducing the need for additional power plants.
 Solar and Wind Energy Forecasting: AI predicts weather patterns and sunlight availability,
optimizing the performance and integration of solar panels and wind turbines.
 Crop Monitoring: Drones and satellite imagery combined with ML algorithms monitor crop health,
detect diseases, and improve yield predictions.
 Precision Agriculture: AI analyzes data from various sensors to optimize irrigation, fertilization, and
pesticide use, leading to more sustainable farming practices.

Source : www.freepik.com/
Understanding supervised and unsupervised learning

Supervised Machine Learning Unsupervised Machine Learning

Source : www.freepik.com/
Understanding supervised and unsupervised learning

Supervised Machine Learning

Supervised learning involves training machines using labeled training data, where each example
is paired with a corresponding correct output.
Labelled data means that input data is tagged or annotated with the correct output, providing the
algorithm with examples to learn from.
The training data serves as a supervisor, teaching the machine learning model to predict the
output correctly by identifying patterns and relationships between input and output variables.

Source : www.freepik.com/
Understanding supervised and unsupervised learning

Supervised Machine Learning


Supervised learning can be further divided into two types of problems:

Source : www.freepik.com/
Understanding supervised and unsupervised learning

Unsupervised Machine Learning

Unsupervised learning is a machine learning technique where models are not supervised using a labeled
training dataset. Instead, the models autonomously discover hidden patterns and insights from the given
data.
Unlike supervised learning, unsupervised learning does not have corresponding output data for the input
data.
The goal of unsupervised learning is to uncover the underlying structure of the dataset, group similar data
points together, and represent the dataset in a compressed format.
A

Source : www.freepik.com/
Understanding supervised and unsupervised learning

Unsupervised Machine Learning

The unsupervised learning algorithm can be further categorized into two types of problems:

Source : www.freepik.com/
ML algorithms:

Linear Regression:

Linear regression is one of the simplest and most widely used machine learning algorithms.

It is a statistical method employed for predictive analysis, making it valuable for forecasting and
understanding relationships between variables.

Linear regression is particularly useful for predicting continuous, real, or numeric variables such as
sales, salary, age, or product prices.

Source : www.freepik.com/
ML algorithms:

Linear Regression:

Linear regression is one of the simplest and most widely used machine learning algorithms.

It is a statistical method employed for predictive analysis, making it valuable for forecasting and understanding
relationships between variables.

Linear regression is particularly useful for predicting continuous, real, or numeric variables such as sales,
salary, age, or product prices.

Linear regression is aptly named because it captures the linear relationship between a dependent variable (y) and one or
more independent variables (x).

Source www.freepik.com/
:
ML algorithms:

Mathematically, we can represent a linear regression as:


Linear Regression:

y= a0+a1x+ ε

Here,

y= Dependent Variable (Target Variable)

x= Independent Variable (predictor Variable)

a0= intercept of the line (Gives an additional degree of freedom)

a1 = Linear regression coefficient (scale factor to each input value).

ε = random error

The values for x and y variables are training datasets for Linear
Regression model representation.
Source www.freepik.com/
:
Linear Regression:

Types of Linear Regression Model

1. Simple Linear Regression: Models the relationship between a


single independent variable (IV) and a dependent variable (DV).

It can be linear or non-linear.

2. Multiple Linear Regression:Models the relationship between two


or more independent variables and a dependent variable.

Linearity of regression depends on the relation between

dependent and independent variables; it can be either linear or

non-linear regression. Reference


Linear Regression:

Regression Application Areas

• Essentially, we use regression when we want to estimate a continuous value.

• You can try to predict a salesperson's total yearly sales (sales forecast) from independent
variables such as age, education, and years of experience.

• We can use regression analysis to predict the price of a house in an area, based on its size, number
of bedrooms, and so on.

• We can even use it to predict employment income for independent variables, such as hours of work,
education, occupation, sex, age, years of experience, and so on.
Linear Regression:

Regression Modeling - Fitting Line

• Fitting line help us to predict the target value, Y, using the independent variable 'Engine Size'
represented on X axis

• The fit line is shown traditionally as a polynomial.

• In Simple regression Problem (single x), the form of the model would be

𝑦 = 𝜃1 + 𝜃2 𝑥1
𝜃1 = intercept 𝜃2 = slope of the line

• Where Y is the dependent variable, or the predicted value and X is the independent variable.

• 𝜃1 and 𝜃2 are coefficient of linear equation


Linear Regression:

Model Error

• If we have, for instance, a car with engine size x1 =5.4, and


actual Co2=250,

• Its Co2 should be predicted very close to the actual value, which
is y=250, based on historical data.

• But, if we use the fit line it will return


ŷ =340.
Error = ŷ – y = 340-250 = 90
• Compare the actual value with we predicted using our
model, you will find out that we have a 90-unit error.
Reference
• Prediction line is not accurate. This error is also called the
residual error.
Linear Regression:

Mean Absolute Error

In this, the residual for every data point, taking only the absolute value
of each so that negative and positive residuals do not cancel out. Then
take the average of all these residuals.
Linear Regression:

Mean Squared Error

• The mean square error (MSE) is just like the MAE.

• But squares the difference before summing them all instead of using the absolute value. We can see
this difference in the equation below.
Linear Regression:

R2 Score

• Statistical measure that represents the proportion of the variance for a dependent variable that's
explained by an independent variable or variables in a regression model.

• If the R2 of a model is 0.50, then approximately half of the observed variation can be explained by the
model's inputs.

• Formula for R-Squared


K-Means Clustering

Intra-cluster
Inter-
cluster
• Conventionally, in K-means, the distance of samples
from each other is used to shape the clusters.
• So, we can say, k-Means tries to minimize the “intra-
cluster” distances and maximize the “inter-cluster”
distances with help of “dissimilarity matrix”

Click here

Reference link
Calculating dissimilarity or distance between two cases
• Most clustering approaches uses distance measures to assess the similarities or differences between a
pair of objects.
• The most popular distance measures are : Euclidean distance, Cosine similarity, Minkowski distance,
Manhattan distance etc.
• Assume that we have two customers viz. customer 1 and customer 2, which have only one feature “Age”.
• Customer1: Age = 54 and Customer2: Age = 50
• Euclidean distance can be used to measure distance between two customers

• Similarly for other features, in case of multi-dimensional vectors


Dissimilarity Measures
• We must normalize our feature set to get the accurate “dissimilarity measure”.
• For example, you may use Euclidean distance, cosine similarity, average distance, and so on.
• “Similarity measure” highly controls how the clusters are formed, so it is recommended to understand the
domain knowledge of your dataset, and data type of features, and then choose the meaningful distance
measurement.
Scatter Plot
• To keep things simple, let’s assume that our
dataset has only two features, the age and
income of customers.
• This means, it’s a 2-dimentional space.
• We can show the distribution of customers
using a scatterplot.
Clustering
• We try to cluster the customer dataset into distinct
groups (or clusters) based on these two
dimensions.
• In the first step, we should determine the number
of clusters.

Custome Age Income


r_id
1 3 4.4
2 2.3 4.5
3 2 5
Clusters Initiation
• The key concept of the k-Means algorithm is that it
randomly picks a centre point for each cluster.
• It means, we must initialize k, which represents
"number of clusters."
• Essentially, determining the number of clusters in a
data set, or k, is a hard problem so we randomly
take k=3 for our dataset.
• These 3 data points are called “centroids of
clusters”, and should be of same feature size of our
customer feature set.
Assign data points to Clusters
• Next step is to assign each customer to the closest centre so that we can find the closest centroid to
each data point.
Distance Matrix
• Therefore, you will form a matrix where each row
represents the distance of a customer from each
centroid, called the "distance-matrix.“
• The main objective of k-Means clustering is to
minimize the distance of data points from the
centroid of its cluster and maximize the distance
from other cluster centroids.
Assign all data points
• We can use the distance-matrix to find the
nearest centroid to data points.
• After finding the closest centroids for each
data point, we assign each data point to that
cluster.
Cluster Shapes
• To reduce this error, we should shape clusters in
such a way that the total distance of all members of
a cluster from its centroid be minimized.
• Take average of data points in each cluster
• Shift the cluster centre to new location
Handle New Centroids
• Now we have new centroids.
• We will have to calculate the distance of all points
from the new centroids.
• The points are re-clustered and the centroids move
again.
• This continues until the centroids no longer move.
• Please note that whenever a centroid moves, each
point’s distance to the centroid needs to be
measured again.
Iterative Process
• k-Means is an iterative algorithm, and we have to
repeat steps 2 to 4 until the algorithm converges.
• It results in the clusters with minimum error, or the
most dense clusters.
• However, as it is a heuristic algorithm, there is no
guarantee that it will converge to the global
optimum, and the result may depend on the initial
clusters.
• It means this algorithm is guaranteed to converge to
a result, but the result may be a local optimum (i.e.
not necessarily the best possible outcome).
K-Mean Clustering Algorithm: Summary
The working of the K-Means clustering in machine learning is explained in the below steps:
Step 1: First, decide the number of clusters, i.e., K.
Step 2: Select random K points or centroids. The centroids may not be from the input dataset.
Step 3: Assign each data point to its closest centroid. It will form the predefined K clusters.
Step 4: Calculate a new centroid of each cluster, taking an average of samples belonging to the same
cluster.
Step-5: Repeat step 3, which means reassigning each datapoint to the new closest centroid of each
cluster.
Step-6: If no new reassignment occurs, then the model is ready. Else, go to step 4
Determining ‘K’ in K-Means
• Determining the number of clusters in a data set, or
k, as in the k-Means algorithm, is a frequent
problem in data clustering.
• The correct choice of k is often ambiguous, because
it’s very dependent on the shape and scale of the
distribution of points in a data set.
• There are some approaches to address this
problem, but one of the techniques that is commonly
used, is to run the clustering across the different
values of K, and looking at a metric of accuracy for
clustering.
Elbow method
• The Elbow Method uses the idea of Within Cluster Sum of Squares (WCSS).
• Within the sum of squares (WSS) is defined as the sum of the squared distance between each
member of the cluster and its centroid.
• WSS indicate how dense our clusters are, or to what extend we minimized the error of clustering.
• Then looking at the change of this metric, we can find the best value for k.
• But the problem is that with increasing the number of clusters, the distance of centroids to data points
will always reduce.
Elbow Point

Elbow point; k=3


Lab Activity

Hands On
Lab 1

• Implementation and Deployment of Machine Learning


Chapter AI in Renewable
2 Energy
Overview of renewable energy sources:

Solar Energy
• Photovoltaic (PV) Systems: Convert sunlight into electricity using semiconductor materials like silicon.
• Solar Thermal Systems: Capture solar radiation to generate heat for heating or electricity production
through steam turbines.
Bioenergy
• Biomass: Organic materials (e.g., wood, agricultural residues) burned for heat or converted into biogas or
biofuels.
• Biofuels: Ethanol and biodiesel derived from crops (e.g., corn, sugarcane) or algae.

Source : www.freepik.com/
Overview of renewable energy sources:

Wind Energy
• Wind Turbines: Convert wind kinetic energy into mechanical energy, then electricity via generators.
• Wind Farms: Onshore and offshore farms harness wind energy, with offshore farms often having higher
and steadier wind speeds.
Hydroelectric Power
• Hydropower Plants: Generate electricity using the gravitational force of falling or flowing water.
• Types include conventional hydroelectric dams, run-of-river systems, and pumped storage facilities.

Source : www.freepik.com/
Applications of AI in optimizing renewable energy systems.
Predictive Maintenance
• Wind Turbines and Solar Panels:
AI analyzes sensor data, weather forecasts, and historical performance to predict failures and maintenance needs.
Reduces downtime and maintenance costs.
Optimizes lifespan and efficiency of renewable energy infrastructure.
Energy Forecasting
• Solar and Wind Power:
AI models use historical data, satellite imagery, and weather forecasts to predict renewable energy generation accurately.
Improves grid stability and reliability.
Enhances integration of renewables, reducing reliance on fossil fuels.

Source : www.freepik.com/
Applications of AI in optimizing renewable energy systems.
Demand Response and Energy Management
• Smart Grids:
AI optimizes renewable energy distribution based on real-time demand, pricing, and weather conditions.
Balances supply and demand, reducing energy waste and operational costs.
Supports grid stability and resilience during peak demand.

Energy Storage Optimization


• Battery Storage Systems:
AI controls optimize charging and discharging based on electricity prices, renewable energy availability, and grid demand.
Maximizes use of renewable energy by storing excess for later use.
Enhances grid stability with fast-response energy reserves.

Source : www.freepik.com/
Conclusion

• Overview of AI concepts and terminology. Introduction to Machine Learning and its


applications. Relevance of AI and machine learning to green technologies.
• Understanding supervised and unsupervised learning. Basic ML algorithms: Linear
regression,, K-Means clustering. Hands-On: Implementing ML models with environmental
datasets.
• Overview of renewable energy sources: Solar, wind, hydro, and bioenergy. Applications of AI
in optimizing renewable energy systems.

Source : www.freepik.com/
References

• https://www.coursera.org/learn/machine-learning
• https://en.wikipedia.org/wiki/Unsupervised_learning
• https://scikit-learn.org/stable/unsupervised_learning.html
• http://cs229.stanford.edu/notes2020spring/cs229-notes8.pdf
• https://developers.google.com/machine-learning/clustering
• https://archive.ics.uci.edu/ml/index.php\
• https://towardsdatascience.com/tagged/unsupervised-learning
• k- Means Clustering. Don’t get confused with KNN. | by Siddhraj Maramwar | Analytics Vidhya |
Medium
Let’s Start
Quiz
1. What is the primary objective of linear regression
analysis?

a) To classify data points into different categories


b) To predict a continuous outcome variable based on one
or more predictor variables
c) To find the median value of a dataset

d) To calculate the mode of a dataset

Answer: B
To predict a continuous outcome variable based on one or more predictor variables
Quiz

2. What is the goal of minimizing the sum of squared


errors (SSE) in linear regression?

a) To maximize the R-squared value


b) To minimize multicollinearity among predictor variables
c) To find the best-fitting line that minimizes the difference
between predicted and observed values
d) To maximize the p-value of the regression coefficients

Answer: C
To find the best-fitting line that minimizes the difference between predicted and observed
values
Quiz

1. What is the primary goal of k-means clustering?

a) Maximizing intra-cluster distances


b) Minimizing inter-cluster distances
c) Maximizing inter-cluster distances
d) Minimizing intra-cluster distances

Answer: D
Minimizing intra-cluster distances
Thank You

You might also like