| In recent years,deep learning methods have risen rapidly and have been a great success in many fields.Compared with traditional methods,deep learning-based methods are better for detection and have obvious advantages in terms of robustness,generalisation and detection speed.To address the problem of inconvenient weighing of trace drugs during quality control,a dataset of trace drugs based on red light conditions was collected and a suitable image preprocessing method is designed and applied to the detection of the round bottom of the drug bottle for the trace drug dataset,using Ondapharmacy photosensitive antibacterial powder as an example.Firstly,the region of interest is extracted from the location of the bottom of the drug bottle,and the regions of the image that are not related to the bottom of the drug bottle are cropped out;secondly,the cropped RGB image is greyed out to reduce the computational effort in the subsequent network model training;finally,the image noise generated during the camera imaging process is removed by an image filter to improve the detection accuracy of the bottom of the drug bottle.The project proposes a deep learning semantic segmentation algorithm combining Res Net-50,FCN and Deformable Conv Nets v2 to improve the detection of the rounded bottom of drug bottles in the trace drug dataset.The algorithm compensates for the features by using jump connections in Res Net-50 and introduces DCNv2 to "deform" the perceptual field to complete the feature extraction of the bottom of the drug bottle,enabling end-to-end detection of the bottom of the drug bottle and improving the accuracy and robustness of the bottom of the drug bottle detection.The algorithm is compared with several other classical semantic segmentation algorithms with the same dataset,environment and network parameters,and the experimental results show that the detection effect of this algorithm is better,and it can effectively improve the detection accuracy of the round bottom of drug bottles,and is also more adaptable to various scenarios than other algorithms.In the trace drug test set,100 images are randomly selected,and the average luminance mean value of these 100 images is used as the luminance threshold.The number of grey scale pixel points of trace drugs in each image and the total number of detected pixel points of the round bottom of the drug bottle were counted,and the grey scale percentage value is derived separately,and the average grey scale percentage value is used as the standard mass of trace drug 2mg,and its error is derived according to the maximum percentage value and the minimum percentage value.The experimental results under the trace drug dataset show that the proposed method can achieve the calculation of trace drug quality,meet the production requirements,and is more rapid,convenient and cost-saving,and has important theoretical and applied research value,which can provide a powerful means for the rapid detection of trace drug quality in the future. |