CN-121999291-A - Method, device, equipment and storage medium for identifying package seal
Abstract
The invention relates to the technical field of logistics and discloses a method, a device, equipment and a storage medium for identifying a package seal, wherein the method comprises the steps of collecting an initial seal state image, marking key information to obtain a target seal sample data set, constructing a seal state identification model based on a DETR architecture, embedding a multi-scale edge perception module, training the seal state identification model, inputting the initial seal state image into the trained model to obtain a target seal detection result and a confidence score, obtaining a confidence preset threshold value and an abnormal state preset list, matching an integrity state category with the abnormal state preset list when the confidence score is higher than the confidence preset threshold value, judging that the seal state is abnormal when the integrity state category exists in the abnormal state preset list, and triggering early warning. The scheme solves the problems that in the prior art, package seal identification cannot be automatically identified, the omission factor is high, and misjudgment is serious.
Inventors
- ZENG YUE
- LI SI
- LI PEIJI
Assignees
- 上海东普信息科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260128
Claims (10)
- 1. A method of identifying a package label, the method comprising: Acquiring an initial seal state image of a target seal, and marking key information of the initial seal state image to acquire a target seal sample data set, wherein the key information at least comprises a boundary polygon, an integrity state label and key edge point coordinates; Constructing a seal state identification model based on a DETR architecture, and embedding a multi-scale edge sensing module MEM between a CNN backbone network and a transducer encoder; Training the seal state recognition model embedded in the multi-scale edge perception module MEM based on a target seal sample data set to obtain a trained DETR-MEM seal state recognition model, wherein a loss function used for training comprises an edge consistency regular term calculated based on edge characteristics predicted by the model and the key edge point coordinates; Inputting the initial seal state image into a trained DETR-MEM seal state identification model to obtain a target seal detection result output by the model and a confidence score corresponding to the target seal detection result, wherein the target seal detection result at least comprises a detection frame coordinate, an integrity state type and an anomaly type of the target seal; acquiring a confidence coefficient preset threshold value and an abnormal state preset list; when the confidence score of the target seal is higher than the confidence preset threshold, matching the integrity state category output by the model with the abnormal state preset list, and when the integrity state category exists in the abnormal state preset list, judging that the state of the target seal is abnormal and triggering early warning.
- 2. The method for identifying a package label according to claim 1, wherein the collecting an initial label state image of a target label, and labeling key information on the initial label state image to obtain a target label sample dataset, the key information at least includes a boundary polygon, a integrity status label, and key edge point coordinates includes: collecting package images containing different seal states including, but not limited to, normal seal, slight offset, partial tear, complete drop, secondary paste, dirty shielding, etc.; determining key information labeling rules, wherein the key information labeling rules comprise boundary polygon labeling rules, integrity label classification standards and key edge point selection specifications; performing key information labeling on the initial label state image based on a key information labeling rule to obtain a labeled label state image; And cleaning the data of the labeling label state image, removing the samples with wrong labeling or incomplete labeling, and obtaining a target label sample data set.
- 3. The method for identifying a package label according to claim 1, wherein constructing a label state identification model based on the DETR architecture and embedding a multi-scale edge awareness module MEM between a CNN backbone network and a transducer encoder thereof comprises: Constructing a seal state identification model based on a DETR architecture, wherein the model comprises a CNN backbone network, a transducer encoder, a transducer decoder and a prediction output layer; Inputting the target seal sample data set into a CNN backbone network to obtain a multi-scale feature map, wherein the multi-scale feature map has different spatial resolutions and semantic information; Introducing a multi-scale edge perception module MEM; Calculating the gradient amplitude of each scale on the multi-scale feature map based on a Sobel edge detection algorithm, obtaining a Sobel edge response map of the overall profile and trend of the reaction target seal under the scale, and carrying out Gaussian filtering denoising, gradient calculation and double-threshold screening on the scale feature map based on a Canny edge detection algorithm to obtain a Canny edge response map of the target seal fine fracture, burr and continuous edge; Performing channel splicing and fusion on the Slbel edge response graph and the Canny edge response graph under the same scale and the corresponding initial seal state image to obtain edge enhancement features of the scale; And fusing the edge enhancement features of all scales to obtain comprehensive edge enhancement features, and inputting the comprehensive edge enhancement features into the transform encoder to complete the integration of the multi-scale edge perception module MEM and the DETR model.
- 4. The method of claim 1, wherein training the tag state recognition model embedded in the multi-scale edge-aware module MEM based on the target tag sample dataset to obtain a trained DETR-MEM tag state recognition model, wherein the training uses a loss function comprising edge consistency regularization terms calculated based on model predicted edge features and the key edge point coordinates comprises: Inputting the image in the target seal sample data set into the seal state recognition model, and obtaining a target detection prediction result and a middle edge feature map output by the model, wherein the middle edge feature map is generated by the multi-scale edge perception module MEM; Calculating a composite loss function value, wherein the composite loss function value is achieved by weighted summation of a first loss term and a second loss term, the first loss term is a bipartite graph matching loss based on the target detection prediction result and a real annotation frame, and the second loss term is an edge consistency regular term, and the second loss term is obtained by calculating the difference between the middle edge feature graph and an edge truth value graph generated by the key edge point coordinates; and updating parameters of the seal state identification model through a back propagation algorithm based on the composite loss function value.
- 5. The method for identifying a package seal according to claim 1, wherein the inputting the initial seal state image into a trained DETR-MEM seal state identification model to obtain a target seal detection result output by the model and a confidence score corresponding to the target seal detection result, where the target seal detection result at least includes a detection frame coordinate, an integrity state type, and an anomaly type of the target seal includes: Inputting the initial seal state image into a trained DETR-MEM seal state recognition model so that the model carries out preprocessing and then recognition on the initial seal state image to obtain an original prediction sequence output by the model; Analyzing the original predicted sequence into a target seal detection result comprising seal detection frame coordinates, a complete state label category and an abnormal type, and outputting the target seal detection result and a confidence score corresponding to the target seal detection result.
- 6. The method of claim 1, wherein when the confidence score of the target tag is higher than the confidence preset threshold, matching the integrity status category output by the model with the abnormal status preset list, and when the integrity status category exists in the abnormal status preset list, determining that the target tag is abnormal, and triggering an early warning comprises: Obtaining a confidence score and an integrity state type of a target seal output by the DETR-MEM seal state identification model; Comparing the confidence score with a confidence preset threshold; When the confidence score is higher than the confidence preset threshold, matching the integrity state category with an abnormal state preset list; When the integrity status category exists in the abnormal status preset list, generating a seal status abnormal judgment instruction; and triggering system early warning based on the seal state abnormality judging instruction.
- 7. The package label identification method of claim 1, characterized in that the method further comprises: When the confidence score is higher than the confidence preset threshold, but the integrity state type is not stored in the abnormal state preset list, judging that the target seal state is normal and recording a detection result; and when the confidence score is lower than the confidence preset threshold, marking the target seal state as uncertain, triggering a manual review process and recording archiving.
- 8. A package label identification device, the device comprising: the sample data set acquisition module is used for acquiring an initial seal state image of the target seal, and marking key information on the initial seal state image to acquire a target seal sample data set, wherein the key information at least comprises a boundary polygon, an integrity state label and key edge point coordinates; The multi-scale edge sensing module embedding module is used for constructing a seal state identification model based on a DETR architecture and embedding a multi-scale edge sensing module MEM between a CNN backbone network and a transducer encoder; the seal state recognition model training module is used for training the seal state recognition model embedded into the multi-scale edge perception module MEM based on a target seal sample data set to obtain a trained DETR-MEM seal state recognition model, wherein a loss function used for training comprises edge consistency regular terms calculated based on edge characteristics predicted by the model and the key edge point coordinates; The result output module is used for inputting the initial seal state image into a trained DETR-MEM seal state recognition model to obtain a target seal detection result output by the model and a confidence score corresponding to the target seal detection result, wherein the target seal detection result at least comprises a detection frame coordinate, an integrity state type and an abnormality type of the target seal; the preset information acquisition module is used for acquiring a confidence coefficient preset threshold value and an abnormal state preset list; And the target seal state judging module is used for matching the integrity state category output by the model with the abnormal state preset list when the confidence score of the target seal is higher than a confidence preset threshold value, judging that the state of the target seal is abnormal when the integrity state category exists in the abnormal state preset list, and triggering early warning.
- 9. An electronic device comprising a memory and at least one processor, the memory having instructions stored therein, the at least one processor invoking the instructions in the memory to cause the electronic device to perform the steps of the method of identifying a package tag of any of claims 1-7.
- 10. A computer readable storage medium having instructions stored thereon, which when executed by a processor, perform the steps of the package label identification method of any of claims 1-7.
Description
Method, device, equipment and storage medium for identifying package seal Technical Field The invention relates to the technical field of logistics, in particular to a method, a device, equipment and a storage medium for identifying package seal. Background In the current logistics system, the disposable seal is used as a physical credential of the logistics package tightness, the integrity of the physical credential directly relates to commodity safety and responsibility attribution, however, the traditional manual inspection is low in efficiency, cannot meet the high-speed throughput requirement of a modern logistics sorting center, is non-uniform in judgment standard, strong in subjectivity, easy to cause disputes, cannot be effectively expanded along with the increase of the traffic, and is difficult to scale. The existing computer vision scheme is mostly based on a general target detection model, pays attention to the whole appearance or single-sided information of the package, lacks the capability of fine and automatic analysis on the state of the disposable seal, and particularly cannot effectively identify whether the seal is complete, whether the position is deviated, whether secondary sticking or micro tearing marks exist or not, and does not optimize the special targets such as the seal, which are slender, low in contrast and easily influenced by illumination and shielding, so that the package seal state is high in omission ratio and serious in misjudgment during identification. Disclosure of Invention The invention provides a method, device equipment and storage medium for identifying a package seal, which solve the problems that the package seal state cannot be automatically identified, the omission rate is high and the misjudgment is serious in the prior art. According to one aspect of the application, a method of identifying a package label is disclosed, the method comprising: Acquiring an initial seal state image of a target seal, and marking key information of the initial seal state image to acquire a target seal sample data set, wherein the key information at least comprises a boundary polygon, an integrity state label and key edge point coordinates; Constructing a seal state identification model based on a DETR architecture, and embedding a multi-scale edge sensing module MEM between a CNN backbone network and a transducer encoder; Training the seal state recognition model embedded in the multi-scale edge perception module MEM based on a target seal sample data set to obtain a trained DETR-MEM seal state recognition model, wherein a loss function used for training comprises an edge consistency regular term calculated based on edge characteristics predicted by the model and the key edge point coordinates; Inputting the initial seal state image into a trained DETR-MEM seal state identification model to obtain a target seal detection result output by the model and a confidence score corresponding to the target seal detection result, wherein the target seal detection result at least comprises a detection frame coordinate, an integrity state type and an anomaly type of the target seal; acquiring a confidence coefficient preset threshold value and an abnormal state preset list; when the confidence score of the target seal is higher than the confidence preset threshold, matching the integrity state category output by the model with the abnormal state preset list, and when the integrity state category exists in the abnormal state preset list, judging that the state of the target seal is abnormal and triggering early warning. According to another aspect of the present application, there is also disclosed a package tag identification device, the device comprising: the sample data set acquisition module is used for acquiring an initial seal state image of the target seal, and marking key information on the initial seal state image to acquire a target seal sample data set, wherein the key information at least comprises a boundary polygon, an integrity state label and key edge point coordinates; The multi-scale edge sensing module embedding module is used for constructing a seal state identification model based on a DETR architecture and embedding a multi-scale edge sensing module MEM between a CNN backbone network and a transducer encoder; the seal state recognition model training module is used for training the seal state recognition model embedded into the multi-scale edge perception module MEM based on a target seal sample data set to obtain a trained DETR-MEM seal state recognition model, wherein a loss function used for training comprises edge consistency regular terms calculated based on edge characteristics predicted by the model and the key edge point coordinates; The result output module is used for inputting the initial seal state image into a trained DETR-MEM seal state recognition model to obtain a target seal detection result output by the model and a confidence score corresponding to th