In the production process of medical bottles, a large number of bubble will be generated on the surface of the empty bottle body, but the existing methods have various problems in the detection of bubbles on the surface of empty medical bottles such as the week robustness to complex scene changes, and the poor anti noise ability and so on. Aiming to the existed bubble defects on the surface of medical empty bottles, an improved deep learning target detection algorithm RetinaNet is proposed to detect the bubbles on the bottle body. This paper mainly improves the feature pyramid network structure in the original RetinaNet algorithm, and introduces the feature enhance module in the process of the feature fusion, which effectively improves the extraction of semantic features and expands the receptive field of feature maps. In order to reduce the number of parameters and calculation time of the model, considering that the bubbles on the surface of the empty bottle are all small objects, the network structure to detect large objects in the original feature pyramid network is removed, which effectively improves the detection speed. By recombining the standard ResNet50 network, a dilation convolution module is introduced to expand the feature map receptive field and the accuracy of model detection is improved. The proposed method is validated on the empty dataset of injection molding, and the accuracy is 99.72%, the missed rate was 0.12%, the false detection rate was 0.16%, the mAP is 99.49% which is higher by nearly 2.4% compared with the original RetinaNet.