| The pharmaceutical industry is related to national security and is a strategic industry involving the national economy,people’s livelihood,and economic development.The quality of medical products is also directly related to the physical and mental health of patients,and medical products that are not of sufficient quality will threaten the health of patients.The quality inspection of pharmaceutical products is the basis for ensuring safe medication and the lifeline of the pharmaceutical industry,which is directly related to the national medical security level.In addition,pharmaceutical quality testing is an important part of pharmaceutical production,and it is a necessary process to ensure that pharmaceutical products meet the national pharmacopeia standards.The detection of foreign bodies in liquid medicines is a difficult problem in the process of medical quality inspection.The detection process has many difficulties such as background interference,various types of medicines,and small shapes of foreign objects.These difficulties lead to technical bottlenecks in the feature acquisition of foreign objects in medicine and the detection of foreign objects.At present,deep learning and neural networks are cutting-edge fields of science and technology,and they have demonstrated powerful capabilities in feature extraction and target detection.The paper combines deep learning and convolutional neural networks to conduct research on medical foreign body detection.Firstly,aiming at the problem of excessive background interference in medical foreign body detection,the paper focused on the deep learning detection model based on selective features.Combining RetinaNet and FSAF methods,the paper proposed a medical foreign body detection model based on selective features.The model consists of a feature extraction sub-network,a feature fusion sub-network,and a foreign body detection sub-network.By combining data enhancement methods such as normalization,scale scaling,and random rotation,the model can quickly complete foreign object detection tasks.Secondly,for a variety of types of foreign matter,the paper studied the extraction of foreign bodies features pixel-based adaptive convolution methods.On the basis of pixel-adaptive convolution and residual learning,the paper proposed a feature extraction network based on pixel-adaptive residual block,which can effectively extract foreign object features with content correlation.Thirdly,aiming at the problem of weak foreign body shape,the paper proposed a feature fusion method of weak foreign body based on attention mechanism.Combining the basis of feature pyramid and attention mechanism,the paper researched an attention-weighted feature fusion method and a self-attention-based feature fusion method,which are of great significance for improving the detection accuracy of the detection model.This paper proposes an FSDNet foreign body detection model based on pixel adaptation and multi-scale attention.The average foreign body detection accuracy and missed detection rate of this model can reach 91.2%and 3.6%respectively,which are basically at the same level as other foreign body detection algorithms.In addition,the FSDNet model has a simple network structure and detection process,which can realize end-to-end foreign body detection.The detection speed is improved by orders of magnitude compared with other algorithms.The single detection speed only needs 0.067s,and the model’s processing frames per second can reach 15FPS. |