Power generation systems using photovoltaic (PV) technology have become increasingly popular due to their high production efficiency. A partial shading defect is the most common defect in this system under the process of production, diminishing both the amount and quality of energy produced. This paper proposes an Artificial Neural Network and Golden Eagle Optimization based prediction of the fault and its detection in a standalone PV system to recover the optimum performance and diagnosis of the PV system. The proposed technique combines the Artificial Neural Network (ANN) and Golden Eagle Optimization (GEO) algorithm. The major contribution of this work is to raise PV systems' performance. The result is a defect in the classification and identification of an ANN is used. The use of GEO provides an efficient optimization technique for ANN training, which reduces the training time and improves the accuracy of the model. The proposed technique is executed on the MATLAB site and contrasted with different present techniques, like genetic algorithm (GA),Elephant Herding Optimization (EHO) and Particle Swarm Optimization (PSO). The findings displays that the proposed technique is more accurate and effective than the existing methodologies for detecting and diagnosing defects in PV systems.