CC 65 FD 71699019121330
CC 65 FD 71699019121330
Applying Machine
Learning and AI in
Environmental Monitoring
Chapters for Discussion
• 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
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).
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
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
Source : www.freepik.com/
Understanding supervised and unsupervised 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
Source : www.freepik.com/
Understanding supervised and unsupervised 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
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:
y= a0+a1x+ ε
Here,
ε = random error
The values for x and y variables are training datasets for Linear
Regression model representation.
Source www.freepik.com/
:
Linear Regression:
• 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:
• Fitting line help us to predict the target value, Y, using the independent variable 'Engine Size'
represented on X axis
• 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.
Model Error
• Its Co2 should be predicted very close to the actual value, which
is y=250, based on historical data.
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:
• 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.
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
Hands On
Lab 1
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.
Source : www.freepik.com/
Conclusion
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?
Answer: B
To predict a continuous outcome variable based on one or more predictor variables
Quiz
Answer: C
To find the best-fitting line that minimizes the difference between predicted and observed
values
Quiz
Answer: D
Minimizing intra-cluster distances
Thank You