# A Lightweight Barcode Detection Algorithm Based on Deep Learning
## 2 Related Work  
Common barcode recognition technologies can be divided into two types: laser scanner-based and camera-based. The former is mostly used for one-dimensional barcode recognition, with slower recognition speed and shorter device recognition distance. Therefore, this paper only considers camera-based barcode detection. Camera-based detection methods can further be categorized into traditional digital image processing-based and deep learning-based approaches. Initially, researchers employed traditional digital image processing techniques to achieve barcode recognition, yielding some promising research advancements. [PERSON] [8] simplified the image information by setting a gray threshold for the input barcode image and then employed a spiral scanning strategy to precisely locate the critical black bars. By calculating the directions perpendicular to these black bars, they effectively sampled the barcode area. [PERSON] [9] developed a one-dimensional barcode recognition algorithm specifically designed for camera phones and validated its performance on public datasets, achieving an accuracy rate exceeding 90% and demonstrating high robustness against common image distortions. [PERSON] [10] innovatively proposed a barcode detection algorithm combining bottom-hat filtering and morphological operations. They matched potential barcode areas by calculating the Euclidean distances between non-zero pixels, showing significant advantages compared to previous techniques. In recent years, with the excellent accuracy and inference speed demonstrated by deep learning in multiple fields such as drones, road defects, and pedestrian detection [11; 12; 13; 14], more and more researchers have begun to consider applying detection algorithms based on deep learning to barcode detection tasks. [PERSON] [15] adopted a combined strategy integrating the YOLO detection framework with a regression network based on Darknet19 to achieve efficient barcode detection and accurate prediction of orientation angles. Experimental results showed that this integrated method significantly outperformed many previous traditional techniques. [PERSON] [16] designed a two-stage neural network architecture that cleverly integrates the Barcode Region Proposal Network (BRPN) with the barcode detection network, sharing deep convolutional feature maps generated by VGG16 as the core backbone network, optimizing computational resources, and achieving precise barcode detection and reliable orientation angle prediction. [PERSON] [17] modified the Region Proposal Network (RPN) of Faster-RCNN by introducing oriented anchors, enhancing the network's robustness to distorted barcodes and making region predictions more accurate. [PERSON] [18] focused on optimizing the fully connected layers in Faster-RCNN by directly performing bounding box regression on the coordinates of quadrilateral vertices, further improving the accuracy and adaptability of barcode detection results. [PERSON] [19] used the improvedYOLOv4 model and OCR to extract the barcode information and three-segment code of packages, respectively, and the package information recognition rate reached 98.5%, but the experimental sample size was too small and the data set was not open source. Compared to detection methods based on traditional digital image processing, detection methods based on deep learning networks do not need to set threshold parameters that are sensitive to environmental factors, thereby significantly reducing the impact of environmental factors on the practical application of detection methods. However, current deep learning-based detection methods are constrained in their real-world application due to factors such as the high complexity of the algorithms and the need for improvement in detection speed. With advancements in computing devices, the powerful parallel processing capabilities of GPUs can significantly accelerate model training and inference speeds, handling more data and more complex model structures.