In the last few years, the development of renewable energies has increased on a large scale. At least, to guarantee the security and stability of the photovolataic system's production, it is imperative that the photovoltaic modules exhibit a high level of reliability. Therefore, the development of an intelligent detection environment to enable the identification of defects in solar cells during manufacturing has become an important issue for the growth of the photovoltaic (PV) sector. This work proposed a fault diagnosis of surface solar cells using deep learning methods for computer vision, using the eighth version of the you only look once (YOLOv8) algorithm. This detection method was applied to a dataset of electroluminescence (EL) images containing twelve PV cell defects on a publicly available heterogeneous background. Then, using this dataset, we trained, validated, and tested the YOLOv8, YOLOv5 models. The results show that YOLOv8 provides a high level of accuracy in fault diagnosis compared with YOLOv5, and also improves the detection speed of the model. Indeed, the average precision achieves 90.5% This suggested approach ensures high accuracy in fault identification which demonstrates the effectiveness of computer vision to identify multi-object cell defects.