Due to various factors such as complicated lung imaging and rapidly growing amount of data, the task for imaging technicians is arduous. The emergence of artificial intelligence assisted diagnosis technology comes just in time.To effectively classify lung partial images and alleviate the burden of medical application, a deep learning method based on attention mechanism is therefore developed. The proposed model uses deep learning as the basic integrates Long-Shot term memory (LSTM) the recurrent neural network (RNN). Technology for lung imaging diagnosis based on artificial intelligence has evolved through time from combined diagnosis of multiple diseases to the diagnosis of a single specific disease. The suggested network’s overall classification accuracy, according to experiments, is 95.93%, which is 1.019% greater than that of the deep learning basic network. It also outperforms the VGG16 and VGG19 networks in terms of classification performance. Finally, the benefits and drawbacks of the suggested algorithm are explored, as well as the future development path.