Logistics two-dimensional code positioning identification method and system

Through the methods of training set preprocessing and multi-level feature extraction, combined with loss value calculation, the QR code positioning and recognition model is updated, which solves the limitations of QR code orientation recognition, realizes the accurate positioning of the QR code position and orientation, and improves the recognition effect.

CN120688526APending Publication Date: 2025-09-23ZHEJIANG MILEY ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510835159.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Existing QR code positioning methods based on convolutional neural networks cannot determine the specific orientation of the QR code, which affects the accuracy of cargo handling and recognition effect, especially when the QR code is blurred, distorted or damaged.

Method used

Through training set preprocessing, data enhancement and multi-level feature extraction, combined with the calculation of confidence, bounding box and rotation angle loss values, the QR code positioning and recognition model is updated to determine the position and orientation of the QR code.

Benefits of technology

The accuracy of QR code positioning and the generalization of the model are improved, and the position and orientation of the QR code can be accurately located in complex environments, thereby enhancing the stability and accuracy of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688526A_ABST
    Figure CN120688526A_ABST
Patent Text Reader

Abstract

The invention relates to a logistics two-dimensional code positioning identification method and system in the technical field of positioning identification, and the method comprises the following steps: obtaining a training set of an original logistics image and labeling information corresponding to the original logistics image, carrying out the preprocessing of the training set and the labeling information, and generating preprocessing data; training the two-dimensional code positioning identification initial model, calculating a confidence coefficient loss value, a bounding box loss value and a rotation angle loss value of the positioning identification initial model, updating the positioning identification initial model, and generating a positioning identification update model; inputting a to-be-identified logistics image into the positioning identification updating model, and outputting a confidence coefficient value, bounding box data and a two-dimensional code rotation angle; and outputting the two-dimensional code position parameter based on the confidence value and the bounding box data, and determining the orientation of the two-dimensional code in the logistics image to be identified based on the two-dimensional code rotation angle, thereby solving the problems that the orientation identification of the two-dimensional code is limited and the two-dimensional code identification and positioning effect is poor in the existing two-dimensional code positioning method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of positioning and identification technology, and in particular to a logistics two-dimensional code positioning and identification method and system. Background Art

[0002] In the field of logistics automation, QR code (Quick Response Code) positioning technology has become a crucial component of automated cargo handling systems. Due to its significant advantages, including ease of use, low cost, and high positioning accuracy, this technology has been widely used in real-time positioning of carts and shelf identification. The core function of QR code positioning technology is to provide precise location information and directional guidance for transport carts. By locating the QR code, the current position and orientation of the cart and the shelf being transported can be determined. For the cart to efficiently handle cargo, high efficiency and accuracy of QR code positioning are generally required.

[0003] Existing QR code localization technologies, particularly those based on convolutional neural networks (CNNs), have become mainstream in the field. CNNs, due to their powerful feature extraction and pattern recognition capabilities, excel in this task. A typical CNN-based QR code localization model typically consists of two main layers: the first, the feature extraction layer, serves as the foundation of the entire model and primarily extracts key feature information from the input image data; the second, the feature fusion layer, synthesizes and analyzes the feature maps output by the feature extraction layer to predict the target's bounding box and category. Through the collaborative work of these two layers, CNN-based QR code localization models can accurately identify and locate QR codes in complex real-world environments, thereby providing precise location information for automated transport vehicles.

[0004] However, the convolutional neural network-based QR code positioning method can only obtain the angular information of the QR code rotated 0~90° around the center point, and cannot determine the specific orientation of the QR code. As a result, the trolley and the shelf to be transported cannot determine the current position and orientation, affecting the handling of goods. In addition, due to the blurring, distortion, and contamination of the QR code, the recognition accuracy of the QR code is affected. Therefore, the recognition effect of this QR code recognition and positioning method is poor under such environmental conditions, resulting in decoding errors. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the present invention provides a logistics QR code positioning and recognition method and system, which solves the problems that the existing QR code positioning method has limitations in identifying the orientation of the QR code and the QR code recognition and positioning effect is poor.

[0006] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0007] A logistics QR code positioning and identification method includes the following steps:

[0008] Obtaining a training set of original logistics images and annotation information corresponding to the original logistics images, and preprocessing the training set and the annotation information to generate preprocessed data;

[0009] Using the preprocessed data to train an initial model for positioning and recognizing a QR code, and calculating a confidence loss value, a bounding box loss value, and a rotation angle loss value of the initial model for positioning and recognizing a QR code;

[0010] The initial positioning recognition model is updated based on the confidence loss value, the bounding box loss value, and the rotation angle loss value to generate an updated positioning recognition model;

[0011] Input the logistics image to be identified into the positioning recognition update model, and output the confidence value, bounding box data and QR code rotation angle of the logistics image to be identified;

[0012] The position parameters of the two-dimensional code in the logistics image to be identified are output based on the confidence value and the bounding box data, and the orientation of the two-dimensional code in the logistics image to be identified is determined based on the rotation angle of the two-dimensional code.

[0013] Optionally, using the pre-processed data to train an initial model for QR code positioning and recognition includes the following steps:

[0014] Inputting the preprocessed data into the initial model for QR code positioning and recognition, and extracting multi-level features of the image in the preprocessed data through the backbone network layer of the initial model for QR code positioning and recognition;

[0015] The multi-level features are enhanced by performing feature enhancement processing on the neck network layer of the initial model through positioning and identifying the two-dimensional code to obtain multi-level enhanced features.

[0016] Optionally, extracting multi-level features of the image in the preprocessed data includes the following steps:

[0017] Extracting low-level feature data from the preprocessed data through the backbone layer, and segmenting the low-level feature data through the cross-stage layer to obtain a first segmentation feature and a second segmentation feature;

[0018] Compressing the channel dimensions of the first segmentation feature and the second segmentation feature to obtain a first channel compressed feature and a second channel compressed feature;

[0019] After enhancing the second channel compression feature, a second channel enhancement feature is obtained, and the first channel compression feature and the second channel enhancement feature are spliced ​​together to obtain a spliced ​​feature;

[0020] The concatenated features are adaptively learned using channel attention and the interactions in the channel dimension are integrated to obtain the first intermediate features.

[0021] Performing different pooling operations on the first intermediate features after channel dimension compression to obtain pooled features, and concatenating the first intermediate features with the pooled features obtained by the different pooling operations to obtain a multi-scale fusion feature;

[0022] The multi-scale fusion features are restored to channel dimensions to obtain multi-level features.

[0023] Optionally, calculating the confidence loss value of the initial positioning recognition model includes the following steps:

[0024] Based on the multi-level enhanced features, feature optimization is performed through the convolution layer to obtain the first output feature;

[0025] The first output feature is processed by the sigmoid activation function to obtain the prediction confidence;

[0026] The confidence loss value is calculated based on the prediction confidence and the annotation information. The calculation formula of the confidence loss value is as follows:

[0027] loss_cls=BCEWithLogits(scores,scores_target), where BCEWithLogits() represents probability similarity calculation, scores represents prediction confidence, and scores_target represents annotation information.

[0028] Optionally, calculating the bounding box loss value of the initial positioning and recognition model includes the following steps:

[0029] Based on the multi-level enhanced features, feature optimization is performed through the convolution layer to obtain the second output feature;

[0030] A predicted bounding box is calculated based on the second output feature, and a bounding box loss value is calculated based on the predicted bounding box. The calculation formula of the bounding box loss value is as follows:

[0031] ,in, represents the area loss of the bounding box; represents the bounding box; Represents the minimum rectangular bounding box; BBoxLoss() represents the area intersection ratio of the predicted box and the target box; represents the edge length loss of the bounding box, represents the side length of the bounding box, Indicates the minimum rectangle side length target value, represents the corner loss of the bounding box, represents the set of dashed and solid corner points of the bounding box, Represents the set of QR code dotted line corner points and QR code solid line corner points in the data augmented image in the preprocessed data.

[0032] Optionally, calculating the rotation angle loss value of the initial positioning recognition model includes the following steps:

[0033] Perform feature optimization through a convolution layer based on the multi-level enhanced features to obtain a third output feature, wherein the third output feature includes a positive and negative rotation angle and a rotation angle offset;

[0034] The predicted rotation angle of the target two-dimensional code is calculated based on the third output feature, and the calculation formula of the predicted rotation angle is: , Indicates the rotation angle offset, Indicates the positive or negative rotation angle;

[0035] The positive and negative loss values ​​of the rotation angle are calculated based on the positive and negative rotation angle and the rotation angle offset, and the rotation angle loss value is calculated based on the predicted rotation angle. The calculation formulas for the positive and negative loss values ​​of the rotation angle and the rotation angle loss value are as follows:

[0036] , Indicates the loss value of the positive and negative rotation angle, Indicates the rotation angle loss value.

[0037] Optionally, preprocessing the training set and the annotation information to generate preprocessed data includes the following steps:

[0038] Perform any one or more of random flipping, random rotation, random scaling, or random translation on the original logistics images in the training set to obtain data augmented images;

[0039] Obtaining the dotted line corner points and the solid line corner points of the QR code in the data-enhanced image, and generating a minimum circumscribed rectangle based on the four vertices of the QR code in the data-enhanced image;

[0040] Obtain the center point coordinates, side length, and clockwise rotation angle of the minimum enclosing rectangle relative to the horizontal coordinate, and generate the rotation angle target value, minimum rectangle side length target value, and center point coordinate target value;

[0041] The data augmented image is downsampled and then normalized to obtain a normalized image, wherein the normalized image, the rotation angle target value, the minimum rectangle side length target value, and the center point coordinate target value form preprocessed data.

[0042] Optionally, outputting the QR code position parameters in the logistics image to be identified based on the confidence value and the bounding box data includes the following steps:

[0043] Setting a confidence threshold, screening out bounding boxes whose confidence values ​​are greater than the confidence threshold, and determining the screened out bounding boxes that are completely within the image area, to obtain a first screened bounding box map;

[0044] The first screening bounding box graph is filtered out by a non-maximum suppression algorithm to obtain a second screening bounding box graph;

[0045] The vertices of the rectangular area represented by the second screening boundary box are serialized to obtain the QR code position parameters.

[0046] A logistics QR code positioning and recognition system, which executes any one of the logistics QR code positioning and recognition methods described above, including a preprocessing unit, a training unit, a model updating unit, a positioning and recognition unit, and a data analysis unit;

[0047] The preprocessing unit is configured to obtain a training set of original logistics images and annotation information corresponding to the original logistics images, preprocess the training set and the annotation information, and generate preprocessed data;

[0048] The training unit is used to train the initial model of QR code positioning and recognition using the preprocessed data, and calculate the confidence loss value, bounding box loss value, and rotation angle loss value of the initial model of positioning and recognition;

[0049] The model updating unit is configured to update the initial positioning and recognition model based on the confidence loss value, the bounding box loss value, and the rotation angle loss value to generate an updated positioning and recognition model;

[0050] The positioning and recognition unit is used to input the logistics image to be recognized into the positioning and recognition update model, and output the confidence value, bounding box data and QR code rotation angle of the logistics image to be recognized;

[0051] The data analysis unit is used to output the position parameters of the QR code in the logistics image to be identified based on the confidence value and the bounding box data, and to determine the orientation of the QR code in the logistics image to be identified based on the QR code rotation angle.

[0052] A computer storage medium having computer program instructions stored thereon; when the computer program instructions are executed by a processor, the logistics QR code positioning and identification method as described in any one of the above is implemented.

[0053] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects:

[0054] By updating the positioning and recognition model, the rotation angle of the QR code is determined, so that the current position of the cart and the shelf to be transported can be determined, and the exact orientation can also be determined. At the same time, data enhancement is performed on the training data, which increases the model generalization and data requirements, and improves the accuracy and authenticity of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0056] Figure 1 This is a flow chart of a logistics QR code positioning and recognition method proposed in this embodiment. DETAILED DESCRIPTION

[0057] The present invention will be further described in detail below with reference to the examples. The following examples are intended to explain the present invention but the present invention is not limited to the following examples.

[0058] Example 1

[0059] like Figure 1 As shown, a logistics QR code positioning and recognition method includes the following steps: obtaining a training set of original logistics images and annotation information corresponding to the original logistics images, preprocessing the training set and annotation information, and generating preprocessed data. In this application, the original logistics image refers to an image containing a shelf QR code or a ground QR code.

[0060] Among them, the training set and the annotation information are preprocessed to generate preprocessed data, which specifically includes the following steps: the original logistics image in the training set is randomly flipped, randomly rotated, randomly scaled or randomly translated to obtain a data enhanced image; the dotted corner points and solid corner points of the QR code in the data enhanced image are obtained, and the minimum enclosing rectangle is generated according to the four vertices of the QR code in the data enhanced image; the center point coordinates, side length, and clockwise rotation angle of the minimum enclosing rectangle relative to the horizontal coordinate are obtained, and the rotation angle target value, the minimum rectangle side length target value, and the center point coordinate target value are generated; the data enhanced image is downsampled and then normalized to obtain a normalized image, and the normalized image, the rotation angle target value, the minimum rectangle side length target value, and the center point coordinate target value form the preprocessed data;

[0061] Specifically, the preprocessing process consists of three stages: data enhancement, target value conversion, and normalization. In the data enhancement stage, the training data is enhanced to increase the generalization of the model and the data requirement. The training data contains two parts: the training set of the bmp grayscale image and the annotation information.

[0062] The bmp grayscale image contains logistics QR code images, ground QR code images, and images without QR codes; the annotation information is in the format of a txt file, and the content is the annotation information corresponding to the bmp grayscale image, in the form of: {x1, y1, x2, y2, x3, y3, x4, y4, datamatrix 0}, where x1, y1, x2, y2, x3, y3, x4, y4 represent the coordinates of the four vertices of the QR code; datamatrix represents the type of QR code, namely logistics QR code, ground QR code, and no QR code. The last number represents the difficulty, indicating whether the instance is difficult to detect, where 1 indicates difficult and 0 indicates not difficult. The annotation information of the image without a QR code is represented by 0 0 0 0 0 0 0 0 datamatrix 0.

[0063] Before training, the training data needs to be enhanced to increase the generalization of the model and the amount of data required. Data enhancement uses one or more of the following methods: random flipping, random rotation, random scaling, and random translation. Random flipping includes horizontal, vertical, and diagonal flipping, and all three flipping operations are performed with a probability of 0.75. Horizontal flipping will swap the image left and right, vertical flipping will swap the image up and down, and diagonal flipping will transform the image diagonally. The range of the rotation operation is set to , with a probability of 0.5, the image is rotated at a random angle; the range of the scaling operation is between [0.7, 1), and the image is also scaled with a probability of 0.5; the range of the translation operation is (-0.5, 0.5), and the image is moved horizontally and vertically with a probability of 0.25.

[0064] In the target value conversion stage, the input annotation information is processed and converted into target values ​​for training the model so that the model can improve its prediction and recognition accuracy by learning these target values. Specifically, in order to improve the accuracy of the target box, the dotted corner points of the QR code are first retained. and solid line corners , forming a set of QR code dotted line corner points and QR code solid line corner points {cross1, cross2}.

[0065] Then, the rotation angle is introduced as a regression parameter to locate the rotation rectangle to realize the detection of the rotating object. The four vertices of the QR code are used to generate the minimum enclosing rectangle through the minAreaRect function. , the generation formula is as follows:

[0066] ,in, Represents the coordinates of the four vertices of the QR code, Represents the minimum enclosing rectangle The center point coordinates , and Represents the minimum enclosing rectangle The side length , Represents the minimum enclosing rectangle Clockwise rotation angle relative to the horizontal axis .

[0067] Then, by the minimum enclosing rectangle The conversion is performed to generate the target value for training the model. The conversion formula is as follows:

[0068] ,in, Indicates the target value of the rotation angle, Indicates the minimum rectangle side length target value, Indicates the target value of the center point coordinates.

[0069] In the normalization stage, the input image is downsampled to reduce memory consumption and computational complexity, thereby increasing processing speed. The processed image is then normalized to improve algorithm stability and accelerate network convergence. , then the normalized image Expressed as: , Indicates a 4x downsampling operation, Represents a normalization operation.

[0070] After obtaining the preprocessed data, the preprocessed data is used to train the initial model of QR code positioning and recognition, and the confidence loss value, bounding box loss value, and rotation angle loss value of the initial model of positioning and recognition are calculated. The preprocessed data is used to train the initial model of QR code positioning and recognition, including the following steps: inputting the preprocessed data into the initial model of QR code positioning and recognition, extracting the multi-level features of the image in the preprocessed data through the backbone network layer of the initial model of QR code positioning and recognition; performing feature enhancement processing on the multi-level features through the neck network layer of the initial model of QR code positioning and recognition to obtain multi-level enhanced features.

[0071] Among them, extracting multi-level features of the image in the preprocessed data includes the following steps: extracting low-level feature data from the preprocessed data through the backbone layer, and segmenting the low-level feature data through the cross-stage layer to obtain a first segmentation feature and a second segmentation feature; compressing the channel dimension of the first segmentation feature and the second segmentation feature to obtain a first channel compression feature and a second channel compression feature respectively; enhancing the second channel compression feature to obtain a second channel enhancement feature, and splicing the first channel compression feature and the second channel enhancement feature to obtain a splicing feature; performing channel attention adaptive learning on the splicing feature, and integrating the interaction on the channel dimension to obtain a first intermediate feature; compressing the first intermediate feature in the channel dimension and then performing different pooling operations to obtain a pooling feature, and splicing the first intermediate feature with the pooling features obtained by different pooling operations to obtain a multi-scale fusion feature; restoring the channel dimension of the multi-scale fusion feature to obtain a multi-level feature.

[0072] Specifically, the backbone network layer backbone includes a backbone layer StemLayer and several stage layers StageLayer, wherein the last group of stage layers StageLayer is provided with a spatial pyramid pooling bottleneck layer SPPBottleneck relative to other groups of stage layers StageLayer.

[0073] When performing feature processing, the stem layer StemLayer normalizes the image The features are reduced to a dimension more suitable for network processing, and the low-level feature data F0 in the input data is preliminarily extracted. The extraction process is as follows: ,in, Represents the extracted low-level feature data, which usually contains image edges, textures and other features. Represents the StemLayer layer, which is mainly composed of three convolution modules ConvModule. Each convolution module contains a convolution layer, a batch normalization layer and a SiLU activation layer.

[0074] Subsequently, features at different levels are extracted through a series of StageLayers. The extraction method is as follows: ,in, Indicates the StageLayer, mainly composed of convolutional module ConvModule and cross-stage partial layer CSPLayer, and inserting spatial pyramid pooling bottleneck layer SPPBottleneck into the last StageLayer to enhance the model's prediction ability for QR codes of different scales; and Respectively represent The input and output features of a StageLayer, Indicates the number of StageLayer. Set to 2.

[0075] More specifically, the cross-stage layer CSPLayer significantly reduces the number of model parameters and computational complexity by splitting the input feature map into two parts, performing convolution operations on only one part and transferring the other part across stages. Finally, it merges the features of the two branches, retaining semantic information at different levels and improving the model's expressiveness.

[0076] First, for the input features (i.e. low-level feature data), the channel dimension of the input feature is compressed through two convolution modules ConvModule to reduce the computational complexity, as shown below:

[0077] First channel compression characteristics: ;

[0078] Second channel compression characteristics: , where the channel dimensions of the first channel compression feature and the second channel compression feature are both half of the original input channel dimension.

[0079] Then, use a Convolutional module ConvModule and a Large core separable convolution module DWConvModule compresses features of the second channel Enhance to effectively increase the receptive field and obtain the second channel enhanced features , the formula is as follows: ,in, Indicates that the convolution kernel size is Large kernel separable convolution module.

[0080] Then, the first channel compression feature and second channel enhancement features Splicing is performed along the channel dimension to retain semantic information at different levels, and channel attention is used to adaptively learn the importance weights of different channels to enhance the model's ability to capture key information. The calculation formula is as follows: ,in, represents the concatenation operation along the channel dimension, represents channel attention, Represents the fused multi-level information.

[0081] Finally, use The convolution module ConvModule further integrates the interaction in the channel dimension and enhances the feature representation. For the cross-stage layer CSPLayer, the first intermediate feature is output. , the output formula is: ,in Represents the output feature of the cross-stage layer CSPLayer, recorded as the first intermediate feature.

[0082] When entering the last set of stage layer processing, since it contains the spatial pyramid pooling bottleneck layer, and the spatial pyramid pooling bottleneck layer SPPBottleneck combines the design ideas of spatial pyramid pooling and bottleneck layer, it can improve the efficiency of feature extraction.

[0083] First, for the first intermediate feature , through a convolution module ConvModule to compress the channel dimension of the input feature to reduce the number of model parameters and improve the model operation speed. The processing is as follows: ,in, represents the compressed features, Indicates a Convolution module.

[0084] Subsequently, a series of maximum pooling layers MaxPool2d are used to capture feature information of different scales. Smaller pooling kernels can capture fine-grained local features, while larger pooling kernels can capture broader contextual information, as shown below:

[0085] ,in, represents the pooling kernel size, represents the maximum pooling operation, Represents the output features of the pooling layer.

[0086] Then, the input features Feature maps obtained with different pooling operations Splicing is performed on the channel dimension to achieve the fusion of multi-scale features and enhance the learning ability of the network. Finally, a The convolution module restores the number of channels of the fused feature map to the original dimension, and outputs multi-level features for the spatial pyramid pooling bottleneck layer SPPBottleneck , expressed by the following formula: ,in, Represents the output features of the spatial pyramid pooling bottleneck layer SPPBottleneck, that is, multi-level features.

[0087] After the model completes the above processing, the confidence loss value of the initial positioning recognition model is calculated, including the following steps: based on the multi-level enhanced features, feature optimization is performed through the convolution layer to obtain the first output feature; the first output feature is processed through the sigmoid activation function to obtain the prediction confidence; based on the prediction confidence and the annotation information, the confidence loss value is calculated. The formula for calculating the confidence loss value is as follows: , where BCEWithLogits() represents probability similarity calculation, scores represents prediction confidence, and scores_target represents annotation information.

[0088] Specifically, in the confidence In the neck layer of the neck network, the output First, a convolution module ConvModule is used to optimize the features, and then a The standard convolution layer Conv2d gets the output , as shown below: ,in, Indicates a The standard convolutional layer of represents the first output feature.

[0089] Then, use Activation function processing output , to generate the confidence level of the prediction , as shown below:

[0090] ;

[0091] ,in, represents the sigmoid activation function, represents the probability that the predicted target is a QR code, x represents the input of the activation function, and in this embodiment, x is the first output feature , and finally calculate the confidence loss value.

[0092] Then, the bounding box loss value of the initial positioning and recognition model is calculated, which includes the following steps: feature optimization is performed through the convolution layer based on the multi-level enhanced features to obtain the second output feature; the predicted bounding box is calculated based on the second output feature, and the bounding box loss value is calculated based on the predicted bounding box. The calculation formula of the bounding box loss value is as follows:

[0093] ,in, represents the area loss of the bounding box; represents the bounding box; Represents the minimum rectangular bounding box; BBoxLoss() represents the area intersection ratio of the predicted box and the target box; represents the edge length loss of the bounding box, represents the side length of the bounding box, Indicates the minimum rectangle side length target value, represents the corner loss of the bounding box, represents the set of dashed and solid corner points of the bounding box, Represents the set of QR code dotted line corner points and QR code solid line corner points in the data augmented image in the preprocessed data.

[0094] Specifically, in the bounding box In the neck layer of the neck network, the output First, pass through a convolution module ConvModule to optimize the features, and then pass through a The standard convolution layer Conv2d gets the output , as shown below:

[0095] ;

[0096] ,in, represents the optimized intermediate features, Represents the second output feature, which contains the image scaling , position offset and corner position offset .

[0097] Then, by processing the second output feature To generate the computational bounding box The relevant information is as follows:

[0098] ;in, Indicates a constant, set to 213, Represents a bounding box The side length of Represents a bounding box The center point, Represents a bounding box The set of dotted corner points and solid corner points is calculated, and the bounding box loss value is finally calculated.

[0099] Finally, the rotation angle loss value of the initial positioning and recognition model is calculated, which includes the following steps: based on the multi-level enhanced features, feature optimization is performed through the convolution layer to obtain the third output feature, where the third output feature includes the positive and negative rotation angles and the rotation angle offset; based on the third output feature, the predicted rotation angle of the target QR code is calculated. The calculation formula for the predicted rotation angle is: , Indicates the rotation angle offset, Indicates the positive or negative rotation angle; the positive or negative rotation angle loss value is calculated based on the positive or negative rotation angle and the rotation angle offset, and the rotation angle loss value is calculated based on the predicted rotation angle. The calculation formulas for the positive or negative rotation angle loss value and the rotation angle loss value are as follows:

[0100] , Indicates the loss value of the positive and negative rotation angle, Indicates the rotation angle loss value.

[0101] Specifically, the rotation angle Part, through a The standard convolutional layer Conv2d processes the optimized intermediate features Get the output third output feature and , as shown below:

[0102] ,in, Indicates the positive or negative rotation angle. Indicates the rotation angle offset. and , to determine the predicted rotation angle of the target QR code , and finally calculate the rotation angle Loss value.

[0103] Then, the initial positioning recognition model is updated based on the confidence loss value, bounding box loss value, and rotation angle loss value to generate an updated positioning recognition model.

[0104] After the update is completed, the logistics image to be identified is input into the positioning and recognition update model, and the confidence value, bounding box data and QR code rotation angle of the logistics image to be identified are output. Then, based on the confidence value and bounding box data, the QR code position parameters in the logistics image to be identified are output, and the orientation of the QR code in the logistics image to be identified is determined based on the QR code rotation angle.

[0105] Among them, the two-dimensional code position parameters in the logistics image to be identified are output based on the confidence value and the bounding box data, including the following steps: setting a confidence threshold, filtering out the bounding boxes with confidence values ​​greater than the confidence threshold, and judging the bounding boxes that are completely located in the image area to obtain a first filtered bounding box diagram; filtering out the second filtered bounding box diagram through the non-maximum suppression algorithm of the first filtered bounding box diagram; and performing vertex serialization processing on the vertices of the rectangular area represented by the second filtered bounding box diagram to obtain the two-dimensional code position parameters.

[0106] Specifically, all predicted bounding boxes output by the model are first filtered according to their confidence scores, and bounding boxes with confidence scores greater than a preset confidence threshold are retained. For example, bounding boxes with confidence scores greater than 0.9 are filtered. Then, the filtered bounding boxes are further judged to see whether they are completely within the valid image area (that is, they do not exceed the image boundary). Only compliant bounding boxes that are completely within the image area are retained to obtain the first filtered bounding box.

[0107] Then, the non-maximum suppression algorithm is used for processing. Specifically, based on the preset intersection-overlap ratio threshold, highly overlapping redundant bounding boxes are suppressed. Ultimately, only the bounding box with the highest confidence score in the non-overlapping area or the representative bounding box with the highest confidence score in the overlapping area is retained to obtain the second screening bounding box.

[0108] Finally, the vertex coordinates of the rectangular area represented by the second screening bounding box are rearranged in the specified order to form a standardized vertex sequence, which is output as the final detection result.

[0109] Example 2

[0110] A logistics QR code positioning and recognition system includes a preprocessing unit, a training unit, a model updating unit, a positioning and recognition unit, and a data analysis unit;

[0111] A preprocessing unit is used to obtain a training set of original logistics images and annotation information corresponding to the original logistics images, preprocess the training set and the annotation information, and generate preprocessed data;

[0112] A training unit is used to train the initial model of QR code positioning and recognition using preprocessed data, and calculate the confidence loss value, bounding box loss value, and rotation angle loss value of the initial model of positioning and recognition;

[0113] A model updating unit, configured to update the initial positioning recognition model based on the confidence loss value, the bounding box loss value, and the rotation angle loss value to generate an updated positioning recognition model;

[0114] The positioning and recognition unit is used to input the logistics image to be identified into the positioning and recognition update model, and output the confidence value, bounding box data and QR code rotation angle of the logistics image to be identified;

[0115] The data analysis unit is used to output the position parameters of the QR code in the logistics image to be identified based on the confidence value and the bounding box data, and to determine the orientation of the QR code in the logistics image to be identified based on the rotation angle of the QR code.

[0116] Since the logistics QR code positioning and identification system performs the logistics QR code positioning and identification method as in Example 1, it will not be repeated in this embodiment.

[0117] A computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, the logistics QR code positioning and identification method as described in Example 1 is implemented.

[0118] More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wire segments, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0119] In this application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Furthermore, in this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, electrical, optical, RF, or any suitable combination thereof.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules, subassemblies, or units is merely a logical functional division. In actual implementation, other division methods may be used, such as multiple units, subassemblies, or components can be combined or integrated into another device, or some features can be ignored or not performed.

[0121] The units may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0122] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0123] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part, and / or installed from a removable medium. When the computer program is executed by the central processing unit (CPU), the above-mentioned functions defined in the method of the present application are executed. It should be noted that the computer-readable medium mentioned above in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of an electrical, magnetic, optical, electromagnetic, infrared segment, or semiconductor, or any combination of the above.

[0124] The flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0125] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention shall be covered by the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

[0126] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form or substance. It should be pointed out that ordinary technicians in this technical field can make several improvements and supplements without departing from the method of the present invention. These improvements and supplements should also be regarded as the scope of protection of the present invention. Any equivalent changes, modifications and evolutions made by technicians familiar with this profession without departing from the spirit and scope of the present invention by using the technical content disclosed above are all equivalent embodiments of the present invention; at the same time, any equivalent changes, modifications and evolutions made to the above embodiments based on the essential technology of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A logistics QR code positioning and identification method, characterized in that: The following steps are involved: Obtaining a training set of original logistics images and annotation information corresponding to the original logistics images, and preprocessing the training set and the annotation information to generate preprocessed data; Using the preprocessed data to train an initial model for positioning and recognizing a two-dimensional code, and calculating a confidence loss value, a bounding box loss value, and a rotation angle loss value of the initial model for positioning and recognizing the code; The initial positioning recognition model is updated based on the confidence loss value, the bounding box loss value, and the rotation angle loss value to generate an updated positioning recognition model; Input the logistics image to be identified into the positioning recognition update model, and output the confidence value, bounding box data and QR code rotation angle of the logistics image to be identified; The position parameters of the two-dimensional code in the logistics image to be identified are output based on the confidence value and the bounding box data, and the orientation of the two-dimensional code in the logistics image to be identified is determined based on the rotation angle of the two-dimensional code.

2. A logistics two-dimensional code positioning and identification method according to claim 1, characterized in that: Using the pre-processed data to train an initial model for QR code positioning and recognition includes the following steps: Inputting the preprocessed data into the initial model for QR code positioning and recognition, and extracting multi-level features of the image in the preprocessed data through the backbone network layer of the initial model for QR code positioning and recognition; The multi-level features are enhanced by performing feature enhancement processing on the neck network layer of the initial model through positioning and identifying the two-dimensional code to obtain multi-level enhanced features.

3. A logistics two-dimensional code positioning and identification method according to claim 2, characterized in that: Extracting multi-level features of images from preprocessed data includes the following steps: Extracting low-level feature data from the preprocessed data through the backbone layer, and segmenting the low-level feature data through the cross-stage layer to obtain a first segmentation feature and a second segmentation feature; Compressing the channel dimensions of the first segmentation feature and the second segmentation feature to obtain a first channel compressed feature and a second channel compressed feature; After enhancing the second channel compression feature, a second channel enhancement feature is obtained, and the first channel compression feature and the second channel enhancement feature are spliced ​​together to obtain a spliced ​​feature; The concatenated features are adaptively learned using channel attention and the interactions in the channel dimension are integrated to obtain the first intermediate features. Performing different pooling operations on the first intermediate features after channel dimension compression to obtain pooled features, and concatenating the first intermediate features with the pooled features obtained by the different pooling operations to obtain a multi-scale fusion feature; The multi-scale fusion features are restored to channel dimensions to obtain multi-level features.

4. A logistics two-dimensional code positioning and identification method according to claim 1, characterized in that: Calculating the confidence loss value of the initial positioning recognition model includes the following steps: Based on the multi-level enhanced features, feature optimization is performed through the convolution layer to obtain the first output feature; The first output feature is processed by the sigmoid activation function to obtain the prediction confidence; The confidence loss value is calculated based on the prediction confidence and the annotation information. The calculation formula of the confidence loss value is as follows: , where BCEWithLogits() represents probability similarity calculation, scores represents prediction confidence, and scores_target represents annotation information.

5. A logistics two-dimensional code positioning and identification method according to claim 1, characterized in that: Calculating the bounding box loss value of the initial positioning and recognition model includes the following steps: Based on the multi-level enhanced features, feature optimization is performed through the convolution layer to obtain the second output feature; A predicted bounding box is calculated based on the second output feature, and a bounding box loss value is calculated based on the predicted bounding box. The calculation formula of the bounding box loss value is as follows: ,in, represents the area loss of the bounding box; represents the bounding box; Represents the minimum rectangular bounding box; BBoxLoss() represents the area intersection ratio of the predicted box and the target box; represents the edge length loss of the bounding box, represents the side length of the bounding box, Indicates the minimum rectangle side length target value, represents the corner loss of the bounding box, represents the set of dashed and solid corner points of the bounding box, Represents the set of QR code dotted line corner points and QR code solid line corner points in the data augmented image in the preprocessed data.

6. A logistics two-dimensional code positioning and identification method according to claim 1, characterized in that: Calculating the rotation angle loss value of the positioning recognition initial model includes the following steps: Perform feature optimization through a convolution layer based on the multi-level enhanced features to obtain a third output feature, wherein the third output feature includes a positive and negative rotation angle and a rotation angle offset; The predicted rotation angle of the target two-dimensional code is calculated based on the third output feature, and the calculation formula of the predicted rotation angle is: , Indicates the rotation angle offset, Indicates the positive or negative rotation angle; The positive and negative loss values ​​of the rotation angle are calculated based on the positive and negative rotation angle and the rotation angle offset, and the rotation angle loss value is calculated based on the predicted rotation angle. The calculation formulas for the positive and negative loss values ​​of the rotation angle and the rotation angle loss value are as follows: , Indicates the loss value of the positive and negative rotation angle, Indicates the rotation angle loss value.

7. A logistics two-dimensional code positioning and identification method according to any one of claims 1 to 6, characterized in that: Preprocessing the training set and the annotation information to generate preprocessed data includes the following steps: Perform any one or more of random flipping, random rotation, random scaling, or random translation on the original logistics images in the training set to obtain data augmented images; Obtaining the dotted line corner points and the solid line corner points of the QR code in the data-enhanced image, and generating a minimum circumscribed rectangle based on the four vertices of the QR code in the data-enhanced image; Obtain the center point coordinates, side length, and clockwise rotation angle of the minimum enclosing rectangle relative to the horizontal coordinate, and generate the rotation angle target value, minimum rectangle side length target value, and center point coordinate target value; The data augmented image is downsampled and then normalized to obtain a normalized image, wherein the normalized image, the rotation angle target value, the minimum rectangle side length target value, and the center point coordinate target value form preprocessed data.

8. A logistics two-dimensional code positioning and identification method according to claim 7, characterized in that: Outputting the QR code position parameters in the logistics image to be identified based on the confidence value and the bounding box data includes the following steps: Setting a confidence threshold, screening out bounding boxes whose confidence values ​​are greater than the confidence threshold, and determining the screened out bounding boxes that are completely within the image area, to obtain a first screened bounding box map; The first screening bounding box graph is filtered out by a non-maximum suppression algorithm to obtain a second screening bounding box graph; The vertices of the rectangular area represented by the second screening boundary box are serialized to obtain the QR code position parameters.

9. A logistics QR code positioning and identification system, characterized in that: The logistics QR code positioning and recognition system executes the logistics QR code positioning and recognition method according to any one of claims 1 to 8, comprising a preprocessing unit, a training unit, a model updating unit, a positioning and recognition unit, and a data analysis unit; The preprocessing unit is configured to obtain a training set of original logistics images and annotation information corresponding to the original logistics images, preprocess the training set and the annotation information, and generate preprocessed data; The training unit is used to train the initial model of QR code positioning and recognition using the preprocessed data, and calculate the confidence loss value, bounding box loss value, and rotation angle loss value of the initial model of positioning and recognition; The model updating unit is configured to update the initial positioning and recognition model based on the confidence loss value, the bounding box loss value, and the rotation angle loss value to generate an updated positioning and recognition model; The positioning and recognition unit is used to input the logistics image to be recognized into the positioning and recognition update model, and output the confidence value, bounding box data and QR code rotation angle of the logistics image to be recognized; The data analysis unit is used to output the position parameters of the QR code in the logistics image to be identified based on the confidence value and the bounding box data, and to determine the orientation of the QR code in the logistics image to be identified based on the QR code rotation angle.

10. A computer storage medium, characterized in that The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the logistics two-dimensional code positioning and identification method according to any one of claims 1 to 8 is implemented.