Intelligent recognition of narcotic and psychotropic drugs in hospitals is crucial for safety but is challenged by complex real-world conditions such as uneven lighting, occlusions, and reflective packaging. Current deep learning approaches often lack the necessary robustness and precision for this critical medical task. To overcome these limitations, this paper introduces a novel framework featuring three core innovations. Firstly, we propose and validate an optimal multi-stage image preprocessing pipeline: “Gaussian Filtering-Weighted Grayscale Conversion-Single-Scale Retinex,” which maximizes feature clarity under adverse conditions. Secondly, we architecturally enhance the YOLOv8 model by integrating an Adaptive Spatial Feature Fusion (ASFF) module and a novel Hybrid Attention SPPF (HA-SPPF) module, significantly improving its ability to detect fine-grained details like text and seals. Thirdly, we demonstrate the powerful synergistic effect of co-adapting this specialized preprocessing with the optimized network. Evaluated on a comprehensive dataset of 36 drug categories under authentic hospital scenarios, our full framework achieves a remarkable mean Average Precision (mAP50) of 99.31% on a scene-wise partitioned test set. Our approach provides a highly accurate and robust solution for intelligent drug monitoring, establishing a new benchmark for reliable medical object detection in complex, uncontrolled environments.
Liu et al. (Tue,) studied this question.