Highlights An inspection method for grading the appearance of bananas using a target detection algorithm is proposed—by calculating the number and area ratio of different defective areas as a discriminating criterion. The Mish activation function makes the network easier to optimize and improves generalization performance. CustomPAN adds an attention mechanism, optimized for better multi-feature fusion. Optimized loss function in regression task with DIoULoss. Abstract. With the development of the fruit individual packaging industry, the appearance quality of individually packaged fruits has put forward higher requirements. Due to the dense and uneven defects on the surface of bananas, the existing detection algorithms are prone to the problem of unrecognizable or degraded recognition accuracy. In this article, we propose an efficient banana surface defect detection model, the PPYOLO-Banana model. PPYOLO-Banana is based on the PPYOLOE+-m model with improved model structure and loss function, and the optimized CustomPAN can get more multi-level features, and compared with the original network PPYOLOE+-m model, the algorithm significantly improves the accuracy, with an average accuracy improvement of 2.2% (1.3% for the original image test set). mAP of PPYOLO-Banana is 97.0% (96.1% for the original image test set), which is 14.3% higher than the PPYOLOE model, and 10.9%, 8.9%, 8.9%, and 8.1% higher than the YOLOX, YOLOX-tiny, YOLOv5, and YOLOV4 models, respectively. The detection speed of the PPYOLO-Banana model is 17.71 frames per second, which is 2.95, 2.10, 1.90, and 0.98 times higher than that of YOLOv3, YOLOv4, YOLOX, and YOLOX-tiny, respectively. The results show that the proposed PPYOLO-Banana model achieves a balance between accuracy and speed in recognizing banana surface defects, improves the quality detection capability of individually packed fruits, it can effectively grade the quality of banana appearance, and has good potential to become an intelligent sorting machine. Keywords: Banana defect recognition, Banana appearance grading, CustomPAN, DIoULoss, PPYOLOE+.