Foreign objects in pharmaceuticals are typically small, which causes difficulty for lightweight algorithms to detect them accurately, while high-performance algorithms often struggle with real-time capability. To balance real-time performance and accuracy, a deep learning distillation algorithm is proposed for the precise and rapid detection of foreign objects in pharmaceutical liquid images. The teacher network incorporates a semantic feature-based upsampling method to enhance the feature disparity between teacher and student networks. In addi...