In the field of photovoltaic panel defect classification, since traditional defect classification methods and emerging machine learning methods have limitations, which fail to meet the requirements for such classification, more reliable solutions are urgently needed. In recent years, few-shot learning, which can quickly learn from limited data and be generalized to new tasks, has gradually sprung up in various fields, bringing new ideas to the optimization of defect technology. Based on a typical few-shot learning method, the prototypical network method, this study proposes an improved prototypical network-based defect classification method for photovoltaic panels. By complicating the model backbone network, improving the model training mode and adjusting the similarity measurement standard, this method can effectively solve the problems of the poor feature embedding ability and general classification effect of the prototypical network for complex samples. The method has been verified by several comparative experiments on a classic photovoltaic panel defect data set. The results show that the experimental time of the improved method is greatly shortened and the model accuracy is improved.