The utilization of electroluminescence (EL) imaging has proven to be a reliable and precise method for inspecting photovoltaic (PV) modules, due to its high spatial resolution, which allows for the detection of various types of defects. However, the manual analysis of EL images is both expensive, and time-consuming, and requires a specialist with extensive knowledge to identify a wide range of defects. In this study, we propose a deep learning-based technique for the automatic detection of defective solar cells from EL images. Specifically, we employed two convolutional neural network (CNN) architectures in our proposed framework. The first architecture is a transfer learning-based VGG16 model that has been fine-tuned with custom fully connected neural network layers to classify defective and non-defective solar cells. The second architecture is a lightweight CNN model that was created from scratch and was used as a baseline for classification comparison with the VGG16 fine-tuned model. The models were trained on a publicly available monocrystalline solar cell image dataset. To address overfitting and to increase the dataset size, we utilized data augmentation techniques. Our proposed method achieved a 95.2% accuracy on the test dataset, which is higher than in previous studies. The implementation of our proposed method will enable continuous, rapid, and precise quality inspection of solar PV plants. Proper maintenance of solar PV panels can significantly improve their efficiency, safety, and power output.