The problem of haze pollution, mainly caused by delicate particulate matter (PM2.5), is becoming increasingly severe. The coverage of haze weather is constantly expanding, leading to increasing pressure on the urban atmospheric environment. At the same time, it seriously restricts the sustainable development of China's economy and damages the people's health. In response to the problem of poor prediction accuracy of delicate particulate matter (PM2.5) concentration, this work proposes a PM2.5 concentration prediction model based on Whale Optimization Algorithm (WOA) and Attention Mechanism (AM) optimized Bidirectional Long Short Term Memory Network (BiLSTM), namely the WOA-BiLSTM-ATT model. This model can effectively alleviate the problem of gradient vanishing, better adapt to multiple learning tasks and further enable AM to allocate weights to features to achieve the accurate prediction of PM2.5. The empirical results indicate that the stability and prediction accuracy of the WOA-BiLSTM-ATT model are superior to other models.