Pneumonia is a common and dangerous disease that can lead to death and have significant impacts on public health. Chest X-ray is a non-invasive and widely used diagnostic method for identifying pneumonia. Accurate detection and diagnosis of pneumonia are crucial to ensure timely treatment and prevent the spread of the disease. In this context, deep learning algorithms, especially convolutional neural networks (CNNs), have been applied to identify pneumonia through X-ray images. In this paper, we present the results of using two popular deep learning models, VGG16 and ResNet 50V2, to identify pneumonia in X-ray datasets. The dataset used consists of 5,856 X-ray images, divided into three folders: train (5,216 images), test (624 images), and val (16 images). There are two main categories: Pneumonia (4,273 images) and Normal (1,583 images). The experimental results show impressive performance of these two models in pneumonia identification, with VGG16 achieving 89.1% accuracy and ResNet 50V2 achieving 90.7%. This study provides important insights into the development of effective and high-performance models to improve the diagnosis and treatment process for pneumonia patients in the medical field.