To address the issue of low efficiency and high subjectivity in manual visual inspection of metal insert assembly defects on display backplates,this paper proposes a visual inspection method for detecting assembly defects of metal inserts on display backplates.By using preprocessing techniques,high-quality im-ages of the assembly area are obtained,and the dung beetle optimizer ( DBO) is applied to optimize the two-dimensional Otsu method to segment the inserts.The shape and position features of the inserts are ex-tracted and normalized for fusion,and then input into the DBO-optimized BP neural network for defect rec-ognition.Experimental results show that this method achieves an accuracy of 97.5% on the dataset,and the performance of using DBO-optimized two-dimensional Otsu and BP neural network is superior to the opti-mization using particle swarm optimization ( PSO) and genetic algorithm ( GA) for both segmentation and classification problems.The proposed method can effectively detect assembly defects and is adaptable to factory noise and lighting condition changes,meeting the real-time requirements of enterprise production.