VIETNAM NATIONAL UNIVERSITY HOCHIMINH CITY UNIVERSITY OF INFORMATION TECHNOLOGY ADVANCED PROGRAM IN INFORMATION SYSTEMS PHAN HOANG NAM - 16520776 LÊ THỊ PHỤNG - 16521775 USING GROUND-BASED AIR QUALITY MONITORING STATIONS TO PREDICT HOURLY AIR QUALITY OF HO CHI MINH CITY BACHELOR OF ENGINEERING IN INFORMATION SYSTEMS HO CHI MINH CITY, 2021 NATIONAL UNIVERSITY HOCHIMINH CITY UNIVERSITY OF INFORMATION TECHNOLOGY ADVANCED PROGRAM IN INFORMATION SYSTEMS PHAN HOANG NAM - 16520776 LÊ THỊ PHUNG - 16521775 USING GROUND-BASED AIR QUALITY MONITORING STATIONS TO PREDICT HOURLY AIR QUALITY OF HO CHI MINH CITY BACHELOR OF ENGINEERING IN INFORMATION SYSTEMS THESIS ADVISOR Associate Professor. NGUYEN DINH THUAN HO CHI MINH CITY, 2021 ASSESSMENT COMMITTEE The Assessment Committee is established under the Decision. by Rector of the University of Information Technology. ACKNOWLEDGMENTS First of all, we would like to express our appreciation to Associate Professor Nguyễn Dinh Thuan for his time and guidance during the making of this thesis.
His teaching has greatly influenced our works and help us change in positive ways. Our top positive receptions also go to all the members of Faculty of Information Systems as well as everyone of University of Information Technology for their guidance, supports to us with greatest cares. Not the least, we feel in extremely need of showing our gratitude to our family, our friends, and our classmates for every support and love that we have received on our maturity path. Phan Hoang Nam & Le Thi Phung — students of aep 2016.
1i TABLE OF CONTENTS ACKNOWLEDGMENTS. Ăn 011 krreranne ii TABLE OF CONTENTS LIST OF FIGURES 1.2 Current status of research .3 _ The problems and its significanc “ 1.cccchnhìnhnình nhu 3 1.ccccccccctcttihn ngờ, 3 Chapter 2 RELATED RESOURCES.1 Air Quality Index (AQT).1 Calculate hour AQI for in Viet Nam.3 Components of time series 2.5 Usage of time series 2.7 Rolling window for time series regression 2.2 Recurrent neural netWOrK.1 Overview of recurrent neural network 2.2 Long Short-Term Memory (LSTM) 2.3 Bidirectional RNN and Bidirectional LSTM 2.2 Reason for choosing TensorFlow 2.4 — Google cloud platform 2.5 Evaluation metrics and result 2.1 Mean Absolute Error 2.2 Mean Absolute Percentage Error iii 2.3 Root Mean Squared Error Chapter 3 Deep learning model design and evaluation.2 Data collection and descriptioi 3.1 Overview of model 3.4 Deploy models to google cloud platform.1 Deploy models to google cloud platform .2 Make a Flask API to get new data and get new prediction from models 46 3.3 Make a Streamlit Front end to show our models on the internet. Chapter 4 CONCLUSION AND FUTURE WORKS. chi He he 50 Chapter 5.--- con ceeirirrrrrrrrrrrrrrrrrrrrrrrrrrmrrrnrersrersree 52 LIST OE FIGURES Figure 2.1 AQI table with air quality description.2: Time series data example .3: Time series’ COIDOTIIES.
- St ‡EEkEEEEEEkEEEEkrkrrkrkerkee 10 Figure 2.4: Stationary time series ©XaITDÏA. -- ¿5c cccc+scsrrrxerxerxrrxrrr 11 Figure 2.5: Time series analysis example .6: Time series forecasting example Figure 2.7: Different method for modeling time series data Figure 2.8: Rolling window description Figure 2.9: Recurrent network illustration. ccs TÔ, Figure 2.10: One neuron in LSTM layer .11:The repeating module in an LSTM contains three interacting layers.14: Dropout method on deep learning neural networKk.16: Some google cloud platform services .1: Thesis general processes Figure 3.2: Raw data file.- ch re Figure 3.3: Plot of raw data Figure 3.4: Remains of raw data.5: Missing data spot.6: Missing data spot 2.7: Cleaning data process. - 5: tt TH Hư 31 Figure 3.8: Missing data eXapÏC.9: Front fill and back fill example respectiveÌy .10: Time continuous marking.----‹-- c-s5xe+xssxsxsrerxerxerxerxerxrrv 32 Figure 3.11: Calcualte AQT pTOC€SS.12: Dickey fuller test result Figure 3.14: Partial Autocorrelation plot Figure 3.15: Seasonal decomposed pÏOt.--- + 5c++cscsseeeseeersexereeereee SO Figure 3.16: Data standardization DFOC€SS.- ¿555cc cccctsrrerrrrrrrrrrer 37 Figure 3.17: Cyclical data encode for hOUT.- -- se e>s++csrerxerxerxerxerxer 39 Figure 3.18: Train, valid, test data Split .--s¿- (555cc 2ccccccrcrrerrrrrrrrerrer 40 Figure 3.19: 12-time windows performance Figure 3.20: Overview of model.21: Training/ validation loss with model prediction on test data Figure 3.22: General steps to upload model on google cloud platform.23: Upload model to Google Cloud AI Platform.24: Google cloud storage files .-- esses + tt 46 Figure 3.25: Cronjob for Flask APP[.26: The interaction between client and docker host.
5-55 5+ccxccxerxerkerkerkrrrrrrrrrrrrrrkrrrer 49 vi ABSTRACT Air quality prediction is one of the problems which has been focused recently. On the side of research and application, many machine learning models and deep learning models has attempted to forecast quality of the air and achieve noticeable success. Viet Nam is also trying to integrate air quality monitoring with the inclusion of forecasting system in recent years. Due to having just been noticed in Viet Nam, air quality models suffered from data shortage both by the length of data and number of monitoring sites currently available.
By applying some time-series techniques and bi-directional LSTMs, we have to some extend improve the forecasting result of models on Ho Chi Minh City. In this thesis, we focus on predicting the next five hours air quality in Ho Chi Minh City with the help of data from space by NASA. vii Chapter 1 PROBLEM STATEMENT 1.1 Context Air affects most aspects of human life and contributes greatly to the development of the economy. Today, air pollution is becoming one of the most significant environmental problems in the world.
In recent years, air quality is continuously decreasing because of human’s activities: urbanization, industrialization, vehicles emission,. and some from natural sources like volcanic eruptions and forest fires. All these activities raise the volume of many pollutants in the atmosphere, such as SO2, NO;, CO2, NO, CO, NOx, especially particulate matter pollutants (PM; and PMjo). The volume of PM2; negatively influences on human wellbeing mainly because less than 2.5 microns’ matter can penetrate deep into the lung and cause various diseases including heart and respiratory problems.
According to World Health Organization (WHO), around 4.2 million people die every year from exposure to ambient air pollution and as many as 60,000 deaths in Viet Nam in a report from 2016 [1]. In another report for air pollution in the year 2020 from IQAir, Viet Nam ranked in the top 25 of the most polluted countries in the world with the air quality remains nearly 4 times the WHO target for annual exposure. The annual volume of PM: is more than 55.4 ug/m3 or 110 in Air Quality Index (AQD. As one method for monitoring air quality, outside air pollution forecasting have shown great result in warning population of incoming polluted air and also in raising awareness of air quality to the people.
Viet Nam has taken many actions to reduce the cause of air pollution in recent years. Mainly using greener vehicles, alternative energy sources, reinforcing urban planning and encouraging efficient agriculture practices.2 Current status of research In order to solve increasingly serious environmental pollution problems, many countries have attempted many machine learning and deep learning system in order to forecast the air quality in the future. Earliest systems dated back in 1970s and continued to today. Overall, systems can be separated into two types: numerical and data-driven.
Numerical models are based on classical physical and chemical theories which relied on simulating the transport and conversion of chemical components in the air to predict the concentration [2, 3]. These deterministic models strive to comprehend the result of many factors that make up the pollutant concentration but have not achieved success partly because data for these models is hard to collect and difficult to ascertain the quality. Due to these limitations in numerical approaches, data-driven approach has become popular as the method for forecasting time-series data. Various methods have been employed with different results.
One good reference on the issue of forecasting with ANN is Kukkonnen et al. In their paper, they have succeeded in evaluating and comparing forecasting models for hourly concentration and PM jo in Helsinky, Finland. Kurt et al. [5] also proposed a simple neural network to predict daily air quality and some parameter investigation in time series model for Greater Istanbul Area.
In Kurt’s and colleagues paper, they find that including day of week, holidays, weekend have a significant effect on deep learning models. Some other novel models like MLP, RBF have also been implemented and shown good results [6, 7]. In the process of making this thesis, maybe due to being a new subject , this work can’t find any related research in Viet Nam. With our limited knowledge, this is the first model which is studied in Viet Nam.
This thesis focuses on forecasting air quality with deep learning Bidirectional Long Short-Term Memory inspired by [8]. The problems and its significance In many past research, researchers have proven that the effect of data in machine learning models is of great significance. In this work, we tried to solve two most important problem. The first problem we encountered is choosing the right model that would give great performance for our goals.
Based on our gathered data and the natures of our goal we went with bidirectional LSTM models after some testing. This model is designed to tackle time-series problems and have had some success according to scientific papers we have read. Building and testing model’s parameters are one of the main parts of this project. We also had to modify our data using several time-series techniques to make them compatible with our model.
The second problem we encounter is to meaningfully utilize our model in production. To qualify for production, models need to be robust, free of latency and are easy to maintain. To tackle this problem, we used cloud services and develop the system into two parts: API server and front-end web. Each part solely handles the backend and frontend of the production environment.4 Motivation Due to time constraint and data constraint, we have set three goals for this thesis: 1.
Build air quality dataset of 1 air monitoring station in Ho Chi Minh city. Build a model to predict the air quality of that station for the next five hours. Successfully deploy models on cloud services for public use. We collected and cleaned data from official sites US embassy.
We organize data in csv files to train and test model. Our group applied Vietnamese method certified by the government to calculate AQI. Additional features were extracted and put into models by applying several time-series techniques 5. With at least thirty minutes latency, we can output the expected air quality for Ho Chi Minh City region for the next five hours with average root mean square error at 15.
Chapter 2 RELATED RESOURCES 2.1 Air Quality Index (AQI) An air quality index (AQI) is used by government agencies to communicate to the public how polluted the air currently is or how polluted it is forecast to become. Public health risks increase as the AQI rises. Different countries have their own air quality indices, corresponding to different national air quality standards. In this thesis we will be calculating AQI by Viet Nam official standard as stated in this document [9].
There are 6 major pollutants in the air according to the document: « O3 « CO e SO2 e NO2 e PMIO e PM2.5 For each pollutant, an AQI value of 100 generally corresponds to an ambient air concentration that equals the level of the short-term national ambient air quality standard for protection of public health. AQI values at or below 100 are generally thought of as satisfactory. When AQI values are above 100, air quality is unhealthy: at first for certain sensitive groups of people, then for everyone as AQI values get higher. AQI Basics for Ozone and Particle Pollution Dally AQT Values of Color Levels of Concern Index Description of Air Quality Orange | Unhealthy for Sensitive | 101 to 150 | Members of sensitive groups may experience health effects.
The general public Is less likely to be Groups affected.1 AQI table with air quality description The AQI is divided into six categories. Each category corresponds to a different level of health concern.