This paper forecasts the hourly AQI in Azamgarh, Uttar Pradesh, India, using deep learning (DL) models. In order to measure hourly particulate matter (PM2.5, PM10), gaseous concentrations (NO2, SO2), and meteorological parameters (temperature, relative humidity, wind direction, wind speed, and UV radiation), a total of 8760 data points were gathered between July 2022 and June 2023. The estimated annual mean hourly AQI was 123, indicating moderate pollution, with higher AQI values in the winter than in the summer. We used a MANOVA to ascertain the statistical significance of changes in PM2.5, PM10, SO2, and NO2 at several time scales, including hourly, daily, weekly, and monthly. Every temporal scale examined by MANOVA showed significant differences in pollutants, with p < 0.001 for hourly (Pillai's Trace = 0.149, F = 383.08), daily (Pillai's Trace = 0.772, F = 7418), weekly (Pillai's Trace = 0.396, F = 1433.1), and monthly (Pillai's Trace = 0.393, F = 1419.2). An ANOVA revealed that there were extremely significant changes every day (F = 170.7, p < 0.001), every week (F = 2270, p < 0.001), and every month (F = 2215, p < 0.001) in addition to the considerable hourly variation (F = 8.612, p = 0.00335). Moreover, the AQI varied significantly over the day and night, as shown by t-tests, with the nighttime mean (135) significantly higher than the daytime mean (111) (t = -11.906, p < 0.001). The hourly AQI was predicted using six deep learning models: Transformer, Gated Recurrent Units (GRU), Convolutional Neural Network (CNN), Feedforward Neural Network (FNN), Long Short-Term Memory (LSTM), and Multi-Layer Perceptron (MLP). The FNN performed better than the other models, with the lowest MAE of 2.89, the lowest RMSE of 4.99, and the greatest R-squared value of 0.9971 with a reasonable processing time of 28 s. A Taylor diagram was used to show how well the models performed in comparison. Sensitivity analysis revealed that PM2.5, NO2 and SO2 have the greatest effects on FNN model forecasts. These findings suggest that FNN has the potential to significantly enhance AQI forecasts and be helpful in developing complex, fine-scale air pollution forecasting models.