# Applying and Comparing LSTM and ARIMA to Predict CO Levels for a Time-Series Measurements in a Port Area

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

- We produce a dataset whereby the CO is measured at a fixed period of time, in order to utilise it in the LSTM and ARIMA models.
- We devise an LSTM model for values prediction, and we show that the results are close to the actual values when the batch number is 7000.
- We perform a comparison with the ARIMA model, and show that the LSTM accomplishes similar results to the ARIMA, with the ARIMA being better in the forecasting.

## 2. Related Work

## 3. Wireless Environmental Station

## 4. Data Description

## 5. Time Series Prediction Using LSTM and ARIMA

#### 5.1. Recurrent Neural Networks

#### 5.2. LSTM

- Forget gate, which produces a number between 0 and 1, where 1 is used to completely keep the information from the previous timestamp, and 0 implies to completely ignore it.
- Memory gate selects the new data that needs to be stored in the system module. Initially, the input door layer selects the values to be altered. Thereafter, a layer makes a vector of new potential values which could be added to a state.
- Output gate presents the decision on what will be output by each system module. The output value will be based on the state of the system module in conjunction with the filtered and newly added data.

#### Evaluation Metrics

#### 5.3. ARIMA

## 6. Experimental Results

## 7. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- WHO. Air Pollution and Health: Summary. Available online: https://www.who.int/airpollution/ambient/about/en/ (accessed on 23 April 2021).
- Ma, J.; Ding, Y.; Cheng, J.C.; Jiang, F.; Tan, Y.; Gan, V.J.; Wan, Z. Identification of high impact factors of air quality on a national scale using big data and machine learning techniques. J. Clean. Prod.
**2020**, 244, 118955. [Google Scholar] [CrossRef] - Wang, Y.; Bechle, M.J.; Kim, S.Y.; Adams, P.J.; Pandis, S.N.; Pope, C.A., III; Robinson, A.L.; Sheppard, L.; Szpiro, A.A.; Marshall, J.D. Spatial decomposition analysis of NO2 and PM2. 5 air pollution in the United States. Atmos. Environ.
**2020**, 241, 117470. [Google Scholar] [CrossRef] - Zhang, Y.; Yang, X.; Brown, R.; Yang, L.; Morawska, L.; Ristovski, Z.; Fu, Q.; Huang, C. Shipping emissions and their impacts on air quality in China. Sci. Total Environ.
**2017**, 581, 186–198. [Google Scholar] [CrossRef] [PubMed] - An, J.; Lee, K.; Park, H. Effects of a Vessel Speed Reduction Program on Air Quality in port Areas: Focusing on the Big Three ports in South Korea. J. Mar. Sci. Eng.
**2021**, 9, 407. [Google Scholar] [CrossRef] - IMO. IMO 2020: Consistent Implementation of MARPOL Annex VI; International Maritime Organization: Londion, UK, 2019. [Google Scholar]
- Zhou, Y.; Zhang, Y.; Ma, D.; Lu, J.; Luo, W.; Fu, Y.; Li, S.; Feng, J.; Huang, C.; Ge, W.; et al. Port-related emissions, environmental impacts and their implication on green traffic policy in Shanghai. Sustainability
**2020**, 12, 4162. [Google Scholar] [CrossRef] - Shi, W.; Wong, M.S.; Wang, J.; Zhao, Y. Analysis of airborne particulate matter (PM2. 5) over Hong Kong using remote sensing and GIS. Sensors
**2012**, 12, 6825–6836. [Google Scholar] [CrossRef] - Diamantopoulou, M.; Skyllakou, K.; Pandis, S.N. Estimation of the local and long-range contributions to particulate matter levels using continuous measurements in a single urban background site. Atmos. Environ.
**2016**, 134, 1–9. [Google Scholar] [CrossRef] - Liu, J.; Duru, O. Bayesian probabilistic forecasting for ship emissions. Atmos. Environ.
**2020**, 231, 117540. [Google Scholar] [CrossRef] - Cabaneros, S.M.; Calautit, J.K.; Hughes, B.R. A review of artificial neural network models for ambient air pollution prediction. Environ. Model. Softw.
**2019**, 119, 285–304. [Google Scholar] [CrossRef] - Mocerino, L.; Murena, F.; Quaranta, F.; Toscano, D. A methodology for the design of an effective air quality monitoring network in port areas. Sci. Rep.
**2020**, 10, 1–10. [Google Scholar] - Gobbi, G.P.; Di Liberto, L.; Barnaba, F. Impact of port emissions on EU-regulated and non-regulated air quality indicators: The case of Civitavecchia (Italy). Sci. Total Environ.
**2020**, 719, 134984. [Google Scholar] [CrossRef] [PubMed] - Yang, L.; Zhang, Q.; Zhang, Y.; Lv, Z.; Wang, Y.; Wu, L.; Feng, X.; Mao, H. An AIS-based emission inventory and the impact on air quality in Tianjin port based on localized emission factors. Sci. Total Environ.
**2021**, 783, 146869. [Google Scholar] [CrossRef] [PubMed] - Pachoulas, G.; Petsios, S.; Spyrou, E.D.; Stylios, C. An adaptable Web GIS platform for monitoring port air quality. In Proceedings of the 2021 29th Mediterranean Conference on Control and Automation (MED), Saint-Raphael, France, 16–18 September 2020. [Google Scholar]
- Bishop, C.M. Neural Networks for Pattern Recognition; Oxford University Press: Oxford, UK, 1995. [Google Scholar]
- Agarwal, S.; Sharma, S.; Suresh, R.; Rahman, M.H.; Vranckx, S.; Maiheu, B.; Blyth, L.; Janssen, S.; Gargava, P.; Shukla, V.; et al. Air quality forecasting using artificial neural networks with real time dynamic error correction in highly polluted regions. Sci. Total Environ.
**2020**, 735, 139454. [Google Scholar] [CrossRef] [PubMed] - Zhang, K.; Thé, J.; Xie, G.; Yu, H. Multi-step ahead forecasting of regional air quality using spatial-temporal deep neural networks: A case study of Huaihai Economic Zone. J. Clean. Prod.
**2020**, 277, 123231. [Google Scholar] [CrossRef] - Eslami, E.; Salman, A.K.; Choi, Y.; Sayeed, A.; Lops, Y. A data ensemble approach for real-time air quality forecasting using extremely randomized trees and deep neural networks. Neural Comput. Appl.
**2020**, 32, 7563–7579. [Google Scholar] [CrossRef] - Palvanov, A.; Cho, Y.I. Visnet: Deep convolutional neural networks for forecasting atmospheric visibility. Sensors
**2019**, 19, 1343. [Google Scholar] [CrossRef] [Green Version] - Yan, R.; Liao, J.; Yang, J.; Sun, W.; Nong, M.; Li, F. Multi-hour and multi-site air quality index forecasting in Beijing using CNN, LSTM, CNN-LSTM, and spatiotemporal clustering. Expert Syst. Appl.
**2021**, 169, 114513. [Google Scholar] [CrossRef] - Patterson, J.; Gibson, A. Deep Learning: A Practitioner’s Approach; O’Reilly Media, Inc.: Sebastopol, CA, USA, 2017. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] - Suebsombut, P.; Sekhari, A.; Sureephong, P.; Belhi, A.; Bouras, A. Field Data Forecasting Using LSTM and Bi-LSTM Approaches. Appl. Sci.
**2021**, 11, 11820. [Google Scholar] [CrossRef] - Peng, L.; Wang, L.; Xia, D.; Gao, Q. Effective energy consumption forecasting using empirical wavelet transform and long short-term memory. Energy
**2022**, 238, 121756. [Google Scholar] [CrossRef] - Badicu, A.; Suciu, G.; Balanescu, M.; Dobrea, M.; Birdici, A.; Orza, O.; Pasat, A. PMs concentration forecasting using ARIMA algorithm. In Proceedings of the 2020 IEEE 91st Vehicular Technology Conference (VTC2020-spring), Antwerp, Belgium, 25–31 July 2020; pp. 1–5. [Google Scholar]
- Zhang, L.; Lin, J.; Qiu, R.; Hu, X.; Zhang, H.; Chen, Q.; Tan, H.; Lin, D.; Wang, J. Trend analysis and forecast of PM2. 5 in Fuzhou, China using the ARIMA model. Ecol. Indic.
**2018**, 95, 702–710. [Google Scholar] [CrossRef] - Banach, M.; Długosz, R.; Talaśka, T.; Pedrycz, W. Air Pollution Monitoring System with Prediction Abilities Based on Smart Autonomous Sensors Equipped with ANNs with Novel Training Scheme. Remote Sens.
**2022**, 14, 413. [Google Scholar] [CrossRef] - Fabregat, A.; Vázquez, L.; Vernet, A. Using Machine Learning to estimate the impact of ports and cruise ship traffic on urban air quality: The case of Barcelona. Environ. Model. Softw.
**2021**, 139, 104995. [Google Scholar] [CrossRef] - Fahdi, S.; Elkhechafi, M.; Hachimi, H. Machine learning for cleaner production in port of Casablanca. J. Clean. Prod.
**2021**, 294, 126269. [Google Scholar] [CrossRef] - Barua, L.; Zou, B.; Zhou, Y. Machine learning for international freight transportation management: A comprehensive review. Res. Transp. Bus. Manag.
**2020**, 34, 100453. [Google Scholar] [CrossRef] - Xie, Y.; Huynh, N. Kernel-based machine learning models for predicting daily truck volume at seaport terminals. J. Transp. Eng.
**2010**, 136, 1145–1152. [Google Scholar] [CrossRef] - RAM. SENSIT. Available online: https://www.gasleaksensors.com/instruction-manuals/SENSIT-RAMP-Instruction-Manual.pdf (accessed on 23 April 2021).
- Siami-Namini, S.; Tavakoli, N.; Namin, A.S. A comparison of ARIMA and LSTM in forecasting time series. In Proceedings of the 2018 17th IEEE International Conference on Machine Learning and Applications (ICMLA), Orlando, FL, USA, 17–20 December 2018; pp. 1394–1401. [Google Scholar]
- Box, G.E.P.; Jenkins, G.M.; Reinsel, G.C.; Ljung, G.M. Time Series Analysis: Forecasting and Control; John Wiley & Sons: Hoboken, NJ, USA, 2015. [Google Scholar]
- Vijaykumar Dhameliya. 2019. Available online: https://github.com/dhamvi01/Multivariate-Time-Series-Using-LSTM (accessed on 23 April 2021).
- Dickey, D.A.; Fuller, W.A. Distribution of the estimators for autoregressive time series with a unit root. J. Am. Stat. Assoc.
**1979**, 74, 427–431. [Google Scholar] - Kolios, S.; Vorobev, A.V.; Vrobeva, G.; Stylios, C. GIS and environmental monitoring. In Applications in the Marine, Atmospheric and Geomagnetic Fields; Springer International Publishing AG: Cham, Switzerland, 2017. [Google Scholar]
- Stylios, C.; Marinski, J.; Floqi, T.; Damiani, L. Sustainable development of seacorridors and coastal waters. In The TEN ECOPORT Project in South East Europe; Springer: Cham, Switzerland, 2015; ISBN 978-3-319-11384-5. [Google Scholar]
- Kortcheva, A.; Galabov, V.; Marinski, J.; Andrea, V.; Stylios, C. New approaches and mathematical models for environmental risk management in seaports. In Proceedings of the TECIS 2018, 18th International Federation of Automatic Control Conference on Technology Culture & International Stability, Baku, Azerbaijan, 13–15 September 2018; pp. 366–371. [Google Scholar]
- Pikoulis, E.V.; Mavrokefalidis, C.; Nousias, S.; Lalos, A.S. A new clustering-based technique for the acceleration of deep convolutional networks. In Deep Learning Applications; Springer: Berlin/Heidelberg, Germany, 2022; Volume 3, pp. 123–150. [Google Scholar]
- Pikoulis, E.V.; Mavrokefalidis, C.; Lalos, A.S. A data-aware dictionary-learning based technique for the acceleration of deep convolutional networks. In Proceedings of the 2021 IEEE 23rd International Workshop on Multimedia Signal Processing (MMSP), Tampere, Finland, 6–8 October 2021; pp. 1–5. [Google Scholar]

Metric | Value |
---|---|

Test Statistic | −12.2965 |

p-value | 0.0000 |

Lags Used | 12.0000 |

Critical Value (1%) | −3.4322 |

Critical Value (5%) | −2.8624 |

Critical Value (10%) | −2.5672 |

Number of Batches | |||
---|---|---|---|

100 | 1000 | 7000 | |

Train MAE | 57.21248041152757 | 60.34714927690382 | 10.869020548775927 |

Train RMSE | 135.27171651469044 | 108.08156944244062 | 87.87709345147564 |

Test MAE | 49.284213431742664 | 70.8143694844377 | 4.640554866524584 |

Test RMSE | 52.16111599740313 | 74.90565143407075 | 7.078313259118829 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Spyrou, E.D.; Tsoulos, I.; Stylios, C.
Applying and Comparing LSTM and ARIMA to Predict CO Levels for a Time-Series Measurements in a Port Area. *Signals* **2022**, *3*, 235-248.
https://doi.org/10.3390/signals3020015

**AMA Style**

Spyrou ED, Tsoulos I, Stylios C.
Applying and Comparing LSTM and ARIMA to Predict CO Levels for a Time-Series Measurements in a Port Area. *Signals*. 2022; 3(2):235-248.
https://doi.org/10.3390/signals3020015

**Chicago/Turabian Style**

Spyrou, Evangelos D., Ioannis Tsoulos, and Chrysostomos Stylios.
2022. "Applying and Comparing LSTM and ARIMA to Predict CO Levels for a Time-Series Measurements in a Port Area" *Signals* 3, no. 2: 235-248.
https://doi.org/10.3390/signals3020015