In the light of the problems existed in selecting the parameters of LSSVM model in the process of defect detection, The Improved Gravitational Search Algorithm (IGSA) is brought in and applied to optimize the model parameters of LSSVM. The algorithm overcomes the shortcoming of standard GSA that is easy to fall into local optimum and has low accuracy and effectively improves the exploration ability and development ability of GSA. Experiments are carried out on the data sets from the UCI database, Compared with cross-validation, standard GSA, Genetic Algorithm and Particle Swarm Optimization, the IGSA has the better classification accuracy and generalization ability. Finally,this model is applied to the label defect detection with a good result.