Logistics label identification method, device and equipment and storage medium

CN122990709APending Publication Date: 2026-10-27SHANGHAI DONGPU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610951390.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0002]随着智慧物流行业高速发展,包裹分拣、出入库核验、物流信息追踪等环节均依赖物流面单信息自动识别,传统人工录入方式效率低下、人工差错率高,已无法适配自动化物流流水线的作业需求

Benefits of technology

[0015]本发明提供的技术方案中,根据DBNet、SVTR及条码解码三大算法搭建一体化基础识别模型,可同步完成面单文本检测、高精度文本识别与条码解码,实现文字与条码信息的协同识别,解决传统模型文本、条码拆分识别导致的信息错位问题;同时在基础识别模型输入端增设图像增强模块,提前修复现场采集的低质量面单图像,消除光照、褶皱、污渍等环境干扰,从源头降低图像缺陷带来的识别误差;在基础识别模型输出端配套文本与条码纠错模块,针对基础识别模型识别产生的字符错误、条码解码偏差进行智能校验修正,进一步压缩识别错误率,能够有效提升复杂现场下面单识别的准确率与稳定性,兼顾识别速度与识别精度,适配物流分拣、仓储出入库等全场景实时识别需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990709A_ABST
    Figure CN122990709A_ABST
Patent Text Reader

Abstract

The present application relates to the field of logistics, and discloses a logistics waybill identification method, device, equipment and storage medium, the method is used for improving the identification accuracy of the logistics waybill, comprising: obtaining historical logistics waybill images, labeling the historical logistics waybill images to construct a training data set; constructing a basic identification model based on the DBNet algorithm, the SVTR algorithm and the barcode decoding algorithm; constructing an image enhancement module and a text and barcode error correction module, connecting the image enhancement module in front of the input end of the basic identification model, and connecting the text and barcode error correction module at the output end of the basic identification model to obtain a to-be-trained model; training the to-be-trained model using the training data set to obtain a waybill identification model; obtaining a to-be-identified waybill image in real time, inputting the to-be-identified waybill image into the waybill identification model to obtain a waybill identification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of logistics, and in particular to a method, apparatus, equipment and storage medium for identifying logistics waybills. Background Technology

[0002] With the rapid development of the smart logistics industry, parcel sorting, inbound and outbound verification, and logistics information tracking all rely on the automatic identification of logistics waybill information. Traditional manual data entry methods are inefficient and have a high rate of human error, and can no longer meet the operational needs of automated logistics lines. Current mainstream OCR waybill recognition solutions still suffer from several industry pain points: First, waybill images collected at logistics sites generally suffer from uneven lighting, wrinkles, reflections, stains, and tilted angles, resulting in poor original image quality and a significant decrease in text and barcode recognition accuracy. Second, existing recognition models mostly employ text detection or text recognition algorithms alone, failing to address the multiple requirements of accurate text region detection, long text recognition, and barcode decoding. Text recognition and barcode recognition are independent of each other, easily leading to information mismatch issues. Third, the output results of basic recognition models contain inherent errors such as character misidentification and barcode decoding deviations, lacking post-correction mechanisms. Even minor recognition errors can directly cause incorrect order sorting and data entry errors. Fourth, existing recognition models have poor adaptability to various types of logistics waybills, and lack robustness in recognizing differentiated waybills from different courier companies. In summary, existing logistics waybill recognition technologies suffer from weak image anti-interference capabilities, poor multi-information collaborative recognition capabilities, and a lack of error correction mechanisms, making it difficult to meet the high-precision, high-stability real-time recognition requirements of complex logistics sites.

[0003] Therefore, existing technologies need further development and improvement. Summary of the Invention

[0004] This invention provides a method, apparatus, device, and storage medium for identifying logistics waybills, which can improve the accuracy of logistics waybill identification.

[0005] The first aspect of this invention provides a logistics waybill recognition method, comprising: acquiring historical logistics waybill images; annotating the historical logistics waybill images to construct a training dataset; constructing a basic recognition model based on the DBNet algorithm, SVTR algorithm, and barcode decoding algorithm; constructing an image enhancement module and a text and barcode error correction module, connecting the image enhancement module to the input end of the basic recognition model, and connecting the text and barcode error correction module to the output end of the basic recognition model to obtain a model to be trained; training the model to be trained using the training dataset to obtain a waybill recognition model; acquiring a waybill image to be recognized in real time, inputting the waybill image to be recognized into the waybill recognition model, and obtaining a waybill recognition result.

[0006] Optionally, in a first implementation of the first aspect of the present invention, the step of acquiring historical logistics waybill images and annotating the historical logistics waybill images to construct a training dataset includes: acquiring multiple historical logistics waybill images under normal conditions and under image degradation conditions; performing training text region labeling and training code image region labeling on each of the historical logistics waybill images to obtain multiple annotated waybill images; and constructing a training dataset based on all the annotated waybill images.

[0007] Optionally, in a second implementation of the first aspect of the present invention, the construction of the basic recognition model based on the DBNet algorithm, the SVTR algorithm, and the barcode decoding algorithm includes: constructing a text detection module based on the DBNet algorithm, wherein the text detection module is used to perform text region detection and barcode image region detection on the input image, and output the text region coordinates and barcode image region coordinates; constructing a region cropping unit, wherein the region cropping unit is used to crop a text region image from the input image according to the text region coordinates, and to crop a barcode image region image from the input image according to the barcode image region coordinates; constructing a text recognition module based on the SVTR algorithm, wherein the text recognition module is used to perform character sequence recognition on the text region image and output the text recognition result; constructing a barcode decoding module based on the ZBar barcode decoding algorithm, wherein the barcode decoding module is used to decode the barcode image region image to obtain the decoding result; connecting the output of the text detection module to the input of the region cropping unit, and connecting the output of the region cropping unit to the input of the text recognition module and the input of the barcode decoding module respectively, thereby constructing the basic recognition model.

[0008] Optionally, in a third implementation of the first aspect of the present invention, the text detection module based on the DBNet algorithm includes: constructing a feature extraction backbone network based on a convolutional neural network, and configuring the number of layers and parameters of the feature extraction backbone network, wherein the feature extraction backbone network is used to extract multi-scale feature maps from the input image; and cascading a dual-branch detection head after the feature extraction backbone network, wherein the dual-branch detection head includes a text detection branch and a code image detection branch set in parallel, wherein both the text detection branch and the code image detection branch include a probability map prediction unit and a threshold map prediction unit set in parallel, wherein the probability map prediction unit is used to generate a probability map of the corresponding category based on the multi-scale feature map. The threshold map prediction unit is used to generate a threshold map for the corresponding category based on the multi-scale feature map; a first differentiable binarization unit and a second differentiable binarization unit are constructed, the input of the first differentiable binarization unit is connected to the output of the probability map prediction unit and the threshold map prediction unit in the text detection branch, and the input of the second differentiable binarization unit is connected to the output of the probability map prediction unit and the threshold map prediction unit in the code map detection branch, so as to construct a text detection module. The first differentiable binarization unit and the second differentiable binarization unit are used to perform differentiable binarization processing on the probability map and threshold map of the corresponding branch, and generate and output the region bounding box coordinates of the corresponding category.

[0009] Optionally, in a fourth implementation of the first aspect of the present invention, the construction of an image enhancement module and a text and barcode error correction module, connecting the image enhancement module to the input end of the basic recognition model, and connecting the text and barcode error correction module to the output end of the basic recognition model to obtain a model to be trained, includes: constructing an image enhancement module, which is used to perform at least one preprocessing operation on the input image, namely brightness adjustment, contrast adjustment, sharpness enhancement, and noise removal; constructing a text and barcode error correction module, which is used to receive the text recognition result output by the text recognition module and the decoding result output by the barcode decoding module, and to perform consistency verification between the two. If the verification is inconsistent, the confidence level and preset rules are combined to perform fusion error correction, and the verified and corrected label recognition result is output; connecting the output end of the image enhancement module to the input end of the text detection module and the input end of the region cropping unit, respectively, and connecting the output end of the text recognition module and the output end of the barcode decoding module to the input end of the text and barcode error correction module, respectively, to obtain a model to be trained.

[0010] Optionally, in a fifth implementation of the first aspect of the present invention, training the model to be trained using the training dataset to obtain a waybill recognition model includes: inputting historical logistics waybill images from the training dataset into the model to be trained; performing forward inference after preprocessing by the image enhancement module; outputting predicted region coordinates through the text detection module; outputting text recognition results through the text recognition module; and outputting decoding results through the barcode decoding module; obtaining the annotation information of the training dataset as supervision information; calculating a first loss based on the difference between the text region coordinates in the predicted region coordinates and the training text region coordinates; calculating a second loss based on the difference between the barcode image region coordinates in the predicted region coordinates and the training barcode image region coordinates; calculating a third loss based on the difference between the text recognition results and the training text content labels; weighted summing of the first loss, the second loss, and the third loss to obtain a comprehensive loss value; updating the parameters of the text detection module and the text recognition module based on the comprehensive loss value through backpropagation; iterating until the model converges to obtain the waybill recognition model.

[0011] Optionally, in the sixth implementation of the first aspect of the present invention, the step of acquiring the image of the waybill to be identified in real time and inputting the image of the waybill to be identified into the waybill recognition model to obtain the waybill recognition result includes: acquiring the image of the logistics waybill to be identified in real time and inputting the image of the logistics waybill to be identified into the waybill recognition model; the waybill recognition model first preprocesses the input image through the image enhancement module to obtain an enhanced image, locates the coordinates of the text region to be identified and the coordinates of the code image region to be identified in the enhanced image through the text detection module, and crops the text region image and the code image region image to be identified from the enhanced image through the region cropping unit; then, the text region image to be identified is identified by the text recognition module to obtain a text recognition result, and the code image region image to be identified is decoded by the barcode decoding module to obtain a decoding result; finally, the text and barcode error correction module performs consistency verification on the text recognition result and the decoding result, and when the verification is inconsistent, it performs fusion error correction by combining confidence and preset rules, and outputs the waybill recognition result after verification and error correction; abnormal results that still do not meet the verification conditions after error correction are marked.

[0012] A second aspect of the present invention provides a logistics waybill recognition device, comprising: an acquisition module for acquiring historical logistics waybill images and annotating the historical logistics waybill images to construct a training dataset; a first construction module for constructing a basic recognition model based on the DBNet algorithm, the SVTR algorithm, and a barcode decoding algorithm; a second construction module for constructing an image enhancement module and a text and barcode error correction module, connecting the image enhancement module to the input end of the basic recognition model and connecting the text and barcode error correction module to the output end of the basic recognition model to obtain a model to be trained; a training module for training the model to be trained using the training dataset to obtain a waybill recognition model; and a recognition module for acquiring a waybill image to be recognized in real time, inputting the waybill image to be recognized into the waybill recognition model, and obtaining a waybill recognition result.

[0013] A third aspect of the present invention provides a logistics waybill identification device, comprising: a memory and at least one processor, wherein the memory stores computer-readable instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the computer-readable instructions in the memory to cause the logistics waybill identification device to perform the various steps of the logistics waybill identification method described above.

[0014] A fourth aspect of the present invention provides a computer-readable storage medium storing computer-readable instructions that, when executed on a computer, cause the computer to perform the various steps of the logistics waybill identification method described above.

[0015] The technical solution provided by this invention establishes an integrated basic recognition model based on three major algorithms: DBNet, SVTR, and barcode decoding. This model can simultaneously perform label text detection, high-precision text recognition, and barcode decoding, achieving collaborative recognition of text and barcode information and solving the information misalignment problem caused by the separate recognition of text and barcode in traditional models. Simultaneously, an image enhancement module is added to the input end of the basic recognition model to pre-correct low-quality label images collected on-site, eliminating environmental interference such as lighting, wrinkles, and stains, thus reducing recognition errors caused by image defects at the source. A text and barcode error correction module is provided at the output end of the basic recognition model to intelligently verify and correct character errors and barcode decoding deviations generated by the basic recognition model, further reducing the recognition error rate. This effectively improves the accuracy and stability of label recognition in complex on-site environments, balancing recognition speed and accuracy, and adapting to real-time recognition needs across all scenarios such as logistics sorting and warehousing inbound / outbound operations. Attached Figure Description

[0016] Figure 1 This is a first flowchart of a logistics waybill recognition method provided in an embodiment of the present invention; Figure 2This is a second flowchart of the logistics waybill identification method provided in an embodiment of the present invention; Figure 3 This is a third flowchart of the logistics waybill identification method provided in the embodiments of the present invention; Figure 4 This is a fourth flowchart of the logistics waybill identification method provided in the embodiments of the present invention; Figure 5 The fifth flowchart of the logistics waybill identification method provided in the embodiments of the present invention; Figure 6 The sixth flowchart of the logistics waybill identification method provided in the embodiments of the present invention; Figure 7 This is a schematic diagram of the structure of the logistics waybill recognition device provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of the logistics waybill recognition device provided in an embodiment of the present invention. Detailed Implementation

[0017] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0018] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of a logistics waybill identification method in this invention includes: S101. Obtain historical logistics waybill images and perform annotation processing on the historical logistics waybill images to construct a training dataset.

[0019] It is understood that the executing entity of this invention can be a logistics waybill recognition device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.

[0020] In this embodiment, image samples of barcode labels covering various actual working conditions are collected. This includes not only images with normal lighting and clear, complete images, but also samples under deteriorating conditions (including uneven lighting, localized dirt, folds and wrinkles, and blurred images). Each image is finely annotated, including text region coordinates, barcode region coordinates, text content labels, and barcode encoding content labels. These annotations are designed to correspond to the ground truth of the probability map (region coordinate transformation) required by the subsequent DBNet detection branch, the sequence supervision signal (text content) required by the SVTR recognition module, and the verification benchmark (encoded content) for barcode decoding, respectively, laying a data foundation for multi-task joint training.

[0021] S102. Construct a basic recognition model based on the DBNet algorithm, SVTR algorithm, and barcode decoding algorithm.

[0022] In this embodiment, the basic recognition model can achieve detection, recognition, and decoding. Detection is achieved through the DBNet algorithm, which extracts multi-scale features through a convolutional backbone network, predicts a probability map (the probability that a pixel belongs to text / code image) and a threshold map (adaptive binary threshold) in parallel, and fuses the two through a differentiable sigmoid approximation step function to achieve end-to-end adaptive threshold detection. Recognition is achieved through the SVTR algorithm, which decomposes image text into character components and completes character recognition through a hierarchical strategy of local mixing (sliding window attention to capture stroke details) and global mixing (multi-head self-attention modeling inter-character dependencies). Decoding is achieved through the ZBar algorithm, which employs a unique linear scanning decoding strategy, treating the barcode as a signal of bright and dark stripes for real-time scanning and data assembly.

[0023] S103. Construct an image enhancement module and a text and barcode error correction module, connect the image enhancement module to the input end of the basic recognition model, and connect the text and barcode error correction module to the output end of the basic recognition model to obtain the model to be trained.

[0024] In this embodiment, an image enhancement module is connected to the front end of the basic recognition model. The image enhancement module performs preprocessing such as brightness adjustment, contrast stretching, sharpening, and noise reduction. A text and barcode error correction module is connected to the back end. The text and barcode error correction module uses the information redundancy of the label text and barcode for cross-validation. When inconsistencies are found, it combines confidence and verification rules for fusion error correction. The image enhancement module, the basic recognition model, and the text and barcode error correction module are connected sequentially to form the model to be trained.

[0025] S104. Use the training dataset to train the model to be trained to obtain the waybill recognition model.

[0026] In this embodiment, the training image is input into the model to be trained to perform forward inference. With the annotation information as supervision, the text detection loss, code image detection loss and text recognition loss are jointly calculated. After weighted summation, the parameters are iteratively updated through backpropagation until convergence, thus obtaining the waybill recognition model.

[0027] S105. Acquire the image of the waybill to be identified in real time, input the image of the waybill to be identified into the waybill recognition model, and obtain the waybill recognition result.

[0028] In this embodiment, the system interfaces with image acquisition equipment at the logistics site, configuring image acquisition frame rate and triggering mechanism. When a package passes the recognition station, it automatically triggers image capture, acquiring the original image of the waybill to be recognized in real time. Upon receiving the waybill image, it is input into the deployed waybill recognition model, which automatically executes the processing flow fixed during the training phase. First, the image enhancement module performs standardized preprocessing on the original image to eliminate image degradation caused by factors such as ambient lighting and shooting angle. Then, the basic recognition model completes the location, cropping, and decoding of text and barcode areas. Finally, the error correction module performs consistency verification and intelligent correction on the recognition results. After processing, the waybill recognition model outputs structured waybill recognition results, including all fields such as recipient information, sender information, and waybill number. This can be directly interfaced with downstream business systems such as logistics sorting systems and warehouse management systems to achieve automated input and retrieval of waybill information.

[0029] This embodiment provides a logistics waybill recognition method. It builds an integrated basic recognition model based on three algorithms: DBNet, SVTR, and barcode decoding. This model can simultaneously perform waybill text detection, high-precision text recognition, and barcode decoding, achieving collaborative recognition of text and barcode information. This solves the information misalignment problem caused by the separate recognition of text and barcode in traditional models. Simultaneously, an image enhancement module is added to the input end of the basic recognition model to pre-correct low-quality waybill images collected on-site, eliminating environmental interference such as lighting, wrinkles, and stains, reducing recognition errors caused by image defects at the source. A text and barcode error correction module is provided at the output end of the basic recognition model to intelligently verify and correct character errors and barcode decoding deviations generated by the basic recognition model, further reducing the recognition error rate. This effectively improves the accuracy and stability of waybill recognition in complex on-site environments, balancing recognition speed and accuracy, and adapting to real-time recognition needs in all scenarios such as logistics sorting and warehousing inbound / outbound operations.

[0030] Please see Figure 2 The second embodiment of the logistics waybill identification method in this invention includes: S201. Obtain multiple historical logistics waybill images under normal conditions and under image degradation conditions.

[0031] In this embodiment, normal-state waybill image samples are exported from the historical business systems of logistics companies. High-quality waybill images that are clearly printed, undamaged, and taken at a correct angle are selected, covering standard waybill formats from different courier companies, as well as waybill types of different sizes and materials, encompassing both electronic and paper waybills to ensure the diversity of normal samples. Subsequently, deteriorated condition samples are supplemented through two methods: on-site shooting and manual simulation. On-site shooting involves collecting waybill images from actual workstations such as logistics sorting lines and warehouse entry points under real working environments, retaining realistic degradation effects such as uneven lighting, tilted shooting, and motion blur. Manual simulation involves adding degradation effects such as wrinkles, stains, reflections, low resolution, and noise to normal waybill images using algorithms to simulate different degrees of image damage. The two types of deteriorated samples complement each other, ensuring comprehensive coverage of deteriorated conditions and conformity to real-world scenarios. Finally, they are mixed according to a preset ratio to form a complete historical waybill image library.

[0032] S202. Training text region labeling and training code image region annotation are performed on each of the historical logistics waybill images to obtain multiple labeled waybill images.

[0033] In this embodiment, a unified annotation standard is established, clarifying the annotation rules for two types of regions: the training text region is marked with a four-point polygonal box, the selected area completely encompassing all valid characters on the waybill, covering all text fields such as recipient information, sender information, address, contact information, and waybill number, ensuring that the polygonal box fits the text edge and avoiding redundant background or missing characters; the training barcode image region is marked with a rectangular box, completely encompassing the barcode graphic, covering all barcode image types such as one-dimensional barcodes and two-dimensional barcodes, with a small amount of pixel margin between the rectangular box and the barcode edge to avoid truncating the barcode image edge. Subsequently, for each historical waybill image, the bounding boxes for all text regions and barcode image regions are sequentially completed, the coordinate information of the corresponding region is automatically generated, and the marked coordinates are bound and stored with the original image to form a one-to-one corresponding annotated waybill image. After the annotation is completed, cross-validation is performed to check the completeness and accuracy of the region bounding boxes, correcting problems such as missing labels, incorrect labels, and coordinate offsets, ensuring that the annotation accuracy of all annotated waybill images meets the training requirements. S203, Construct a training dataset based on all the annotated waybill images.

[0034] S202. Construct a training dataset based on all the labeled faceplate images.

[0035] In this embodiment, standardized preprocessing is performed on all labeled label images: the image format and color space are unified, all images are adjusted to the standard resolution adapted to the model, and the coordinates of the labeled regions are normalized and converted into relative coordinates relative to the image width and height to eliminate the impact of size differences on training. Subsequently, all labeled label images are randomly divided into training, validation, and test subsets according to a preset ratio. During the partitioning process, the distribution of normal and degraded samples, as well as different label layouts, is ensured to be balanced across subsets to avoid scene shifts. To further expand the sample size and improve the model's generalization ability, online data augmentation strategies are configured for the training subset. During training, random angle rotation, random cropping, color perturbation, and affine transformations are performed on the samples to enrich sample features without changing the ground truth. Finally, all processed samples are packaged into a dataset format supported by the model training framework, and a sample index file and annotation documentation are generated to complete the construction of the training dataset.

[0036] In this embodiment, by adding shipping label samples under degraded image conditions, common image degradation types in logistics sites such as wrinkles, stains, reflections, blurring, and tilting are covered. This avoids the problem of model overfitting to ideal scenarios and a sharp drop in on-site performance caused by training with only normal samples. It allows the model to learn the features of degraded images during the training phase, thereby improving the recognition stability under complex working conditions.

[0037] Please see Figure 3 A third embodiment of a logistics waybill identification method according to the present invention includes: S301. A text detection module is constructed based on the DBNet algorithm. The text detection module is used to perform text region detection and code image region detection on the input image, and output the text region coordinates and code image region coordinates.

[0038] In this embodiment, a text detection module based on the DBNet algorithm is constructed, including: constructing a feature extraction backbone network based on a convolutional neural network, and configuring the number of layers and parameters of the feature extraction backbone network, which is used to extract multi-scale feature maps from the input image; a dual-branch detection head is cascaded after the feature extraction backbone network, the dual-branch detection head including a text detection branch and a code image detection branch set in parallel, both the text detection branch and the code image detection branch including a probability map prediction unit and a threshold map prediction unit set in parallel, the probability map prediction unit being used to generate a probability map of the corresponding category based on the multi-scale feature maps, and the threshold map prediction unit being used to generate a probability map of the corresponding category based on the multi-scale feature maps. A threshold map for the corresponding category is generated based on the multi-scale feature map; a first differentiable binarization unit and a second differentiable binarization unit are constructed. The input of the first differentiable binarization unit is connected to the output of the probability map prediction unit and the threshold map prediction unit in the text detection branch, and the input of the second differentiable binarization unit is connected to the output of the probability map prediction unit and the threshold map prediction unit in the code map detection branch, so as to construct a text detection module. The first differentiable binarization unit and the second differentiable binarization unit are used to perform differentiable binarization processing on the probability map and threshold map of the corresponding branch, and generate and output the region bounding box coordinates of the corresponding category.

[0039] Understandably, the DBNet (Differentiable Binarization Network) algorithm is a segmentation-based text detection algorithm. Its core innovation lies in embedding the binarization operation, which is a post-processing step in traditional text detection, into the neural network, making it differentiable.

[0040] In this embodiment, ResNet series residual networks are selected as the basic architecture of the backbone network. Their residual connection structure addresses the gradient vanishing problem in deep networks, ensuring both network depth and feature extraction capabilities. Based on the image features and detection accuracy requirements of logistics waybills, the number of layers and channel parameters of the backbone network are configured, and a network structure of appropriate depth is selected to achieve a balance between accuracy and speed. Simultaneously, weight parameters pre-trained on large-scale public datasets are loaded for initialization to accelerate model convergence and improve training performance in small-sample scenarios. A feature pyramid structure is introduced into the backbone network to upsample and fuse feature maps output from different levels, generating multi-scale feature maps that include low-level detail information and high-level semantic information. Different scale feature maps correspond to detection targets of different sizes. The final backbone network can simultaneously capture the overall semantic features of large-size barcodes and the edge detail features of small-size text, providing sufficient feature support for subsequent dual-branch detection.

[0041] In this embodiment, after the multi-scale feature map output by the backbone network, two structurally consistent detection branches are built in parallel: a text detection branch and a barcode image detection branch, corresponding to the text category and the barcode image category, respectively. The two branches share backbone features but perform prediction calculations independently, thus reusing the feature extraction results and decoupling the two target detection tasks. Each detection branch contains two parallel prediction units: a probabilistic map prediction unit and a threshold map prediction unit. The probabilistic map prediction unit performs further feature transformation and channel compression on the feature map through convolutional layers, outputting a single-channel probabilistic map where the value of each pixel represents the probability of belonging to the corresponding category. The threshold map prediction unit uses a similar convolutional structure to output a single-channel threshold map where the value of each pixel represents the binarized threshold at that location. To address the feature differences between text and barcode images, the convolutional kernel parameters and loss weights of the two branches are configured differently to adapt to the different characteristics of blurred text edges and regular barcode edges, ultimately outputting pixel-level prediction results for the corresponding category.

[0042] In this embodiment, independent differentiable binarization units are configured for the two detection branches, namely, a first differentiable binarization unit and a second differentiable binarization unit. Each differentiable binarization unit receives the probability map and threshold map of the corresponding branch as input, and uses a differentiable sigmoid approximation function to perform binarization calculation, replacing the traditional step function binarization. This makes the binarization process differentiable and can be incorporated into the backpropagation training of the network. After the binarization calculation is completed, a binary segmentation map of the corresponding category is obtained, which is used to clearly distinguish the target region from the background region. Subsequently, contour extraction and post-processing operations are performed on the binary segmentation map. All target regions are found through connected component analysis, the minimum bounding rectangle or polygon box of each region is calculated, and the corresponding region boundary box coordinates are generated. At the same time, invalid detection boxes with too small an area or too low confidence are filtered out. Finally, the text region coordinates and code image region coordinates output from the two branches are integrated and formatted into the final output of the detection module. This results in better segmentation of targets with uneven lighting and blurred edges, and higher positioning accuracy.

[0043] S302. Construct a region cropping unit, which is used to crop a text region image from the input image according to the text region coordinates, and to crop a code image region image from the input image according to the code image region coordinates.

[0044] In this embodiment, the region cropping unit includes a coordinate analysis subunit and an image cropping subunit. The coordinate analysis subunit receives the text region coordinates and code image region coordinates output by the text detection module, performs a validity check on the coordinates, and removes invalid detection boxes that exceed the image boundaries or are too small. Simultaneously, it performs perspective transformation correction on tilted text regions, straightening the tilted text into horizontal text, thus improving the accuracy of subsequent text recognition. Based on the verified coordinate information, the image cropping subunit crops sub-images of each text region and code image region from the corresponding positions in the original input image, generating a cropped image for each region separately. During the cropping process, according to the input requirements of the text recognition module, the cropped images undergo size standardization: the text region images have a uniform height and adaptive width; the code image region images are adjusted to a fixed resolution and simultaneously subjected to grayscale processing to adapt to the input requirements of barcode decoding, ultimately outputting a batch of standardized region images.

[0045] S303. A text recognition module is constructed based on the SVTR algorithm. The text recognition module is used to perform character sequence recognition on text region images and output the text recognition results.

[0046] Understandably, the SVTR (Scene Visual Text Recognition) algorithm is a Transformer-based single-vision model scene text recognition algorithm. Unlike the traditional dual-module architecture of CNN feature extraction combined with RNN sequence modeling, SVTR decomposes image text into several small blocks called character components. Then, through hierarchical component-level mixing, merging, and combining operations, it gradually perceives the stroke features within characters and the contextual dependencies between characters. SVTR employs two strategies: Local Mixing and Global Mixing. Local mixing captures the local morphological features of character components through a sliding window attention mechanism, while global mixing models global inter-character dependencies through a standard multi-head self-attention mechanism. This design allows SVTR to complete character recognition without a separate sequence model, significantly simplifying the architecture and improving inference efficiency.

[0047] In this embodiment, a text recognition network is built based on the SVTR algorithm, using a visual Transformer architecture as the backbone. It captures the contextual information of character sequences by combining local feature extraction with a global attention mechanism, adapting to the multi-character recognition scenario of mixed Chinese characters, numbers, and letters in logistics waybills. The model's character set is customized to suit the field features of logistics waybills, incorporating commonly used Chinese characters, uppercase and lowercase English letters, numbers, and special symbols, covering all character types in fields such as waybill address, name, and phone number. During the training phase, the CTC loss function is used for supervised optimization, eliminating the need for individual character segmentation and labeling. End-to-end training can be completed directly based on text content labels, adapting to text fields of varying lengths. The final text recognition module, when inputting a cropped text region image, outputs the corresponding text character sequence and the recognition confidence of each character, exhibiting strong tolerance for slightly blurred or printed text.

[0048] S304. Construct a barcode decoding module based on the ZBar barcode decoding algorithm. The barcode decoding module is used to decode the code image region image to obtain the decoding result.

[0049] Understandably, the ZBar barcode decoding algorithm employs a unique linear scanning decoding strategy, unlike conventional image processing schemes that perform multi-stage processing such as filtering, edge detection, and shape analysis on the entire image. ZBar treats the one-dimensional barcode as a signal composed of bright and dark stripes, performs linear scanning on the image, and treats each pixel as a sample value from a single light sensor, scanning, decoding, and assembling the data in real time.

[0050] In this embodiment, the ZBar open-source barcode decoding library is integrated as the core decoding engine. Its functionality is adapted and optimized. The decoding engine supports commonly used 1D and 2D barcode formats in the logistics industry, such as Code128 and QRCode, covering the barcode types of mainstream express delivery waybills. For the cropped barcode image area, preprocessing operations are first performed, including grayscale conversion, binarization, and edge enhancement, to improve the contrast and clarity of the barcode image and reduce the impact of dirt and blur on decoding. Then, the decoding engine is called to scan and decode the preprocessed barcode image, identifying the barcode's encoding format and parsing the corresponding character encoding content, while outputting the decoding confidence score and decoding status indicator. For single decoding failures, a built-in retry mechanism is implemented, adjusting image contrast, scaling the image, etc., for secondary processing before decoding again, improving the decoding success rate of low-quality barcodes.

[0051] S305. Connect the output of the text detection module to the input of the region cropping unit, and connect the output of the region cropping unit to the input of the text recognition module and the input of the barcode decoding module respectively to build a basic model.

[0052] In this embodiment, the connections are then made according to the data flow direction from detection to cropping to parallel recognition. Specifically, the region coordinate output interface of the text detection module and the original image transmission interface are both connected to the input of the region cropping unit, ensuring that the cropping unit can simultaneously acquire coordinate information and original image data. The text image output interface of the region cropping unit is connected to the input of the text recognition module, and the barcode image output interface is connected to the input of the barcode decoding module, enabling parallel processing of the two types of images. After the connections are completed, a unified scheduling logic is established to control the order of data flow between modules, ensuring that cropping is performed only after detection is complete, and that the two recognition modules start processing synchronously after cropping, ultimately forming a complete basic recognition model.

[0053] In this embodiment, a text detection module is built based on the DBNet algorithm, which can simultaneously output the coordinates of the text region and the barcode image region. This eliminates the need to deploy two separate detection models, reduces redundant feature extraction calculations, and improves detection efficiency and localization consistency. Moreover, an intermediate region cropping unit is set up as a connecting hub, which accurately crops two types of region images from the original image based on the detection coordinates and sends them to the downstream recognition module respectively. This avoids interference from irrelevant backgrounds on the recognition effect and also realizes parallel processing in the recognition stage. In addition, the text recognition adopts the SVTR algorithm, which, with its strong recognition capability for long texts and multi-form characters, is suitable for recognizing fields of varying lengths such as logistics waybill addresses and names. The barcode decoding adopts the ZBar algorithm, which has fast decoding speed and strong compatibility, and can quickly parse various logistics barcodes, thereby improving recognition accuracy.

[0054] Please see Figure 4 A fourth embodiment of a logistics waybill identification method according to the present invention includes: S401. Construct an image enhancement module, wherein the image enhancement module is used to perform at least one preprocessing operation on the input image, namely brightness adjustment, contrast adjustment, sharpness enhancement and noise removal.

[0055] In this embodiment, multiple basic image processing operators are first integrated, including adaptive brightness adjustment, histogram contrast optimization, Laplacian sharpening, and Gaussian filtering for noise reduction. Each operator corresponds to an image optimization capability and can be called independently or in combination. Based on this, an image quality assessment subunit is built. After inputting the original image, it automatically calculates quality parameters such as average brightness, contrast, sharpness, and noise level. Based on preset quality thresholds, it determines the type and degree of image degradation and automatically matches corresponding enhancement strategies: adaptive brightness correction is performed on overly dark or overly bright images to adjust the brightness to an appropriate range; histogram equalization is performed on low-contrast images to widen the difference between the foreground and background; sharpness enhancement is performed on blurred images to strengthen the edges of characters and barcodes; and noise removal is performed on noisy images, preserving edge information while filtering noise. For extremely degraded images, multiple operators can be combined for step-by-step optimization, effectively offsetting image degradation caused by factors such as lighting and shooting conditions at the logistics site.

[0056] S402. Construct a text and barcode error correction module to receive the two types of recognition results, perform consistency verification and fusion error correction, and output the verified and corrected waybill recognition result.

[0057] In this embodiment, the text and barcode error correction module includes a result receiving and structuring unit and a consistency verification unit. The result receiving and structuring unit categorizes and parses the text recognition results by field, extracting key fields such as waybill number and recipient's phone number. Simultaneously, it parses the encoded information in the decoding results, organizing both types of results into a unified structured format. The consistency verification unit compares and verifies corresponding fields in the text and barcode based on the information association rules of the logistics waybill. For example, it verifies the consistency between the waybill number text and the barcode encoding. Results that pass the verification directly enter the output queue. For results with inconsistent verification, a fusion error correction mechanism is activated. First, it retrieves the confidence scores from both text recognition and barcode decoding, prioritizing the result with the higher confidence score. Simultaneously, it calls a pre-set logistics waybill field rule library, including waybill number encoding rules, phone number format rules, address field rules, etc., to perform rule verification on both types of results, correcting errors that do not conform to the format rules. For abnormal results that still fail to meet the verification conditions after multiple corrections, an anomaly marker is added for subsequent manual review.

[0058] S403. Connect the output of the image enhancement module to the input of the text detection module and the input of the region cropping unit, respectively. Connect the output of the text recognition module and the output of the barcode decoding module to the input of the text and barcode error correction module, respectively, to obtain the model to be trained.

[0059] In this embodiment, for the image enhancement module, its enhanced image output is simultaneously connected to the input of the text detection module and the image cache port of the region cropping unit. The text detection module performs region detection based on the enhanced image and outputs coordinate information; the region cropping unit caches the enhanced image and performs cropping directly based on the received coordinate information, avoiding repeated image transmission and enhancement, ensuring that detection and cropping are based on the same enhanced image, and ensuring the consistency of coordinate and image correspondence. For the output, the results and confidence output interfaces of the text recognition module and the barcode decoding module are jointly connected to the multi-input port of the error correction module, ensuring that the two types of recognition results are input synchronously, ultimately forming a complete and smooth-connected training model.

[0060] In this embodiment, the image enhancement module is located at the front end of the model. Based on classic image processing techniques, it adjusts the brightness, contrast, sharpness, and removes noise from the input image. It can repair and standardize degraded images at the entry point of the recognition process, enabling DBNet's detection module to work on higher quality inputs. Moreover, the text and barcode error correction module is located at the back end of the model. It receives the text recognition and decoding results and performs character-level consistency verification. When the verification is inconsistent, it integrates the confidence scores of the two modules with predefined business rules for error correction. This design of front-end image enhancement combined with back-end multi-source verification and error correction forms a complete quality closed loop from input quality optimization to output result verification.

[0061] Please see Figure 5 The fifth embodiment of a logistics waybill identification method in this invention includes: S501. Input the historical logistics waybill images in the training dataset into the model to be trained. After preprocessing by the image enhancement module, perform forward inference, output the predicted region coordinates through the text detection module, output the text recognition result through the text recognition module, and output the decoding result through the barcode decoding module.

[0062] In this embodiment, historical logistics waybill images and corresponding annotation information are read in batches from the training dataset according to a set batch size, and then input into the model to be trained in batches. The historical logistics waybill images first enter the image enhancement module, where preprocessing is performed according to the enhancement strategy of the training phase to obtain enhanced images. In addition to basic preprocessing, the image enhancement during the training phase includes additional training enhancement operations such as random color perturbation and random affine transformation to further expand the diversity of training samples and improve the model's generalization ability. The enhanced images are then transmitted to the text detection module, where feature extraction, bi-branch prediction, and binarization post-processing are performed to output the predicted text region coordinates and barcode image region coordinates. Subsequently, the region cropping unit crops two types of region images from the enhanced images based on the predicted text region coordinates and barcode image region coordinates, and inputs them into the text recognition module and barcode decoding module, respectively. The text recognition module performs feature extraction and sequence decoding to output the text recognition result; the barcode decoding module performs decoding calculations and outputs the decoding result, providing a data foundation for subsequent loss calculations.

[0063] S502. Obtain the annotation information of the training dataset as supervision information, calculate the first loss based on the difference between the text region coordinates in the predicted region coordinates and the training text region coordinates, calculate the second loss based on the difference between the code image region coordinates in the predicted region coordinates and the training code image region coordinates, and calculate the third loss based on the difference between the text recognition result and the training text content label.

[0064] In this embodiment, the annotation information corresponding to the current batch of samples is retrieved, and three types of supervised ground truth values ​​are extracted: training text region coordinates, training code image region coordinates, and training text content labels. For the text detection task, a first loss is calculated, which uses a combined loss function of Dice loss and cross-entropy loss to calculate pixel-level differences between the predicted text probability map, binary map, and labeled text segmentation map. Regression loss based on bounding box coordinates is also included to comprehensively measure the detection accuracy of the text region. For the code image detection task, a second loss is calculated, which uses a loss function structure similar to that used for text detection. The loss weights are adjusted based on the visual features of the code image, and the difference between the predicted code image region and the labeled code image region is calculated to measure the code image detection accuracy. For the text recognition task, a third loss is calculated, which uses the CTC loss function to align the predicted character sequence probability distribution with the labeled text content labels, allowing for the measurement of text recognition accuracy without character-level segmentation annotation.

[0065] S503. The first loss, the second loss, and the third loss are weighted and summed to obtain a comprehensive loss value. The parameters of the text detection module and the text recognition module are updated by backpropagation based on the comprehensive loss value. The iteration continues until the model converges to obtain the waybill recognition model.

[0066] In this embodiment, based on the importance of the three types of tasks and the training stage, corresponding weight coefficients are set for the three types of losses. The comprehensive loss value is obtained by weighted summation. The weight coefficients can be dynamically adjusted according to the accuracy changes during training to balance the optimization progress of different tasks. Subsequently, based on the backpropagation algorithm, the comprehensive loss value is propagated back from the model output to the input layer by layer to calculate the gradient of the network parameters of each layer. The gradient descent optimization algorithm is used to update all trainable parameters of the text detection module and the text recognition module. The barcode decoding module uses a traditional algorithm and does not participate in parameter updates. Each batch of training is completed, and parameter updates are completed. Training is iterated batch by batch. During training, the model performance is evaluated periodically using a validation set. When the validation set accuracy no longer improves for several consecutive rounds and the comprehensive loss no longer decreases, the model is considered to have converged. Training is stopped, and the model weights and configuration file are saved, finally obtaining the trained label recognition model.

[0067] In this embodiment, the losses of text detection, code image detection, and text recognition tasks are incorporated into a unified comprehensive loss function. A weighted summation method is used to balance the optimization weights of different tasks, avoiding the problems of poor module adaptability and suboptimal overall performance caused by phased training. This allows the detection and recognition modules to adapt to each other during training and converge together to the optimal state. Furthermore, the three types of losses correspond to different supervision objectives: the first and second losses supervise the region localization accuracy of text and code images, ensuring the accuracy of the detection box positions; the third loss supervises the recognition accuracy of text content, ensuring the correctness of character recognition. This multi-dimensional supervision signal makes model training more comprehensive. In addition, the training process employs a complete closed loop of forward inference, loss calculation, and backpropagation, synchronously updating the parameters of the detection and recognition modules during iteration, resulting in higher training efficiency. Simultaneously, determining the convergence timing based on the validation set accuracy ensures the model's generalization ability and avoids overfitting.

[0068] Please see Figure 6 A sixth embodiment of a logistics waybill identification method according to the present invention includes: S601. Real-time acquisition of the logistics waybill image to be identified; inputting the waybill image into the waybill recognition model; the waybill recognition model first preprocesses the input image through the image enhancement module to obtain an enhanced image; the text detection module locates the coordinates of the text region to be identified and the code image region to be identified in the enhanced image; the region cropping unit crops the text region image and the code image region image to be identified from the enhanced image; the text recognition module then identifies the text region image to be identified to obtain a text recognition result; simultaneously, the barcode decoding module decodes the code image region image to be identified to obtain a decoding result; finally, the text and barcode error correction module performs consistency verification on the text recognition result and the decoding result. If the verification is inconsistent, the confidence level and preset rules are combined for fusion error correction, and the verified and corrected waybill recognition result is output.

[0069] In this embodiment, an image acquisition system is integrated with the logistics site, establishing data transmission links with terminals such as industrial cameras and intelligent barcode scanners, and configuring a trigger acquisition mechanism. When the photoelectric sensor detects a package arriving at the recognition station, the camera is triggered to capture an image of the waybill simultaneously; alternatively, a frame-by-frame detection mode of the video stream can be supported, automatically extracting image frames containing complete waybills from the video stream. The acquired logistics waybill images to be recognized are transmitted in real time via a local area network to the processing terminal where the waybill recognition model is deployed. After receiving the logistics waybill images, the terminal performs preliminary verification to determine whether the images are complete and contain valid waybill areas, discarding invalid images without waybills or severely overexposed images. Images that pass verification are initially adapted to the model input requirements in terms of size and format, and then input into the waybill recognition model to initiate the subsequent recognition processing flow.

[0070] In this embodiment, the image to be recognized first enters the image enhancement module. The image enhancement module automatically evaluates the image quality, calls the corresponding preprocessing operators to perform brightness, contrast, and sharpness optimization and noise reduction, and outputs the enhanced image to be recognized. The enhanced image to be recognized is then fed into the text detection module. The text detection module extracts multi-scale features through a backbone network, performs dual-branch detection head and differentiable binarization processing, quickly locates all text regions and barcode regions in the image, and outputs the corresponding bounding box coordinates. After receiving the coordinate information, the region cropping unit accurately crops the sub-image of each target region from the standardized image, performs perspective straightening processing on tilted text, and performs grayscale processing on the barcode image to generate standardized recognition input. Finally, the text recognition module and the barcode decoding module start in parallel. The text recognition module performs character sequence recognition on each text region image, outputting the corresponding text content and confidence score; the barcode decoding module performs decoding on each barcode region image, outputting the encoded content and decoding status, maximizing the use of computing resources and shortening the overall recognition time.

[0071] In this embodiment, after the text recognition and decoding results are synchronously transmitted to the text and barcode error correction module, the module first performs structured parsing on the two types of results, extracts associative fields such as waybill number and contact information, and initiates consistency verification logic to compare the waybill number recognized from the text with the encoded content of the decoded barcode to determine whether they match. Results that match are directly processed into structured waybill information and output.

[0072] For inconsistent verification results, the text and barcode error correction module automatically retrieves the confidence values ​​of the two results, prioritizes the result with higher confidence, and calls the pre-set logistics field rule base to verify the waybill number encoding format, mobile phone number digits, and address field logic, correcting recognition errors that do not conform to the rules and completing the fusion error correction.

[0073] After error correction, a consistency check is performed again. If the check passes, the result of the corrected and checked waybill is output. If multiple corrections fail to pass the check, or the overall confidence level is lower than the preset threshold, the result is considered abnormal.

[0074] S602. Mark abnormal results that still do not meet the verification conditions after error correction.

[0075] In this embodiment, a structured anomaly marker is added to the identification result. The marker information includes fields such as anomaly type, original identification content, error correction operation record, and corresponding confidence score value, which facilitates subsequent classification and processing. After the marker is completed, the anomaly result will be separately collected into a queue awaiting manual review and will not enter the automatic flow link of the downstream business system. This intercepts erroneous results from the process and avoids business problems such as mis-sorting and information entry errors caused by identification errors.

[0076] In this embodiment, by performing a secondary optimization on the basis of the basic identification results through a post-consistency verification and fusion error correction step, the error rate of on-site identification can be further reduced. At the same time, an abnormal result marking function is added to automatically mark low confidence results that cannot be corrected by error correction. This not only ensures the efficiency of automated processing of normal samples, but also provides guidance for manual review of abnormal samples, thus balancing automation efficiency and result accuracy.

[0077] The logistics waybill recognition method in the embodiments of the present invention has been described above. The apparatus in the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 7 The embodiments of the logistics waybill recognition device in this invention include: The acquisition module 701 is used to acquire historical logistics waybill images and perform annotation processing on the historical logistics waybill images to construct a training dataset; The first building module 702 is used to build a basic recognition model based on the DBNet algorithm, SVTR algorithm and barcode decoding algorithm; The second construction module 703 is used to construct an image enhancement module and a text and barcode error correction module, and connects the image enhancement module to the input end of the basic recognition model, and connects the text and barcode error correction module to the output end of the basic recognition model to obtain the model to be trained; Training module 704 is used to train the model to be trained using the training dataset to obtain a waybill recognition model; The recognition module 705 is used to acquire the image of the waybill to be recognized in real time, input the image of the waybill to be recognized into the waybill recognition model, and obtain the waybill recognition result.

[0078] In this embodiment, the acquisition module 701 includes: an acquisition unit 7011, used to acquire multiple historical logistics waybill images under normal conditions and under image degradation conditions; an annotation unit 7012, used to perform training text region labeling and training code image region annotation on each of the historical logistics waybill images respectively to obtain multiple annotated waybill images; and a first construction unit 7013, used to construct a training dataset based on all the annotated waybill images.

[0079] In this embodiment, the first construction module 702 includes: a second construction unit 7021, used to construct a text detection module based on the DBNet algorithm, wherein the text detection module is used to perform text region detection and code image region detection on the input image, and output text region coordinates and code image region coordinates; a third construction unit 7022, used to construct a region cropping unit, wherein the region cropping unit is used to crop a text region image from the input image according to the text region coordinates, and to crop a code image region image from the input image according to the code image region coordinates; and a fourth construction unit 7023, used to construct a text region image based on the SVTR algorithm. A text recognition module is constructed, which is used to recognize character sequences in a text region image and output the text recognition result; a fifth construction unit 7024 is used to construct a barcode decoding module based on the ZBar barcode decoding algorithm, which is used to decode the code image encoded content in the barcode region image to obtain the decoding result; a sixth construction unit 7025 is used to connect the output end of the text detection module to the input end of the region cropping unit, and connect the output end of the region cropping unit to the input end of the text recognition module and the input end of the barcode decoding module respectively, to construct a basic recognition model.

[0080] In this embodiment, the second construction module 703 includes: a seventh construction unit 7031, used to construct an image enhancement module, which performs at least one preprocessing operation on the input image, including brightness adjustment, contrast adjustment, sharpness enhancement, and noise removal; an eighth construction unit 7032, used to construct a text and barcode error correction module, which receives the text recognition result output by the text recognition module and the decoding result output by the barcode decoding module, performs consistency verification between the two, and performs fusion error correction by combining confidence level and preset rules when the verification is inconsistent, and outputs the verification and error correction result of the label recognition; and a ninth construction unit 7033, used to connect the output end of the image enhancement module to the input end of the text detection module and the input end of the region cropping unit, respectively, and connect the output end of the text recognition module and the output end of the barcode decoding module to the input end of the text and barcode error correction module, respectively, to obtain the model to be trained.

[0081] In this embodiment, the training module 704 includes: a training unit 7041, used to input historical logistics waybill images from the training dataset into the model to be trained, perform forward inference after preprocessing by the image enhancement module, output predicted region coordinates through the text detection module, output text recognition results through the text recognition module, and output decoding results through the barcode decoding module; a calculation unit 7042, used to obtain the annotation information of the training dataset as supervision information, calculate a first loss based on the difference between the text region coordinates in the predicted region coordinates and the training text region coordinates, calculate a second loss based on the difference between the barcode image region coordinates in the predicted region coordinates and the training barcode image region coordinates, and calculate a third loss based on the difference between the text recognition results and the training text content labels; and an update unit 7043, used to perform a weighted summation of the first loss, the second loss, and the third loss to obtain a comprehensive loss value, update the parameters of the text detection module and the text recognition module based on the comprehensive loss value through backpropagation, iterate until the model converges, and obtain a waybill recognition model.

[0082] In this embodiment, the recognition module 705 includes: a recognition unit 7051, used to acquire the image of the logistics waybill to be recognized in real time, input the image of the logistics waybill to be recognized into the waybill recognition model, so that the waybill recognition model first preprocesses the input image through the image enhancement module to obtain an enhanced image, locates the coordinates of the text region to be recognized and the coordinates of the code image region to be recognized in the enhanced image through the text detection module, and obtains the text region image to be recognized and the code image region image to be recognized from the enhanced image through the region cropping unit; then, the text recognition module recognizes the text region image to be recognized to obtain a text recognition result, and at the same time, the barcode decoding module decodes the code image region image to be recognized to obtain a decoding result; finally, the text and barcode error correction module performs consistency verification on the text recognition result and the decoding result, and when the verification is inconsistent, it combines the confidence level and preset rules to perform fusion error correction, and outputs the waybill recognition result after verification and error correction; and a marking unit 7052, used to mark abnormal results that still do not meet the verification conditions after error correction.

[0083] In this embodiment, an integrated basic recognition model is built based on three algorithms: DBNet, SVTR, and barcode decoding. This model can simultaneously perform label text detection, high-precision text recognition, and barcode decoding, achieving collaborative recognition of text and barcode information and solving the information misalignment problem caused by the separate recognition of text and barcode in traditional models. Simultaneously, an image enhancement module is added to the input end of the basic recognition model to pre-correct low-quality label images collected on-site, eliminating environmental interference such as lighting, wrinkles, and stains, thus reducing recognition errors caused by image defects at the source. A text and barcode error correction module is provided at the output end of the basic recognition model to intelligently verify and correct character errors and barcode decoding deviations generated by the basic recognition model, further reducing the recognition error rate. This effectively improves the accuracy and stability of label recognition in complex on-site environments, balancing recognition speed and accuracy, and adapting to real-time recognition needs across all scenarios such as logistics sorting and warehousing inbound / outbound operations.

[0084] Figure 7 The structure of the logistics waybill recognition device shown does not constitute a limitation on the logistics waybill recognition device, and can implement the steps of the logistics waybill recognition method provided in the above-described method embodiments.

[0085] above Figure 7 The logistics waybill recognition device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The logistics waybill recognition device in this embodiment of the invention will be described in detail from the perspective of hardware processing.

[0086] Figure 8This is a schematic diagram of the structure of a logistics waybill identification device provided in an embodiment of the present invention. The device 800 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 833 or data 832. The memory 820 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown), each module may include a series of instruction operations on the device 800. Furthermore, the processor 810 may be configured to communicate with the storage media 830 and execute the series of instruction operations in the storage media on the device 800.

[0087] Device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input / output interfaces 860, and / or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.

[0088] This invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the logistics waybill identification method.

[0089] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0090] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0091] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying logistics waybills, characterized in that, include: Historical logistics waybill images are acquired, and the historical logistics waybill images are annotated to construct a training dataset; A basic recognition model is constructed based on the DBNet algorithm, SVTR algorithm, and barcode decoding algorithm; An image enhancement module and a text and barcode error correction module are constructed, and the image enhancement module is connected to the input end of the basic recognition model, and the text and barcode error correction module is connected to the output end of the basic recognition model to obtain the model to be trained. The training dataset is used to train the model to be trained, and a waybill recognition model is obtained. The image of the waybill to be identified is acquired in real time, and the image is input into the waybill recognition model to obtain the waybill recognition result.

2. The logistics waybill identification method according to claim 1, characterized in that, The process of acquiring historical logistics waybill images and annotating these images to construct a training dataset includes: Acquire multiple historical logistics waybill images under normal and deteriorated conditions; Each of the historical logistics waybill images was trained with text region labeling and code image region annotation to obtain multiple labeled waybill images. A training dataset is constructed based on all the labeled faceplate images.

3. The logistics waybill identification method according to claim 1, characterized in that, The basic recognition model built upon the DBNet algorithm, SVTR algorithm, and barcode decoding algorithm includes: A text detection module is constructed based on the DBNet algorithm. The text detection module is used to detect text regions and code regions in the input image and output the coordinates of the text regions and the coordinates of the code regions. A region cropping unit is constructed, which is used to crop a text region image from an input image based on the text region coordinates, and to crop a code image region image from an input image based on the code image region coordinates; A text recognition module is constructed based on the SVTR algorithm. The text recognition module is used to recognize character sequences in text region images and output the text recognition results. A barcode decoding module is constructed based on the ZBar barcode decoding algorithm. The barcode decoding module is used to decode the encoded content of the barcode image area to obtain the decoding result. Connect the output of the text detection module to the input of the region cropping unit, and connect the output of the region cropping unit to the input of the text recognition module and the input of the barcode decoding module respectively to construct a basic recognition model.

4. The logistics waybill identification method according to claim 3, characterized in that, The text detection module based on the DBNet algorithm includes: A feature extraction backbone network based on a convolutional neural network is constructed, and the number of layers and parameters of the feature extraction backbone network are configured. The feature extraction backbone network is used to extract multi-scale feature maps from the input image. A dual-branch detection head is cascaded after the feature extraction backbone network. The dual-branch detection head includes a text detection branch and a code image detection branch set in parallel. Both the text detection branch and the code image detection branch include a probability map prediction unit and a threshold map prediction unit set in parallel. The probability map prediction unit is used to generate a probability map of the corresponding category based on the multi-scale feature map, and the threshold map prediction unit is used to generate a threshold map of the corresponding category based on the multi-scale feature map. A first differentiable binarization unit and a second differentiable binarization unit are constructed. The input of the first differentiable binarization unit is connected to the output of the probability map prediction unit and the threshold map prediction unit in the text detection branch. The input of the second differentiable binarization unit is connected to the output of the probability map prediction unit and the threshold map prediction unit in the code map detection branch to construct a text detection module. The first differentiable binarization unit and the second differentiable binarization unit are used to perform differentiable binarization processing on the probability map and threshold map of the corresponding branch to generate and output the coordinates of the region bounding box of the corresponding category.

5. The logistics waybill identification method according to claim 3, characterized in that, The process involves constructing an image enhancement module and a text and barcode error correction module, connecting the image enhancement module to the input of the basic recognition model, and connecting the text and barcode error correction module to the output of the basic recognition model to obtain a model to be trained, comprising: An image enhancement module is constructed, which is used to perform at least one of the following preprocessing operations on the input image: brightness adjustment, contrast adjustment, sharpness enhancement, and noise removal. A text and barcode error correction module is constructed. The text and barcode error correction module is used to receive the text recognition result output by the text recognition module and the decoding result output by the barcode decoding module, and to perform consistency verification between the two. If the verification is inconsistent, the confidence level and preset rules are combined to perform fusion error correction, and the verification and error correction result of the label recognition is output. Connect the output of the image enhancement module to the input of the text detection module and the input of the region cropping unit, respectively. Connect the output of the text recognition module and the output of the barcode decoding module to the input of the text and barcode error correction module, respectively, to obtain the model to be trained.

6. The logistics waybill identification method according to claim 5, characterized in that, The step of training the model to be trained using the training dataset to obtain the waybill recognition model includes: The historical logistics waybill images in the training dataset are input into the model to be trained. After preprocessing by the image enhancement module, forward inference is performed. The predicted region coordinates are output by the text detection module, the text recognition result is output by the text recognition module, and the decoding result is output by the barcode decoding module. The annotation information of the training dataset is obtained as supervision information. A first loss is calculated based on the difference between the text region coordinates in the predicted region coordinates and the training text region coordinates. A second loss is calculated based on the difference between the code image region coordinates in the predicted region coordinates and the training code image region coordinates. A third loss is calculated based on the difference between the text recognition result and the training text content label. The first loss, the second loss, and the third loss are weighted and summed to obtain a comprehensive loss value. The parameters of the text detection module and the text recognition module are updated by backpropagation based on the comprehensive loss value. The iteration continues until the model converges to obtain the waybill recognition model.

7. The logistics waybill identification method according to claim 5, characterized in that, The process of acquiring the image of the waybill to be identified in real time, inputting the image of the waybill to be identified into the waybill recognition model, and obtaining the waybill recognition result includes: The system acquires the image of the logistics waybill to be identified in real time and inputs it into the waybill recognition model. The model first preprocesses the input image using the image enhancement module to obtain an enhanced image. Then, the text detection module locates the coordinates of the text region to be identified and the barcode region to be identified within the enhanced image. Finally, the region cropping unit crops the text region image and the barcode region image from the enhanced image. The text recognition module then identifies the text region image to obtain a text recognition result, and the barcode decoding module decodes the barcode region image to obtain a decoding result. Finally, the text and barcode error correction module verifies the consistency between the text recognition result and the decoding result. If inconsistencies are found, the system combines confidence level and preset rules for error correction, outputting the verified and corrected waybill recognition result. Mark any abnormal results that still do not meet the verification conditions after error correction.

8. A logistics waybill recognition device, characterized in that, include: The acquisition module is used to acquire historical logistics waybill images and perform annotation processing on the historical logistics waybill images to construct a training dataset; The first building module is used to construct a basic recognition model based on the DBNet algorithm, SVTR algorithm, and barcode decoding algorithm. The second construction module is used to construct an image enhancement module and a text and barcode error correction module, and connects the image enhancement module to the input end of the basic recognition model, and connects the text and barcode error correction module to the output end of the basic recognition model to obtain the model to be trained. The training module is used to train the model to be trained using the training dataset to obtain the waybill recognition model; The recognition module is used to acquire the image of the waybill to be recognized in real time, input the image of the waybill to be recognized into the waybill recognition model, and obtain the waybill recognition result.

9. A logistics waybill recognition device, characterized in that, It includes a memory and at least one processor, wherein the memory stores computer-readable instructions; The at least one processor invokes the computer-readable instructions in the memory to perform the steps of the logistics waybill identification method as described in any one of claims 1-7.

10. A computer-readable storage medium storing computer-readable instructions thereon, characterized in that, When the computer-readable instructions are executed by a processor, they implement the various steps of the logistics waybill identification method as described in any one of claims 1-7.