XXX-X-XXXX-XXXX-X/XX/$XX.00 ©20XX IEEE AMIHAN: An Advanced Monitoring Intelligence for Harmful Air Navigation based on Mandaluyong, Philippines Kim Caryl H. Esperanza School of Information Technology Mapua University Makati, Philippines
[email protected] Louella Josephine A. Ng School of Information Technology Mapua University Makati, Philippines
[email protected] Christine Julliane L. Reyes School of Information Technology Mapua University Makati, Philippines
[email protected] Abstract— Air quality forecasting is essential for urban health and environmental sustainability, particularly in densely populated areas like Mandaluyong City, Philippines. This study applies machine learning, specifically a Random Forest Regressor model, to predict concentrations of key pollutants: sulfur dioxide (SO₂), carbon monoxide (CO), and particulate matter (PM2.5). Using 20 years of data (2003–2022) from the Humanitarian Data Exchange (HDX), this research isolates pollution patterns specific to Mandaluyong. Model training incorporated temporal feature engineering and rolling crossvalidation, achieving high predictive accuracy, with initial R² scores near 99% and retrained models stabilizing around 85% when accounting for temporal complexities. These results suggest that the model is a robust predictor for daily pollution levels, supporting public health initiatives and policy planning by enabling timely responses to pollution fluctuations. This study demonstrates the value of machine learning in urban air quality management, laying a foundation for future work aimed at vehicle-specific pollution mitigation, particularly for iconic jeepneys in the Philippines. Keywords—air quality, Random Forest Regressor, Mandaluyong City, pollution prediction, machine learning, predictive model I. INTRODUCTION Air quality significantly influences the health, safety, and quality of life of urban populations while also impacting broader environmental sustainability goals (Zhan et al., 2023). Many cities worldwide, including the Philippines, grapple with substantial air pollution due to urbanization, vehicle emissions, industrial activities, and other pollution sources. In 2020, the Philippines was reported to have air quality levels averaging twice the World Health Organization’s (WHO) recommended safe limits, indicating "moderately unsafe" conditions that pose health risks (IQAir, 2021). Studies, such as those conducted by Karimi et al. (2019), link poor air quality to adverse health outcomes, including respiratory and cardiovascular diseases, making air pollution a critical public health concern. However, despite these pressing risks, there remains a scarcity of research dedicated to forecasting air quality specifically within urban centers in the Philippines. This project addresses this gap by focusing on Mandaluyong City, a densely populated urban center within Metro Manila. Through machine learning techniques, specifically the Random Forest Regressor, this study seeks to predict pollution levels and identify trends for key pollutants: sulfur dioxide (SO₂), carbon monoxide (CO), and particulate matter (PM2.5). This machine learning model is well-suited for handling the complexities of urban air pollution data, as it captures temporal dependencies and nonlinear trends that are common in pollution dynamics (Malashin et al., 2024; Zhu, 2020). Our central question is: How can machine learning models predict air quality trends in Mandaluyong to support policy-making and public health efforts? Accurate predictions can be invaluable for local government, healthcare providers, and environmental advocates, helping them create timely and effective responses to air pollution (Chang et al., 2020). By focusing on one urban area, this study provides valuable insights into the specific pollution challenges Mandaluyong faces and demonstrates how localized data-driven methods can improve decision-making. Moreover, as this study is focused on Mandaluyong City, discussion on the other cities is beyond the scope of this study to allow a focused model training, testing, and evaluation. Furthermore, this study narrows down its predictions to three individual pollutants - SO2, CO, and PM2.5, which means that other pollutants will be excluded from the analysis. Similarly, other environmental factors like temperature and precipitation, which can also contribute to analyzing pollution, will not be considered. To sum up, this project has three main goals: (1) to build a reliable forecasting model that can reveal pollution trends in Mandaluyong, helping government and environmental organizations plan responses; (2) to support public health by identifying potential pollution risks for the community; and (3) to make air quality data and visualizations accessible to both experts and the public. Through detailed data preparation, model development, and testing, this study aims to produce reliable predictions that support public health, inform policy, and raise awareness about pollution trends in the community. II. METHODOLOGY This study employs a structured approach to analyze and model air quality data for Mandaluyong City over two decades. Data processing, visualization, and predictive modeling were conducted primarily in Jupyter Notebook, which facilitated an organized workflow for data
management, exploratory analysis, and model development. The following subsections illustrate the steps taken to produce reliable insights. A. Dataset Collection & Preprocessing The dataset utilized in this study was sourced from the Humanitarian Data Exchange (HDX) under the United Nations, specifically focusing on air quality data localized to the Philippine setting. Provided by Project CCHAIN - Project Climate Change, Health, and Artificial Intelligence - this dataset is validated, open-sourced, and covers 20 years from 2003 to 2022. It includes comprehensive data on climate, environmental, and socioeconomic factors linked to health dimensions at the village level across twelve Philippine cities. The study concentrates on data specific to Mandaluyong, enabling a focused analysis of local climate and air quality trends. Pre-processing involved loading and inspecting the dataset using Python's Pandas library. Initial exploration identified January 1, 2003, as the primary date with missing values, specifically for certain air quality components. This date was subsequently removed from the dataset to achieve data completeness. Filtering operations were then applied to isolate records specific to Mandaluyong, identified by unique adm4_pcode entries, while entries from other locations were excluded. To streamline the analysis, only three key pollutants—CO, SO₂, and PM₂.₅—were retained, while other air quality components were dropped. The data was then divided into training and testing sets, with the training subset covering 2003 to 2020 and the testing subset covering 2021 to 2022. This division supports model training and predictive analysis based on recent trends in Mandaluyong’s air quality data. B. Model Development The dataset in its raw form began with multiple cities and daily entries for pollutants such as the primary foci of the model's predictive streak: CO (Carbon Monoxide), SO2 (Sulfur Dioxide), and PM2.5 (Particulate Matter in 2.5 microns) with a timeframe starting from the early 2000s to the late 2020s. The researchers have aptly divided the work evenly to process the data in different stages. The first includes preprocessing, where the basic checking of null and duplicate values is done. Followed by a standard Exploratory Data Analysis (EDA) to allow the researchers to be familiar with the base data; it is also important to note that instead of utilizing scikit libraries for test splitting, the developers have decided to simply focus on the 3 pollutants and 1 location (in this case, city). After passing the work along, some parts of the dataset needed to be transformed before the model fitting. For it (AMIHAN) to properly function, the dataset's 'date' column was transformed from dtype 'object' to 'DateTime,' and further divulged into separate categories between its year(s), month(s), and week(s) before dropping the original column altogether in place of the new temporal variables. To finish, it was also observed that the primary foci were not standardized, and between the choice of normalization and the aforementioned— given that one of the highly affecting features is in normal form with values ranging from 0 to 1, the researchers decided to follow through with the decision of first transforming the other foci to its normalized form before inversing it later on during the evaluation and fitting for better understanding. With regards to the model specifications, the Random Forest Regressor (RFR) has a Random State created with a standard value of 42 due to the heavy number of our dataset that spans thousands of entries to ensure reproducibility. Hyperparameters labelled within the code as 'n_estimators' are set to 100 to balance model complexity and computational efficiency; before using the Multi-Output Regressor to reflect the fit across all three (3) foci simultaneously. C. Model Estimation and Validation The data was split into training and test sets based on the older to newer years. There were two (2) different instances in which the developers used differing methods. The other is a split during preprocessing, the other is made using the scikit libraries available in Python for the reinitializing of the base model to fit the temporal variables using (a) Lag Features and (b) Rolling [mean] Statistics. Hyperparameter Tuning to optimize RFR performance involved Grid Search, in our case the n_estimators (number of trees in the forest tested over [the] range of values) = 100. To assess the retrained model's generalization ability given temporal variables, a Time Series Cross-Validation was implemented. Given the temporal nature of the data, this method was employed as it involved splitting data into training and test sets each time as it moves forward in time; creating an iterative process whenever there are, realistically, new values input. D. Forecasting Procedure The procedure for forecasting the air pollutants with AMIHAN follows a structured and iterative approach. The Random Forest Regressor (RFR) was selected for this project due to its nature when handling non-linear relationships and continuous numerical values. It is perfect in that it has the right amount of simplicity and complexity when creating predictions using multiple decision trees via the manipulation of accuracy and overfit reduction through ensemble learning. The temporal variables were handled by using the rolling mean and lag features to determine the dynamic behavior of these values across time. This step was important in improving the base model since the goal is, from the start, to attempt to predict future values accurately. E. Visualization Framework The libraries used to plot the data and model predictions consist mainly of the 'matplotlib' library due to the heavily numerical nature of the data. The forecasted pollutant levels were graphically summarized through scatterplots with leading lines that serve as the typical 'actual' values versus the residuals and the predicted values. In terms of any comparative analysis, the residual plot—one that shows the bias of the model—shows that the data points are both scattered and yet messily following around the 'zero' line.
Suggesting a balanced bias that AMIHAN creates, given that it is based on one location, the results are quite outstanding. F. Model Performance Assessment AMIHAN is evaluated through the following metrics: (1) R2 score, (2) Mean Squared Error (MSE). (3) Residual and Feature Importance Testing, and (4) the Time Series CrossValidation (Rolling Cross-Validation). The latter being the most interesting evaluation method because it is a process where the whole data set is repeatedly 'folded' and tested. Where, for example, AMIHAN trains using data from 2003 to 2006 and then test itself by 2007. The evaluation returns to the first and second score-types (R2 and MSE) per fold where it then ends by providing average MSE and R2. Doing all these evaluations allowed the developers to give birth to the model: AMIHAN, as it is continuously being tested for its performance to ensure accuracy, robustness, and ability to generalize unseen data, giving the model a solid foundation. III. RESULTS AND DISCUSSIONS Fig. 1. Predicted Pollutant Level DataFrame Figure 1 presents the DataFrame generated from the model's predictions, displaying the daily predicted concentrations of CO, SO₂, and PM₂.₅ beginning from the day following the end of the original dataset. This DataFrame comprises 2,920 entries, representing daily pollutant level predictions over an 8-year period after the dataset's conclusion. Fig. 1. Fig. 2. Mean Squared Error and R2 Evaluation of Base Model The evaluation of the initial model demonstrates an overall exceptional level of accuracy. The Mean Squared Error (MSE) of 0.000616 reveals that, on average, the squared differences between the predicted and actual values are minimal, which suggests a high degree of accuracy. Similarly, the Mean Absolute Error (MAE) of 0.0034 indicates that the average absolute differences between the predictions and actual values are very small, highlighting the model's precision in approximating real values. Furthermore, the R2 score of 0.9999 suggests that the model explains 99.99% of the variance in the target variables—specifically, the pollutants. This extremely high R² value signifies that nearly all the variability in the data is accounted for by the model’s predictors. Collectively, these metrics underscore the model's high level of accuracy, minimal predictive error, and its ability to capture nearly all the variance present in the dataset. Fig. 2. Fig. 3. Mean Squared Error and R2 Evaluation of Retrained Model In the retrained model, the inclusion of temporal variables led to an observable impact on the model's performance. The Mean Squared Error (MSE) for this model increased significantly to 12.599, compared to the previous model's 0.000616, indicating a considerably larger average squared difference between predicted and actual values. Additionally, the R2 score of 0.8526 suggests that the model now explains approximately 85.26% of the variance in the target variable, or the pollutants. While this is still a relatively high value, capturing a substantial portion of the variability, it is notably lower than the nearly perfect fit (99.99%) achieved by the initial model. This reduction in performance metrics may suggest that the first model’s near-perfect accuracy could have indicated overfitting, as it did not account for temporal complexity. With the addition of temporal data, the second model now provides a more realistic performance, potentially enhancing its ability to generalize effectively to unseen data. Fig. 4. Comparison of Actual vs Predicted Levels for Key Air Pollutants (PM2.5, CO, and SO₂) The actual vs. predicted plots for PM2.5, CO, and SO₂ reveal key trends that highlight both the strengths and limitations of the predictive model for each pollutant. The scatter plots indicate a tight clustering of data points around the red dashed line, which represents perfect predictions, thereby supporting the model's favorable numerical results. Low error metrics further confirm that the model effectively captures much of the variance in pollutant levels under typical conditions. Nevertheless, variations in predictive accuracy emerge as pollutant concentrations increase. For PM2.5, the spread of
points significantly widens beyond a concentration of 80, suggesting that the model's accuracy declines at higher concentrations, potentially due to unmodeled environmental variables. Similarly, CO predictions exhibit a moderate increase in variability above 0.25, indicating a slight reduction in accuracy at elevated levels. In contrast, SO₂ predictions maintain relatively stable accuracy even at higher concentrations (above 8), as evidenced by minimal spread at these levels. This trend suggests that the model may be better at capturing the factors influencing SO₂ than those affecting PM2.5 and CO. Fig. 5. Comparison of Residuals vs. Predicted Values for PM2.5, CO, and SO₂ Levels Residual plots are a valuable tool for assessing model accuracy, providing insights into potential bias and predictive performance across pollutant levels for PM2.5, CO, and SO₂. Ideally, an unbiased model should display residuals that are evenly dispersed around the zero line, with no discernible patterns. For PM2.5, the residuals are predominantly centered around zero at lower concentrations, indicating good predictive accuracy in this range. However, an increased spread at higher PM2.5 levels suggests a tendency toward underprediction and potential bias as concentrations rise, which aligns with observations from the scatter plots. For CO, residuals remain largely centered around zero, with only a slight increase in spread at elevated levels, indicating minor accuracy loss at higher CO concentrations. In the case of SO₂, residuals are tightly clustered around zero, reflecting stable accuracy and minimal bias across varying levels. These residual patterns illustrate that while the model performs well for typical pollutant levels, the increased spread at higher concentrations of PM2.5 and, to a lesser extent, CO, indicates reduced accuracy, especially at elevated PM2.5 levels. Fig. 3. Fig. 4. Fig. 6. Time-Series Cross Validation The rolling cross-validation results reveal consistent performance across the five folds. The Mean Squared Error (MSE) values show a gradual decrease from 14.20 in Fold 1 to 9.36 in Fold 5, which may suggest that the model's performance improves as it progresses through different time splits. This trend could indicate that the model benefits from training on progressively larger amounts of data in each fold. The average MSE across all folds is 11.93, closely aligning with the MSE of the retrained model, while the average standard deviation of 2.01 reflects moderate consistency in error across folds. Similarly, the R-squared (R²) scores remain relatively stable, ranging from 0.79 in Fold 1 to 0.83 in Fold 5. The mean R² of 0.8113, accompanied by a low standard deviation of 0.012, indicates that the model explains approximately 81% of the variance in the target variable across folds. This consistency, especially with minimal R² standard deviation, suggests that the model maintains stable explanatory power across different temporal divisions. Overall, these results indicate that the model performs consistently across temporal folds, achieving stable accuracy. The low variation in both MSE and R² scores suggests that the model generalizes well over time, exhibiting minimal fluctuations in performance. IV. CONCLUSION AND FUTURE WORKS This study illustrates the effectiveness of machine learning models, particularly the Random Forest Regressor, as powerful tools for predicting air quality trends in Mandaluyong City, contributing to proactive environmental health management. Leveraging two decades of air quality data from the Humanitarian Data Exchange (HDX), this research successfully forecasts concentrations of key pollutants—SO₂, CO, and PM2.5—addressing the city's need for accurate air quality assessments. The model’s high predictive accuracy, evidenced by low Mean Squared Error (MSE) and strong R2 scores, confirms its ability to capture pollutant trends over time. Through rolling cross-validation, the model’s consistency across multiple folds indicates robust generalizability, even with a slight performance trade-off in the retrained model aimed at reducing overfitting. Visual analyses, including scatter and residual plots, further validated the model’s performance and revealed its limitations, particularly a tendency to underpredict at elevated pollutant levels, such as high concentrations of PM2.5. Overall, this research demonstrates that machine learning models like the Random Forest Regressor, especially when validated through robust methods like rolling crossvalidation, can reliably track and predict pollution trends. These insights support Mandaluyong's public health goals by providing a data-informed foundation for interventions aimed at mitigating pollution-related health risks. The study highlights the potential of AI-driven air quality monitoring to enhance community awareness, support sustainable urban planning, and inform policy decisions to address air quality challenges. For future works, the researchers plan to develop AMIHAN for specific individual vehicle emissions, where, instead of generalized predictions among cities, it can become a tool for mobile vehicle improvements. With a focus on supporting the development of a physical product akin to a
pollutant filter for engine exhaust emissions. Namely in focus on the Philippines’ cultural jeepney. ACKNOWLEDGMENT The researchers would like to express their deepest gratitude to everyone who has contributed to the successful completion of this project. First and foremost, they thank the Lord for His guidance, wisdom, and strength, which have been their foundation throughout this journey. Special appreciation is extended to their professor in Artificial Intelligence, Sir Jefferson Costales, for his invaluable guidance, expertise, and encouragement. The lessons he taught during the course were instrumental in shaping the researchers’ approach to this project, enabling them to apply advanced concepts and techniques effectively. His insights, support, and constructive feedback enhanced the quality of this project. Additionally, the researchers acknowledge the Humanitarian Data Exchange (HDX) and Project CCHAIN for providing the essential dataset that made this project possible. Their commitment to open data has been focal in advancing studies on air quality and public health. Finally, the researchers express their heartfelt gratitude to their families for their unwavering support, patience, and encouragement. This project would not have been possible without the contributions and blessings of everyone mentioned above. REFERENCES [1] Chang, Y., Chiao, H., Abimannan, S., Huang, Y., Tsai, Y., & Lin, K. (2020). An LSTM-based aggregated model for air pollution forecasting. Atmospheric Pollution Research, 11, 1451-1463. https://doi.org/10.1016/j.apr.2020.05.015. [2] Karimi, B., Shokrinezhad, B., & Samadi, S. (2019). Mortality and hospitalizations due to cardiovascular and respiratory diseases associated with air pollution in Iran: A systematic review and metaanalysis. Atmospheric Environment. https://doi.org/10.1016/J.ATMOSENV.2018.10.063. [3] Malashin, I., Tynchenko, V., Gantimurov, A., Nelyub, V., & Borodulin, A. (2023). Applications of Long Short-Term Memory (LSTM) Networks in Polymeric Sciences: A Review. Polymers, 16(18), 2607. https://doi.org/10.3390/polym16182607 [4] United Nations Environment Programme. (n.d.). Philippines: Pollution. UNEP Environmental Data Explorer. Retrieved November 10, 2024, from https://dicf.unepgrid.ch/philippines/pollution [5] United Nations Environment Programme. (n.d.). Philippines: Pollution. UNEP Environmental Data Explorer. Retrieved November 10, 2024, from https://dicf.unepgrid.ch/philippines/pollution [6] Zhan, C., Xie, M., Lu, H., Liu, B., Wu, Z., Wang, T., Zhuang, B., Li, M., & Li, S. (2023). Impacts of urbanization on air quality and the related health risks in a city with complex terrain. Atmospheric Chemistry and Physics. https://doi.org/10.5194/acp-23-771-2023. [7] Zhu, Tongtian. (2020). Analysis on the Applicability of the Random Forest. Journal of Physics: Conference Series. 1607. 012123. 10.1088/1742-6596/1607/1/012123