SlideShare una empresa de Scribd logo
1 de 34
ROBERT VAN STRAALEN
AI FOR WASTE WATER TREATMENT.
Machine learning for real-time control
Robert van Straalen
• Robert van Straalen
• Lead data scientist @ Data Science Lab
• Data scientist @ ING
• Database marketing, BI, Software development
• MSc. Artificial Intelligence @ Utrecht University
ABOUT ME.
• Waste water treatment
• Drinking water treatment
• Dikes, sewer systems, etc.
• Innovation culture
INDUSTRIAL AI.
AI USE CASES WITHIN THE
ENTERPRISE.
Source:CloudPulseStrategies
WHY INDUSTRIAL AI IS HARD.
WWTP AMSTERDAM WEST.
• Largest WWTP in the
region
• Built in 2005
• Handles 63M m3/year
• ± 1 million people
• 7 water treatment lanes
• Sludge processing lane
• Programme to explore
how AI can help with
optimization
• Primary treatment: Sedation
• Separate solids from fluids
• Secondary treatment: Aeration
• Add microbacteria
• Add oxygen to feed them
• Microbacteria convert NH4 & O2
to NO3 & H2O
• Tertiary treatment:
• Sedation again
• Sludge processing
• Clean water, bio gas, struvite
crystals
HOW DOES A WWTP WORK?
THE AERATION PROCESS.
Pressure 1
Flow 1
Flow 3
Valves 3.1, 3.2, 3.3
Blowers 1 - 6
Valves 7.1, 7.2, 7.3
Flow 7
Pressure 2
Pressure 1
Flow 1
Flow 3
Valves 3.1, 3.2, 3.3
Blowers 1 - 6
Valves 7.1, 7.2, 7.3
Flow 7
Pressure 2
• Part 1: Basics
• Determine continuously (i.e. every minute):
• How much air flows through each lane?
• How much energy is consumed by each lane
• Part 2: Optimization
• Determine a control strategy that continously (i.e. every minute):
• Controls the aeration process
• Blower settings
• Valve settings
• such that
• The right amount of air is pumped through each tank
• With minimal energy consumption
PROBLEM DEFINITION.
• Goal: determine air flow & energy consumption for each lane
• Approach:
1. Determine air flow per lane
1. Gebruik data van flowmeter voor AT 5 (betrouwbaar)
2. Bouw model op deze data
3. Gebruik model om flow voor overige AT’s te voorspellen
2. Determine total energy consumption 6 blowers
1. Compute from kW measurements
3. Energy consumption lane = (air flow lane / air flow total) *
energy consumption total
APPROACH.
• Azure Data Science Virtual Machine with GPU
• Azure DevOps / Pipelines
• Github
• Anaconda (Python)
• PyCharm
• Tensorflow + Tensorboard
• OpenAI Gym
• Flask
• Docker
TOOLING.
• Input scaling
• Pressure only dependent on
blowers & valves:
• ➤ no bias
• ➤ non-negative constraints
• Output layers:
• Linear activation
• Use bias initializer with
average output value
• Tune loss_weights for right
balance
• Adam optimizer; learning rate
0.0003
NEURAL NETWORK.
MODEL PERFORMANCE.
• Pressure:
Mean absolute error 0.37
(on a range of ± 0-90)
• Air flow:
Mean absolute error 177
(on a range of ± 0-11.000)
• Energy consumption:
Mean absolute error 3.1
(on a range of 0-400)
• predict.py
• Python module to get model predictions
• api.py
• Flask script for API definition
• Dockerfile:
• Python + packages
• Start Gunicorn web server
• azure-pipelines.yml
• Build & Test pipeline
DEPLOYMENT.
• So we predicted air flow / energy consumption...
• That’s nice and all
• But we haven’t optimized anything yet!
That was just the first part!
• Observe the environment
• Choose an action
• Execute the action in the environment
• Observe reward and
changes in the environment
• Evaluate the choice of your action
• Repeat
REINFORCEMENT LEARNING.
1. Observe required airflow
• Derived from water influent + oxygen/ammonium measurements
2. Choose new settings for blowers & valves
• This is done by the agent
3. Observe resulting air flow & energy consumption
• This is done using the modelfrom the 1st part
4. Evaluate the result
• Penalize deviations wrt required airflow
• Penalize energy consumption
5. Adapt the agent’s model based on the evalution
6. Back to 1.
APPROACH.
• Deep Deterministic Policy Gradient
• Similar to Deep Q-learning, but for
continuous action spaces
• Two models, trained itreratively:
• Actor controls the settings (chooses actions)
• Critic evaluates the result
• Model from part 1 is a simulation of the
environment
• Tricks like experience replay, target
networks, warmup, random process
exploration
DDPG ALGORITHM.
• Environment in OpenAI’s gym format
• Define possible actions
• Define what the states look like
• Define a function that, given a state and an action, returns a reward
• This uses the model from part 1.
• DDPG from Keras-RL library
• Relatively clear design; DDPG implemented
• States: Pressure, Air flow, Blowers, Valves
• Actions: Blowers, Valves
• Reward: required vs. achieved airflow + energy consumption
IMPLEMENTATION.
• Actor: State ➤ Action
• Input = State (Pressure, Air flow, Blowers, Valves)
• Scaling
• 2 dense layers with ReLU activation
• Output with tanh activation ➤ Blowers + Valves
• Critic: State + Action ➤ Reward
• Input = State + Action
• Scaling
• 2 dense layers with ReLU activation
• Output with linear activation ➤ Reward
N.B. Actor netwerk is pre-trained on current control strategy
ACTOR & CRITIC.
MONITORING TOOL.
• Impediment:
• Direct control of blowers &
valves not possible for the next
two years or so
• Scope:
• Don’t focus on energy
consumption
• Focus on nitrogen emissions
(N2O, NO3, NH4)
SURPRISE!
• A new environment model that
• given a ‘state’ (measurements)
• given proposed action (control settings)
• predicts the next state (measurements)
• An influent forecast model that
• given date/time & previous measurements
• predicts the expected influent
• A control strategy model that
• given a ‘state’
• given an influent forecast
• predicts the best action (control settings)
FOLLOW-UP.
+ ➤
➤
➤
+
INFLUENT FORECAST MODEL.
• Who has the domain knowledge?
• Which data is reliable?
• Data augmentation for better generalization
• Andrej Karpathy’s Recipe for training neural networks:
• Tensorboard: write_images makes logs explode, but it helps in validating the
weights
• Tuning a neural net based on the loss curve is one thing, but tuning a
reinforcement learning agent on a reward curve...
• Reinforcement learning is still in its infancy
• Translate continuous actions to discrete actions
LEARNINGS.
AI for Waste Water Treatment: machine learning for real-time control

Más contenido relacionado

La actualidad más candente

Sludge handling and disposal
Sludge handling and disposalSludge handling and disposal
Sludge handling and disposalRakesh Rahar
 
Biological phosphorus removal for waste water treatment
Biological phosphorus removal for waste water treatmentBiological phosphorus removal for waste water treatment
Biological phosphorus removal for waste water treatmentAnjaliBabu12
 
Membrane bio-reactor (2).pptx
Membrane bio-reactor (2).pptxMembrane bio-reactor (2).pptx
Membrane bio-reactor (2).pptxsawanbhat1
 
Floods in Telangana Climate Change and Disasters July 2022.pptx
Floods in Telangana Climate Change and Disasters July 2022.pptxFloods in Telangana Climate Change and Disasters July 2022.pptx
Floods in Telangana Climate Change and Disasters July 2022.pptxSai Bhaskar Reddy Nakka
 
Air monitoring presentation
Air monitoring presentationAir monitoring presentation
Air monitoring presentationNimonik
 
ENVIRONMENTAL IMPACT OF EMISSION OF POWER PLANTS
ENVIRONMENTAL                   IMPACT OF EMISSION OF POWER PLANTSENVIRONMENTAL                   IMPACT OF EMISSION OF POWER PLANTS
ENVIRONMENTAL IMPACT OF EMISSION OF POWER PLANTSMr. Mrunal Raut
 
R e a c t o r s & its kinetics
R e a c t o r s & its kineticsR e a c t o r s & its kinetics
R e a c t o r s & its kineticsArvind Kumar
 
Biological wastewater treatment processes
Biological wastewater treatment processesBiological wastewater treatment processes
Biological wastewater treatment processesArvind Kumar
 
Environment modelling
Environment modellingEnvironment modelling
Environment modellingMansi Rastogi
 
Anaerobic treatment and biogas (short)
Anaerobic treatment and biogas (short)Anaerobic treatment and biogas (short)
Anaerobic treatment and biogas (short)Humayun Basha
 
Industrial waste water treatment
Industrial waste water treatmentIndustrial waste water treatment
Industrial waste water treatmentNatthu Shrirame
 
Wastewater treatment by vermi filtration technology
Wastewater treatment by vermi filtration technologyWastewater treatment by vermi filtration technology
Wastewater treatment by vermi filtration technologyvivatechijri
 
Advanced wastewater treatment
Advanced wastewater treatmentAdvanced wastewater treatment
Advanced wastewater treatmentNikka Lopez
 
Measurement of ambient air pollutants, sampling and analysis
Measurement of ambient air pollutants, sampling and analysisMeasurement of ambient air pollutants, sampling and analysis
Measurement of ambient air pollutants, sampling and analysisAbhishek Tiwari
 
Sludge Treatment
Sludge TreatmentSludge Treatment
Sludge TreatmentNiaz Memon
 
bioethanol ppt
bioethanol pptbioethanol ppt
bioethanol pptSunny Alha
 
New technology for desalination
New technology for desalinationNew technology for desalination
New technology for desalinationDainik Patel
 
Wastewater management in pulp and paper industry
Wastewater management in  pulp and paper industryWastewater management in  pulp and paper industry
Wastewater management in pulp and paper industryDaulat Ram Meena
 
Zero liquid discharge
Zero liquid dischargeZero liquid discharge
Zero liquid dischargeTulsi Makwana
 

La actualidad más candente (20)

Sludge handling and disposal
Sludge handling and disposalSludge handling and disposal
Sludge handling and disposal
 
Biological phosphorus removal for waste water treatment
Biological phosphorus removal for waste water treatmentBiological phosphorus removal for waste water treatment
Biological phosphorus removal for waste water treatment
 
Membrane bio-reactor (2).pptx
Membrane bio-reactor (2).pptxMembrane bio-reactor (2).pptx
Membrane bio-reactor (2).pptx
 
Floods in Telangana Climate Change and Disasters July 2022.pptx
Floods in Telangana Climate Change and Disasters July 2022.pptxFloods in Telangana Climate Change and Disasters July 2022.pptx
Floods in Telangana Climate Change and Disasters July 2022.pptx
 
Air monitoring presentation
Air monitoring presentationAir monitoring presentation
Air monitoring presentation
 
Plume types
Plume typesPlume types
Plume types
 
ENVIRONMENTAL IMPACT OF EMISSION OF POWER PLANTS
ENVIRONMENTAL                   IMPACT OF EMISSION OF POWER PLANTSENVIRONMENTAL                   IMPACT OF EMISSION OF POWER PLANTS
ENVIRONMENTAL IMPACT OF EMISSION OF POWER PLANTS
 
R e a c t o r s & its kinetics
R e a c t o r s & its kineticsR e a c t o r s & its kinetics
R e a c t o r s & its kinetics
 
Biological wastewater treatment processes
Biological wastewater treatment processesBiological wastewater treatment processes
Biological wastewater treatment processes
 
Environment modelling
Environment modellingEnvironment modelling
Environment modelling
 
Anaerobic treatment and biogas (short)
Anaerobic treatment and biogas (short)Anaerobic treatment and biogas (short)
Anaerobic treatment and biogas (short)
 
Industrial waste water treatment
Industrial waste water treatmentIndustrial waste water treatment
Industrial waste water treatment
 
Wastewater treatment by vermi filtration technology
Wastewater treatment by vermi filtration technologyWastewater treatment by vermi filtration technology
Wastewater treatment by vermi filtration technology
 
Advanced wastewater treatment
Advanced wastewater treatmentAdvanced wastewater treatment
Advanced wastewater treatment
 
Measurement of ambient air pollutants, sampling and analysis
Measurement of ambient air pollutants, sampling and analysisMeasurement of ambient air pollutants, sampling and analysis
Measurement of ambient air pollutants, sampling and analysis
 
Sludge Treatment
Sludge TreatmentSludge Treatment
Sludge Treatment
 
bioethanol ppt
bioethanol pptbioethanol ppt
bioethanol ppt
 
New technology for desalination
New technology for desalinationNew technology for desalination
New technology for desalination
 
Wastewater management in pulp and paper industry
Wastewater management in  pulp and paper industryWastewater management in  pulp and paper industry
Wastewater management in pulp and paper industry
 
Zero liquid discharge
Zero liquid dischargeZero liquid discharge
Zero liquid discharge
 

Similar a AI for Waste Water Treatment: machine learning for real-time control

Unit 1 Transducers Engineering (Instrumentation).pdf
Unit 1 Transducers Engineering (Instrumentation).pdfUnit 1 Transducers Engineering (Instrumentation).pdf
Unit 1 Transducers Engineering (Instrumentation).pdfFelixD3
 
NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...
NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...
NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...Modelon
 
Whole Building Modeling Using OpenStudio
Whole Building Modeling Using OpenStudioWhole Building Modeling Using OpenStudio
Whole Building Modeling Using OpenStudioenergytrustor
 
Overview of Water cycles, wastewater treatment processes, wastewater plant en...
Overview of Water cycles, wastewater treatment processes, wastewater plant en...Overview of Water cycles, wastewater treatment processes, wastewater plant en...
Overview of Water cycles, wastewater treatment processes, wastewater plant en...AEP Ohio
 
8th sem project review
8th sem project review8th sem project review
8th sem project reviewAnkush Doshi
 
Introduction to energy audit part 2
Introduction to energy audit part 2Introduction to energy audit part 2
Introduction to energy audit part 2ZAINI ABDUL WAHAB
 
A Deep Learning use case for water end use detection by Roberto Díaz and José...
A Deep Learning use case for water end use detection by Roberto Díaz and José...A Deep Learning use case for water end use detection by Roberto Díaz and José...
A Deep Learning use case for water end use detection by Roberto Díaz and José...Big Data Spain
 
Green buildings : Challange in Operation and Maintenance
Green buildings : Challange in Operation and MaintenanceGreen buildings : Challange in Operation and Maintenance
Green buildings : Challange in Operation and MaintenanceTejwant Navalkar
 
Building performance analysis system IES VE main features overview
Building performance analysis system IES VE main features overviewBuilding performance analysis system IES VE main features overview
Building performance analysis system IES VE main features overviewStatybos Akademija
 
Pump Performance Presentation.pptx
Pump Performance Presentation.pptxPump Performance Presentation.pptx
Pump Performance Presentation.pptxAzharBudiman5
 
Hancock academy 1 Energy modeling for different housing types
Hancock academy 1   Energy modeling for different housing typesHancock academy 1   Energy modeling for different housing types
Hancock academy 1 Energy modeling for different housing typesDanielle Amasia
 
Data center specific thermal and energy saving techniques
Data center specific thermal and energy saving techniquesData center specific thermal and energy saving techniques
Data center specific thermal and energy saving techniquesXiao Qin
 
2015 x472 class 10 - lcca
2015 x472 class 10 - lcca2015 x472 class 10 - lcca
2015 x472 class 10 - lccamichaeljmack
 
Seminar Nima Yousefi 2015 Engineering University of Alberta
Seminar Nima Yousefi 2015 Engineering University of Alberta Seminar Nima Yousefi 2015 Engineering University of Alberta
Seminar Nima Yousefi 2015 Engineering University of Alberta Nima Yousefi, PEng, PMP
 
Module 3 - Basic Equipment
Module 3 - Basic EquipmentModule 3 - Basic Equipment
Module 3 - Basic Equipmentriezqaandika
 
C3 - Production Modelling for Sustainability
C3 - Production Modelling for SustainabilityC3 - Production Modelling for Sustainability
C3 - Production Modelling for SustainabilityIceland Geothermal
 
1675091151425_Process Management Risk.pptx
1675091151425_Process Management Risk.pptx1675091151425_Process Management Risk.pptx
1675091151425_Process Management Risk.pptxZerayacobTeklearegay
 
How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...
How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...
How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...Transcat
 

Similar a AI for Waste Water Treatment: machine learning for real-time control (20)

Unit 1 Transducers Engineering (Instrumentation).pdf
Unit 1 Transducers Engineering (Instrumentation).pdfUnit 1 Transducers Engineering (Instrumentation).pdf
Unit 1 Transducers Engineering (Instrumentation).pdf
 
NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...
NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...
NONLINEAR MODEL PREDICTIVE CONTROL FOR OPERATION OF A POST COMBUSTION ABSORPT...
 
Whole Building Modeling Using OpenStudio
Whole Building Modeling Using OpenStudioWhole Building Modeling Using OpenStudio
Whole Building Modeling Using OpenStudio
 
Overview of Water cycles, wastewater treatment processes, wastewater plant en...
Overview of Water cycles, wastewater treatment processes, wastewater plant en...Overview of Water cycles, wastewater treatment processes, wastewater plant en...
Overview of Water cycles, wastewater treatment processes, wastewater plant en...
 
8th sem project review
8th sem project review8th sem project review
8th sem project review
 
Introduction to energy audit part 2
Introduction to energy audit part 2Introduction to energy audit part 2
Introduction to energy audit part 2
 
A Deep Learning use case for water end use detection by Roberto Díaz and José...
A Deep Learning use case for water end use detection by Roberto Díaz and José...A Deep Learning use case for water end use detection by Roberto Díaz and José...
A Deep Learning use case for water end use detection by Roberto Díaz and José...
 
Green buildings : Challange in Operation and Maintenance
Green buildings : Challange in Operation and MaintenanceGreen buildings : Challange in Operation and Maintenance
Green buildings : Challange in Operation and Maintenance
 
Energy audit
Energy auditEnergy audit
Energy audit
 
Building performance analysis system IES VE main features overview
Building performance analysis system IES VE main features overviewBuilding performance analysis system IES VE main features overview
Building performance analysis system IES VE main features overview
 
Pump Performance Presentation.pptx
Pump Performance Presentation.pptxPump Performance Presentation.pptx
Pump Performance Presentation.pptx
 
Hancock academy 1 Energy modeling for different housing types
Hancock academy 1   Energy modeling for different housing typesHancock academy 1   Energy modeling for different housing types
Hancock academy 1 Energy modeling for different housing types
 
Data center specific thermal and energy saving techniques
Data center specific thermal and energy saving techniquesData center specific thermal and energy saving techniques
Data center specific thermal and energy saving techniques
 
2015 x472 class 10 - lcca
2015 x472 class 10 - lcca2015 x472 class 10 - lcca
2015 x472 class 10 - lcca
 
Seminar Nima Yousefi 2015 Engineering University of Alberta
Seminar Nima Yousefi 2015 Engineering University of Alberta Seminar Nima Yousefi 2015 Engineering University of Alberta
Seminar Nima Yousefi 2015 Engineering University of Alberta
 
Spc
SpcSpc
Spc
 
Module 3 - Basic Equipment
Module 3 - Basic EquipmentModule 3 - Basic Equipment
Module 3 - Basic Equipment
 
C3 - Production Modelling for Sustainability
C3 - Production Modelling for SustainabilityC3 - Production Modelling for Sustainability
C3 - Production Modelling for Sustainability
 
1675091151425_Process Management Risk.pptx
1675091151425_Process Management Risk.pptx1675091151425_Process Management Risk.pptx
1675091151425_Process Management Risk.pptx
 
How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...
How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...
How to Calibrate a Pressure Gauge with a Pressure Comparator or Calibrator We...
 

Más de Institute of Contemporary Sciences

Building valuable (online and offline) Data Science communities - Experience ...
Building valuable (online and offline) Data Science communities - Experience ...Building valuable (online and offline) Data Science communities - Experience ...
Building valuable (online and offline) Data Science communities - Experience ...Institute of Contemporary Sciences
 
Data Science Master 4.0 on Belgrade University - Drazen Draskovic
Data Science Master 4.0 on Belgrade University - Drazen DraskovicData Science Master 4.0 on Belgrade University - Drazen Draskovic
Data Science Master 4.0 on Belgrade University - Drazen DraskovicInstitute of Contemporary Sciences
 
Deep learning fast and slow, a responsible and explainable AI framework - Ahm...
Deep learning fast and slow, a responsible and explainable AI framework - Ahm...Deep learning fast and slow, a responsible and explainable AI framework - Ahm...
Deep learning fast and slow, a responsible and explainable AI framework - Ahm...Institute of Contemporary Sciences
 
Solving churn challenge in Big Data environment - Jelena Pekez
Solving churn challenge in Big Data environment  - Jelena PekezSolving churn challenge in Big Data environment  - Jelena Pekez
Solving churn challenge in Big Data environment - Jelena PekezInstitute of Contemporary Sciences
 
Application of Business Intelligence in bank risk management - Dimitar Dilov
Application of Business Intelligence in bank risk management - Dimitar DilovApplication of Business Intelligence in bank risk management - Dimitar Dilov
Application of Business Intelligence in bank risk management - Dimitar DilovInstitute of Contemporary Sciences
 
Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...
Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...
Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...Institute of Contemporary Sciences
 
Recommender systems for personalized financial advice from concept to product...
Recommender systems for personalized financial advice from concept to product...Recommender systems for personalized financial advice from concept to product...
Recommender systems for personalized financial advice from concept to product...Institute of Contemporary Sciences
 
Advanced tools in real time analytics and AI in customer support - Milan Sima...
Advanced tools in real time analytics and AI in customer support - Milan Sima...Advanced tools in real time analytics and AI in customer support - Milan Sima...
Advanced tools in real time analytics and AI in customer support - Milan Sima...Institute of Contemporary Sciences
 
Complex AI forecasting methods for investments portfolio optimization - Pawel...
Complex AI forecasting methods for investments portfolio optimization - Pawel...Complex AI forecasting methods for investments portfolio optimization - Pawel...
Complex AI forecasting methods for investments portfolio optimization - Pawel...Institute of Contemporary Sciences
 
Reality and traps of real time data engineering - Milos Solujic
Reality and traps of real time data engineering - Milos SolujicReality and traps of real time data engineering - Milos Solujic
Reality and traps of real time data engineering - Milos SolujicInstitute of Contemporary Sciences
 
Sensor networks for personalized health monitoring - Vladimir Brusic
Sensor networks for personalized health monitoring - Vladimir BrusicSensor networks for personalized health monitoring - Vladimir Brusic
Sensor networks for personalized health monitoring - Vladimir BrusicInstitute of Contemporary Sciences
 
Prediction of good patterns for future sales using image recognition
Prediction of good patterns for future sales using image recognitionPrediction of good patterns for future sales using image recognition
Prediction of good patterns for future sales using image recognitionInstitute of Contemporary Sciences
 
Using data to fight corruption: full budget transparency in local government
Using data to fight corruption: full budget transparency in local governmentUsing data to fight corruption: full budget transparency in local government
Using data to fight corruption: full budget transparency in local governmentInstitute of Contemporary Sciences
 

Más de Institute of Contemporary Sciences (20)

First 5 years of PSI:ML - Filip Panjevic
First 5 years of PSI:ML - Filip PanjevicFirst 5 years of PSI:ML - Filip Panjevic
First 5 years of PSI:ML - Filip Panjevic
 
Building valuable (online and offline) Data Science communities - Experience ...
Building valuable (online and offline) Data Science communities - Experience ...Building valuable (online and offline) Data Science communities - Experience ...
Building valuable (online and offline) Data Science communities - Experience ...
 
Data Science Master 4.0 on Belgrade University - Drazen Draskovic
Data Science Master 4.0 on Belgrade University - Drazen DraskovicData Science Master 4.0 on Belgrade University - Drazen Draskovic
Data Science Master 4.0 on Belgrade University - Drazen Draskovic
 
Deep learning fast and slow, a responsible and explainable AI framework - Ahm...
Deep learning fast and slow, a responsible and explainable AI framework - Ahm...Deep learning fast and slow, a responsible and explainable AI framework - Ahm...
Deep learning fast and slow, a responsible and explainable AI framework - Ahm...
 
Solving churn challenge in Big Data environment - Jelena Pekez
Solving churn challenge in Big Data environment  - Jelena PekezSolving churn challenge in Big Data environment  - Jelena Pekez
Solving churn challenge in Big Data environment - Jelena Pekez
 
Application of Business Intelligence in bank risk management - Dimitar Dilov
Application of Business Intelligence in bank risk management - Dimitar DilovApplication of Business Intelligence in bank risk management - Dimitar Dilov
Application of Business Intelligence in bank risk management - Dimitar Dilov
 
Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...
Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...
Trends and practical applications of AI/ML in Fin Tech industry - Milos Kosan...
 
Recommender systems for personalized financial advice from concept to product...
Recommender systems for personalized financial advice from concept to product...Recommender systems for personalized financial advice from concept to product...
Recommender systems for personalized financial advice from concept to product...
 
Advanced tools in real time analytics and AI in customer support - Milan Sima...
Advanced tools in real time analytics and AI in customer support - Milan Sima...Advanced tools in real time analytics and AI in customer support - Milan Sima...
Advanced tools in real time analytics and AI in customer support - Milan Sima...
 
Complex AI forecasting methods for investments portfolio optimization - Pawel...
Complex AI forecasting methods for investments portfolio optimization - Pawel...Complex AI forecasting methods for investments portfolio optimization - Pawel...
Complex AI forecasting methods for investments portfolio optimization - Pawel...
 
From Zero to ML Hero for Underdogs - Amir Tabakovic
From Zero to ML Hero for Underdogs  - Amir TabakovicFrom Zero to ML Hero for Underdogs  - Amir Tabakovic
From Zero to ML Hero for Underdogs - Amir Tabakovic
 
Data and data scientists are not equal to money david hoyle
Data and data scientists are not equal to money   david hoyleData and data scientists are not equal to money   david hoyle
Data and data scientists are not equal to money david hoyle
 
The price is right - Tomislav Krizan
The price is right - Tomislav KrizanThe price is right - Tomislav Krizan
The price is right - Tomislav Krizan
 
When it's raining gold, bring a bucket - Andjela Culibrk
When it's raining gold, bring a bucket - Andjela CulibrkWhen it's raining gold, bring a bucket - Andjela Culibrk
When it's raining gold, bring a bucket - Andjela Culibrk
 
Reality and traps of real time data engineering - Milos Solujic
Reality and traps of real time data engineering - Milos SolujicReality and traps of real time data engineering - Milos Solujic
Reality and traps of real time data engineering - Milos Solujic
 
Sensor networks for personalized health monitoring - Vladimir Brusic
Sensor networks for personalized health monitoring - Vladimir BrusicSensor networks for personalized health monitoring - Vladimir Brusic
Sensor networks for personalized health monitoring - Vladimir Brusic
 
Improving Data Quality with Product Similarity Search
Improving Data Quality with Product Similarity SearchImproving Data Quality with Product Similarity Search
Improving Data Quality with Product Similarity Search
 
Prediction of good patterns for future sales using image recognition
Prediction of good patterns for future sales using image recognitionPrediction of good patterns for future sales using image recognition
Prediction of good patterns for future sales using image recognition
 
Using data to fight corruption: full budget transparency in local government
Using data to fight corruption: full budget transparency in local governmentUsing data to fight corruption: full budget transparency in local government
Using data to fight corruption: full budget transparency in local government
 
Geospatial Analysis and Open Data - Forest and Climate
Geospatial Analysis and Open Data - Forest and ClimateGeospatial Analysis and Open Data - Forest and Climate
Geospatial Analysis and Open Data - Forest and Climate
 

Último

How to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsHow to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsBrainSell Technologies
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证acoha1
 
obat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di Bontang
obat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di  Bontangobat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di  Bontang
obat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di Bontangsiskavia95
 
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证zifhagzkk
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Klinik Aborsi
 
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI  MANAJEMEN OF PENYAKIT TETANUS.pptMATERI  MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI MANAJEMEN OF PENYAKIT TETANUS.pptRachmaGhifari
 
What is Insertion Sort. Its basic information
What is Insertion Sort. Its basic informationWhat is Insertion Sort. Its basic information
What is Insertion Sort. Its basic informationmuqadasqasim10
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunksgmuir1066
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024patrickdtherriault
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...ssuserf63bd7
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...ThinkInnovation
 
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...yulianti213969
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证pwgnohujw
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesBoston Institute of Analytics
 
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证dq9vz1isj
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshareraiaryan448
 
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...BabaJohn3
 
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单aqpto5bt
 
The Significance of Transliteration Enhancing
The Significance of Transliteration EnhancingThe Significance of Transliteration Enhancing
The Significance of Transliteration Enhancingmohamed Elzalabany
 

Último (20)

How to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsHow to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data Analytics
 
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(UPenn毕业证书)宾夕法尼亚大学毕业证成绩单本科硕士学位证留信学历认证
 
obat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di Bontang
obat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di  Bontangobat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di  Bontang
obat aborsi Bontang wa 082135199655 jual obat aborsi cytotec asli di Bontang
 
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
 
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI  MANAJEMEN OF PENYAKIT TETANUS.pptMATERI  MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
 
What is Insertion Sort. Its basic information
What is Insertion Sort. Its basic informationWhat is Insertion Sort. Its basic information
What is Insertion Sort. Its basic information
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
Identify Customer Segments to Create Customer Offers for Each Segment - Appli...
 
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
obat aborsi Bontang wa 081336238223 jual obat aborsi cytotec asli di Bontang6...
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
 
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
 
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
一比一原版(ucla文凭证书)加州大学洛杉矶分校毕业证学历认证官方成绩单
 
The Significance of Transliteration Enhancing
The Significance of Transliteration EnhancingThe Significance of Transliteration Enhancing
The Significance of Transliteration Enhancing
 

AI for Waste Water Treatment: machine learning for real-time control

  • 2. AI FOR WASTE WATER TREATMENT. Machine learning for real-time control Robert van Straalen
  • 3. • Robert van Straalen • Lead data scientist @ Data Science Lab • Data scientist @ ING • Database marketing, BI, Software development • MSc. Artificial Intelligence @ Utrecht University ABOUT ME.
  • 4. • Waste water treatment • Drinking water treatment • Dikes, sewer systems, etc. • Innovation culture
  • 6. AI USE CASES WITHIN THE ENTERPRISE. Source:CloudPulseStrategies
  • 7. WHY INDUSTRIAL AI IS HARD.
  • 8. WWTP AMSTERDAM WEST. • Largest WWTP in the region • Built in 2005 • Handles 63M m3/year • ± 1 million people • 7 water treatment lanes • Sludge processing lane • Programme to explore how AI can help with optimization
  • 9. • Primary treatment: Sedation • Separate solids from fluids • Secondary treatment: Aeration • Add microbacteria • Add oxygen to feed them • Microbacteria convert NH4 & O2 to NO3 & H2O • Tertiary treatment: • Sedation again • Sludge processing • Clean water, bio gas, struvite crystals HOW DOES A WWTP WORK?
  • 11. Pressure 1 Flow 1 Flow 3 Valves 3.1, 3.2, 3.3 Blowers 1 - 6 Valves 7.1, 7.2, 7.3 Flow 7 Pressure 2
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Pressure 1 Flow 1 Flow 3 Valves 3.1, 3.2, 3.3 Blowers 1 - 6 Valves 7.1, 7.2, 7.3 Flow 7 Pressure 2
  • 17. • Part 1: Basics • Determine continuously (i.e. every minute): • How much air flows through each lane? • How much energy is consumed by each lane • Part 2: Optimization • Determine a control strategy that continously (i.e. every minute): • Controls the aeration process • Blower settings • Valve settings • such that • The right amount of air is pumped through each tank • With minimal energy consumption PROBLEM DEFINITION.
  • 18. • Goal: determine air flow & energy consumption for each lane • Approach: 1. Determine air flow per lane 1. Gebruik data van flowmeter voor AT 5 (betrouwbaar) 2. Bouw model op deze data 3. Gebruik model om flow voor overige AT’s te voorspellen 2. Determine total energy consumption 6 blowers 1. Compute from kW measurements 3. Energy consumption lane = (air flow lane / air flow total) * energy consumption total APPROACH.
  • 19. • Azure Data Science Virtual Machine with GPU • Azure DevOps / Pipelines • Github • Anaconda (Python) • PyCharm • Tensorflow + Tensorboard • OpenAI Gym • Flask • Docker TOOLING.
  • 20. • Input scaling • Pressure only dependent on blowers & valves: • ➤ no bias • ➤ non-negative constraints • Output layers: • Linear activation • Use bias initializer with average output value • Tune loss_weights for right balance • Adam optimizer; learning rate 0.0003 NEURAL NETWORK.
  • 21. MODEL PERFORMANCE. • Pressure: Mean absolute error 0.37 (on a range of ± 0-90) • Air flow: Mean absolute error 177 (on a range of ± 0-11.000) • Energy consumption: Mean absolute error 3.1 (on a range of 0-400)
  • 22. • predict.py • Python module to get model predictions • api.py • Flask script for API definition • Dockerfile: • Python + packages • Start Gunicorn web server • azure-pipelines.yml • Build & Test pipeline DEPLOYMENT.
  • 23. • So we predicted air flow / energy consumption... • That’s nice and all • But we haven’t optimized anything yet! That was just the first part!
  • 24. • Observe the environment • Choose an action • Execute the action in the environment • Observe reward and changes in the environment • Evaluate the choice of your action • Repeat REINFORCEMENT LEARNING.
  • 25. 1. Observe required airflow • Derived from water influent + oxygen/ammonium measurements 2. Choose new settings for blowers & valves • This is done by the agent 3. Observe resulting air flow & energy consumption • This is done using the modelfrom the 1st part 4. Evaluate the result • Penalize deviations wrt required airflow • Penalize energy consumption 5. Adapt the agent’s model based on the evalution 6. Back to 1. APPROACH.
  • 26. • Deep Deterministic Policy Gradient • Similar to Deep Q-learning, but for continuous action spaces • Two models, trained itreratively: • Actor controls the settings (chooses actions) • Critic evaluates the result • Model from part 1 is a simulation of the environment • Tricks like experience replay, target networks, warmup, random process exploration DDPG ALGORITHM.
  • 27. • Environment in OpenAI’s gym format • Define possible actions • Define what the states look like • Define a function that, given a state and an action, returns a reward • This uses the model from part 1. • DDPG from Keras-RL library • Relatively clear design; DDPG implemented • States: Pressure, Air flow, Blowers, Valves • Actions: Blowers, Valves • Reward: required vs. achieved airflow + energy consumption IMPLEMENTATION.
  • 28. • Actor: State ➤ Action • Input = State (Pressure, Air flow, Blowers, Valves) • Scaling • 2 dense layers with ReLU activation • Output with tanh activation ➤ Blowers + Valves • Critic: State + Action ➤ Reward • Input = State + Action • Scaling • 2 dense layers with ReLU activation • Output with linear activation ➤ Reward N.B. Actor netwerk is pre-trained on current control strategy ACTOR & CRITIC.
  • 30. • Impediment: • Direct control of blowers & valves not possible for the next two years or so • Scope: • Don’t focus on energy consumption • Focus on nitrogen emissions (N2O, NO3, NH4) SURPRISE!
  • 31. • A new environment model that • given a ‘state’ (measurements) • given proposed action (control settings) • predicts the next state (measurements) • An influent forecast model that • given date/time & previous measurements • predicts the expected influent • A control strategy model that • given a ‘state’ • given an influent forecast • predicts the best action (control settings) FOLLOW-UP. + ➤ ➤ ➤ +
  • 33. • Who has the domain knowledge? • Which data is reliable? • Data augmentation for better generalization • Andrej Karpathy’s Recipe for training neural networks: • Tensorboard: write_images makes logs explode, but it helps in validating the weights • Tuning a neural net based on the loss curve is one thing, but tuning a reinforcement learning agent on a reward curve... • Reinforcement learning is still in its infancy • Translate continuous actions to discrete actions LEARNINGS.