Alzheimer's disease (AD) is a high-risk and atrophic neurological illness that slowly and gradually destroys brain cells (i.e. neurons). As the most common type of amentia, AD affects 60–65% of all people with amentia and poses major health dangers to middle-aged and elderly people. For classification of AD in the early stage, classification systems and computer-aided diagnostic techniques have been developed. Previously, machine learning approaches were applied to develop diagnostic systems by extracting features from neural images. Currently, deep learning approaches have been used in many real-time medical imaging applications. In this study, two deep neural network techniques, AlexNet and Restnet50, were applied for the classification and recognition of AD. The data used in this study to evaluate and test the proposed model included those from brain magnetic resonance imaging (MRI) images collected from the Kaggle website. A convolutional neural network (CNN) algorithm was applied to classify AD efficiently. CNNs were pre-trained using AlexNet and Restnet50 transfer learning models. The results of this experimentation showed that the proposed method is superior to the existing systems in terms of detection accuracy. The AlexNet model achieved outstanding performance based on five evaluation metrics (accuracy, F1 score, precision, sensitivity and specificity) for the brain MRI datasets. AlexNet displayed an accuracy of 94.53%, specificity of 98.21%, F1 score of 94.12% and sensitivity of 100%, outperforming Restnet50. The proposed method can help improve CAD methods for AD in medical investigations.