Stored grain pests detection is essential for grain management. In this paper, we have proposed a machine learning method for stored-grain pest detection. We focus on crustacean pests detection using SVM. The 20 pixels width and 20 pixels height pests and background images are directly utilized for SVM training and classification. According to the experiment results, accuracy of SVM classifier is 99.40%, which outperforms LSSVM and PLS. We then conducted an interesting experiment using synthetic pest images. We employ these synthesized data as pest samples for training SVM classifier. According to the results, the SVM classifier trained via synthetic pest images is able to detect pests in images in some cases because synthetic pest images are quite different from real pest images.