Globalization and automation of logistics and delivery services is accompanied with increasing risks of illegal goods and drugs being smuggled in postal and express packages, falsifying declaration information, and evading customs supervision and crackdown. Focusing on the schemes of drug smuggling through delivery channels, this study adopts the method of semi-supervised learning, using the features extracted from the case data of drug smuggling crimes through postal channels as labels, utilizing a small amount of labeled data and a large amount of unlabeled data for learning and prediction, and carrying out optimization and adjustment to improve accuracy and stability. In particular, the valid fields of 2299 cases data and validation data were obtained through text mining. The study applies four machine learning algorithms (decision tree, multilayer perceptron, support vector machine, and naive Bayes) to accurately predict presence or absence of hidden drugs in parcels sent through postal channels. Furthermore, this article compared and analyzed the specific code implementation from the perspectives of algorithm accuracy, cross-validation accuracy, and code response time.