# Novel MIA-LSTM Deep Learning Hybrid Model with Data Preprocessing for Forecasting of PM2.5
## 3 Proposed MIA-LSTM Model
### Anomaly Detection and Removal  
Autoencoders have architectural designs such as feed-forward artificial neural networks. Here, one of the hidden layers is a code layer, which has fewer nodes for dimensionality reduction that can be selected by the user. The encoder performs dimensionality reduction whereas the job of the decoder is to get the same output as input (the decoder is a replica image of the encoder). Autoencoders consist of a decoder and encoder in the output and input layer. When both the encoder and decoder are LSTM modules, then these types of autoencoders are said to be an autoencoder LSTM. Thus, LSTM autoencoders use encoder-decoder LSTM \begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **Beijing Multisite Air Quality Data** & **Ghaziabad** \\  & **Dataset** & \\ \hline Dataset Type & Multivariate & Multivariate \\ Time Interval & Hourly & Hourly \\ Monitoring Sites & Aotizhongxin, Gucheng, and & Vasundhara, Ghaziabad \\  & Tiantan & UPPCB \\ Monitoring Period & 1 st March 2013 to 28 th February & 11 January 2017 to 11 \\  & 2017 & December 2021 \\  & 18 (row number, year, month, day, \\  & hour, PM\({}_{2.5}\) concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{SO}_{2}\) & 13 (datetime, PM\({}_{2.5}\) \\  & PM\({}_{10}\) concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{SO}_{2}\) & concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{PM}_{10}\) \\  & concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{NO}_{2}\) & concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{SO}_{2}\) \\  & concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{CO}\) & concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{NO}\), \\  & concentration (\(\mu\)g/m\({}^{3}\)), \(\mathrm{O}_{3}\) & \(\mathrm{NO}_{2}\) and \(\mathrm{NO}_{3}\) concentration \\  & concentration (\(\mu\)g/m\({}^{3}\)), & (\(\mu\)g/m\({}^{3}\)), CO concentration \\  & temperature (degree Celsius), & (\(\mu\)g/m\({}^{3}\)), Ozone concentration \\  & pressure (hP), dew point & (\(\mu\)g/m\({}^{3}\)), temperature (degree \\  & temperature (degree Celsius), & Celsius), relative humidity, \\  & precipitation (mm), wind direction, & wind speed (m/s), name of the air \\  & wind speed (m/s), name of the air \\  & quality monitoring site & \\ Missing values & Aotizhongxin (9.26\%), & \\  & Gucheng (7.3\%), and Tiantan (6.3\%) & Vasundhara (15\%) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Dataset Description. architecture to construct an autoencoder for time series data [62]. An encoder-decoder LSTM is a setup to read an input sequence, replicate it, and recode it for a given dataset of sequences. The model's ability to replicate the input sequence is used to evaluate its performance. The decoder section of the model can be removed after the model has achieved the necessary degree of performance in replicating the sequence except for the encoder model. The input sequences can then be encoded to a fixed-length vector using this paradigm. The method used for the determination of anomalies present in a concentration of PM\({}_{2.5}\) analyzed the training data for MAE loss. The reconstruction error threshold was made equal to the maximum MAE loss value found in the training data. The data points were classified in the test set as an anomaly if the reconstruction loss was higher than the reconstruction error threshold value. Input values were reconstructed by the LSTM autoencoder with MAE values as given in the equations  
\[f_{encoder}\colon\{x^{n}:t\in[1,\,T\,]\}\to z\,t \tag{1}\]  
\[f_{decoder}\colon z\rightarrow\{x^{n}:t\in[1,\,T\,]\} \tag{2}\]  
While applying the proposed method, the meteorological data and pollutant data with n dimensions were transformed by the LSTM model by extracting feature 'z': the hidden layer with the 'z' dimension (less than the dimension of '\(n\)'). Further in the decoding procedure, using the same time steps of 'z', the original data were reconstructed. By this process, the input sequence was taken in time steps from \(t=1\), \(2\), \(3\).