Parcel weight identification method and device, equipment and storage medium

By performing feature annotation and model optimization on a sample set of package images, and combining a channel attention module and image enhancement algorithms, the problems of low efficiency and insufficient accuracy in logistics weight recognition were solved, and automated and real-time package weight recognition was achieved.

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

Patent Information

Application Number
CN202511712699.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing logistics weight identification technologies rely on traditional equipment and manual operation, which are inefficient and prone to errors. They cannot adapt to complex scenarios and dynamic monitoring needs, resulting in incomplete data collection and insufficient accuracy.

Method used

We used annotation tools to annotate the package image sample set, built a package weight recognition model with a channel attention module, performed data augmentation through image enhancement algorithms, and conducted multiple rounds of iterative training to optimize the model to adapt to different scenarios and environments.

Benefits of technology

It has achieved automated and real-time package weight recognition, improved recognition efficiency, reduced manual intervention and recognition errors, and ensured stable accuracy in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582903A_ABST
    Figure CN121582903A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent logistics, in particular to a parcel weight recognition method, device and equipment and a storage medium, and the method comprises the steps: firstly obtaining a parcel image sample set, carrying out the feature labeling of the parcel image sample set through a labeling tool, obtaining a labeled image sample set, constructing an initial parcel weight recognition model, and carrying out the feature recognition of the parcel image sample set; introducing a channel attention module into the initial parcel weight recognition model, performing model interface parameter setting on the obtained optimized parcel weight recognition model, performing data enhancement processing on the annotated image sample set by adopting an image enhancement algorithm to obtain a target image sample set, and performing data enhancement processing on the annotated image sample set based on the model interface parameters. And performing multi-round iterative training on the optimized parcel weight identification model by using the target image sample set to obtain a target parcel weight identification model, finally obtaining a to-be-identified parcel image, and performing weight identification on the to-be-identified parcel image by using the target parcel weight identification model to obtain target parcel weight data. And the logistics weight identification efficiency and precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent logistics, and in particular to a parcel weight identification method, device, equipment and storage medium. BACKGROUND

[0002] In the logistics industry operation system, weight identification is the core link of connecting freight accounting, warehouse management and transportation scheduling, and its accuracy and timeliness directly affect the efficiency of business process and the accuracy of cost control. The current mainstream logistics weight identification technology still highly depends on the traditional mode, on the one hand, it needs to rely on special weighing equipment such as platform scale and ground scale to complete data acquisition, on the other hand, it relies on manual reading of dial display or recording of equipment data, which has significant limitations. From the efficiency dimension, the multiple manual intervention links lead to long time consumption of single parcel weight identification, which is difficult to adapt to the high-efficiency sorting demand under the continuous growth of logistics business volume; from the accuracy dimension, manual reading is easily affected by factors such as fatigue and subjective judgment deviation, often resulting in data recording errors, and further causing freight accounting disputes or inventory management deviation.

[0003] At the same time, the fixed deployment characteristics of traditional weighing equipment make it unable to respond to special scene demand, such as dynamic weight monitoring of parcels in transit, rapid weight verification of temporary transfer points, etc., resulting in breakpoints in weight data collection, affecting the integrity of the whole-link logistics information. Although automatic weight identification technology has been introduced in some fields, through image recognition and other means to reduce manual intervention, certain achievements have been made in efficiency improvement, but the existing scheme still faces technical bottlenecks: first, the image recognition accuracy is insufficient, for the fuzzy dial display, the blocked waybill identifier or the complex background of the parcel target, the feature extraction deviation is easy to occur, resulting in weight data calculation error; second, the adaptability to complex scenes is weak, in the actual logistics environment such as light change and parcel stacking, the technical stability is greatly reduced, it is difficult to guarantee the continuous and reliable identification effect. SUMMARY

[0004] In order to overcome the deficiencies of the prior art, the purpose of the present application is to provide a parcel weight identification method, device, equipment and storage medium, which reduces the labor cost and the auditing work intensity, and improves the efficiency of logistics weight identification.

[0005] The first aspect of the present application provides a package weight recognition method, comprising: obtaining a package image sample set, performing feature labeling on the package image sample set by using a labeling tool to obtain a labeled image sample set; constructing an initial package weight recognition model, introducing a channel attention module into the initial package weight recognition model to obtain an optimized package weight recognition model; setting model interface parameters of the optimized package weight recognition model; performing data enhancement processing on the labeled image sample set by using an image enhancement algorithm to obtain a target image sample set; based on the model interface parameters, performing multi-round iterative training on the optimized package weight recognition model by using the target image sample set to obtain a target package weight recognition model; obtaining a to-be-recognized package image, performing weight recognition on the to-be-recognized package image by using the target package weight recognition model to obtain target package weight data.

[0006] Optionally, in the first implementation manner of the first aspect of the present application, the feature labeling on the package image sample set by using the labeling tool to obtain the labeled image sample set comprises: obtaining a preset classification rule, performing classification processing on the package image sample set based on the classification rule to obtain a weighing panoramic image sample set, a dial image sample set and a waybill image sample set; performing regional feature labeling processing on the weighing panoramic image sample set by using the labeling tool to obtain a regional labeled image sample set; performing pixel feature labeling processing on the dial image sample set by using the labeling tool to obtain a pixel labeled image sample set; performing waybill feature labeling processing on the waybill image sample set by using the labeling tool to obtain a waybill labeled image sample set; integrating the regional labeled image sample set, the pixel labeled image sample set and the waybill labeled image sample set to obtain the labeled image sample set.

[0007] Optionally, in the second implementation manner of the first aspect of the present application, the initial package weight recognition model comprises a feature extraction module and a target detection module, and the feature extraction module and the target detection module are connected; the introduction of the channel attention module into the initial package weight recognition model to obtain the optimized package weight recognition model comprises: introducing the channel attention module between the feature extraction module and the target detection module to obtain a preliminary optimization model; obtaining a preset feature map dimension matching rule; performing structure adaptive adjustment processing on the preliminary optimization model based on the feature map dimension matching rule to obtain the optimized package weight recognition model.

[0008] Optionally, in a third implementation form of the first aspect of the present application, the method further includes: performing resolution statistical processing on the labeled image sample set by using a statistical algorithm to obtain sample resolution data; determining and setting an input image size parameter of the optimized parcel weight identification model based on the sample resolution data; obtaining image size information of the labeled image sample set, and performing clustering analysis processing on the image size information by using a K-Means clustering algorithm to determine and set an output anchor frame size parameter of the optimized parcel weight identification model.

[0009] Optionally, in a fourth implementation form of the first aspect of the present application, the image enhancement algorithm includes an affine transformation algorithm, a pixel gray value adjustment algorithm, and an image splicing algorithm, and the method further includes: performing random flipping and rotating processing on the labeled image sample set by using the affine transformation algorithm to obtain a preliminary enhanced image sample set; performing contrast adjustment processing on the preliminary enhanced image sample set by using the pixel gray value adjustment algorithm to obtain an illumination adaptation image sample set; and performing multi-image fusion processing on the illumination adaptation image sample set by using the image splicing algorithm to obtain the target image sample set.

[0010] Optionally, in a fifth implementation form of the first aspect of the present application, the method further includes: obtaining actual parcel weight data corresponding to the target image sample set; inputting the target image sample set into the optimized parcel weight identification model based on the model interface parameters to perform weight identification and obtain predicted parcel weight data; calculating a model loss based on the actual parcel weight data and the predicted parcel weight data to obtain a FocalLoss model loss; iteratively updating weight parameters of the optimized parcel weight identification model by using a back propagation algorithm based on the FocalLoss model loss; and outputting a target parcel weight identification model when a preset iteration stop condition is met.

[0011] Optionally, in a sixth implementation form of the first aspect of the present application, after the target parcel weight data is obtained by using the target parcel weight identification model to perform weight identification on the parcel image to be identified, the method further includes: obtaining a preset theoretical parcel weight data; performing deviation calculation based on the theoretical parcel weight data and the target parcel weight data to obtain a deviation value; obtaining a preset deviation threshold value, and comparing the deviation threshold value with the deviation value; and when the deviation value is less than or equal to the deviation threshold value, confirming that the target parcel weight data is valid data.

[0012] The second aspect of the present application provides a package weight recognition device, comprising: a data acquisition module: acquiring a package image sample set, using a labeling tool to perform feature labeling on the package image sample set to obtain a labeled image sample set; a model construction module: constructing an initial package weight recognition model, introducing a channel attention module into the initial package weight recognition model to obtain an optimized package weight recognition model; a parameter setting module: setting model interface parameters of the optimized package weight recognition model; a data enhancement module: using an image enhancement algorithm to perform data enhancement processing on the labeled image sample set to obtain a target image sample set; a model training module: based on the model interface parameters, using the target image sample set to perform multiple rounds of iterative training on the optimized package weight recognition model to obtain a target package weight recognition model; a recognition module: acquiring a to-be-recognized package image, using the target package weight recognition model to perform weight recognition on the to-be-recognized package image to obtain target package weight data.

[0013] The third aspect of the present application provides a package weight recognition device, comprising: a memory and at least one processor, the memory having instructions stored therein; at least one processor calling the instructions in the memory to enable the package weight recognition device to perform the steps of any of the package weight recognition methods described above.

[0014] The fourth aspect of the present application provides a computer-readable storage medium having instructions stored thereon, which, when executed by a processor, implement the steps of any of the package weight recognition methods described above.

[0015] In the technical solution of the present application, first, a package image sample set is acquired, a labeling tool is used to perform feature labeling on the package image sample set to obtain a labeled image sample set, then an initial package weight recognition model is constructed, a channel attention module is introduced into the initial package weight recognition model to obtain an optimized package weight recognition model, then model interface parameters of the optimized package weight recognition model are set, an image enhancement algorithm is used to perform data enhancement processing on the labeled image sample set to obtain a target image sample set, thereafter, based on the model interface parameters, the target image sample set is used to perform multiple rounds of iterative training on the optimized package weight recognition model to obtain a target package weight recognition model, finally, a to-be-recognized package image is acquired, the target package weight recognition model is used to perform weight recognition on the to-be-recognized package image to obtain target package weight data, thereby avoiding the problems of low efficiency and easy errors of manual recognition, and improving the efficiency of logistics weight recognition. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 The first flowchart of the package weight recognition method provided by the embodiments of the present application; Figure 2 A second flowchart of a parcel weight identification method provided by an embodiment of the present application is shown in FIG. 4; Figure 3 A third flowchart of a parcel weight identification method provided by an embodiment of the present application is shown in FIG. 5; Figure 4 A fourth flowchart of a parcel weight identification method provided by an embodiment of the present application is shown in FIG. 6; Figure 5 A fifth flowchart of a parcel weight identification method provided by an embodiment of the present application is shown in FIG. 7; Figure 6 A sixth flowchart of a parcel weight identification method provided by an embodiment of the present application is shown in FIG. 8; Figure 7 A seventh flowchart of a parcel weight identification method provided by an embodiment of the present application is shown in FIG. 9; Figure 8 A structure schematic diagram of a parcel weight identification device provided by an embodiment of the present application is shown in FIG. 10; Figure 9 A structure schematic diagram of a parcel weight identification device provided by an embodiment of the present application is shown in FIG. 10; DETAILED DESCRIPTION

[0017] The present application provides a parcel weight identification method, device, equipment and storage medium. In the present application, the terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily mean a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the term "includes" or "has" and any variation thereof is intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0018] For the sake of understanding, the specific flow of an embodiment of the present application is described below. Please refer to Figure 1 An embodiment of a parcel weight identification method in the present application includes: 101, obtaining a parcel image sample set, using a labeling tool to perform feature labeling on the parcel image sample set to obtain a labeled image sample set; In this embodiment, a set of parcel image samples is acquired, and priority is given to focusing on actual logistics business scenarios. Targeted collection work is carried out in logistics distribution centers with different functions (such as regional transfer hubs and terminal sorting sites). Key environmental variables affecting image quality are systematically included in the collection process, including daytime work scenarios with sufficient natural light, nighttime or indoor work scenarios dominated by light, and different angles of parcel placement, such as flat, inclined, and multi-layer stacking. Different sizes and materials of parcel types are also considered to ensure that the constructed set of parcel image samples can fully map the diversity of the actual logistics environment, avoid scene adaptation bias caused by single samples in subsequent model training, effectively improve the generalization ability of the model, and enable the trained weight recognition model to work stably in different distribution center environments and different parcel states, reducing scene adaptation limitations. After completing sample collection, a professional labeling tool such as LabelImg, VGGImageAnnotator, etc. is used to implement fine-grained feature labeling on the set of parcel image samples. Labeling operations should be carried out around the core requirements of weight recognition, such as accurately positioning the pixel coordinates of the dial display in the image, clearly defining the length and width of the display area, and ensuring that the subsequent model can accurately extract the display features. For shipping label weight information carriers, the pixel position and size of the shipping label identification need to be labeled simultaneously to provide clear feature boundaries for the model to distinguish the shipping label area from the background interference. The labeling process must strictly follow the pixel-level accuracy requirement to avoid affecting the accuracy of feature extraction due to labeling bias. Fine-grained feature labeling provides high-quality supervision information for the model to ensure that the model can accurately learn the key features of the dial display and shipping label identification, reducing recognition errors caused by feature ambiguity or positioning bias.

[0019] 102. Constructing an initial parcel weight recognition model, introducing a channel attention module into the initial parcel weight recognition model, and obtaining an optimized parcel weight recognition model; In this embodiment, the initial package weight identification model can be a MobileNetV3 model. MobileNetV3 is a lightweight convolutional neural network specially designed for mobile devices and edge computing scenarios. It greatly reduces the parameter quantity and computational quantity through deep separable convolution, and realizes fast reasoning under the premise of ensuring basic identification capability. To strengthen the focusing ability of the model on core features, an SENet channel attention module is introduced in the feature extraction stage of the initial package weight identification model to form an optimized package weight identification model. The SENet channel attention module optimizes the feature channel weight through the squeeze-activation mechanism, and compresses the spatial information of each feature channel into a single value through global average pooling to realize the squeeze operation, reflecting the global feature importance of the channel. Then, the excitation mechanism is constructed through a fully connected layer and a Sigmoid activation function to adaptively learn the weight coefficients of different channels. Multiplying the weight coefficients with the original feature channels strengthens the feature response to key targets such as dial display numbers and shipping label, and suppresses background interference features such as other devices in the distribution center and features of irrelevant packages, so that the model can better cope with complex background and different size target identification scenarios, significantly improving the robustness and identification accuracy.

[0020] 103. setting the model interface parameter of the optimized package weight identification model; In this embodiment, the scale of the package weight related targets (dial display numbers, shipping labels) in the logistics scene varies greatly. The dial numbers of small packages may only account for less than 5% of the original image, and the shipping label area of large packages may account for more than 20%. If the input image size is too small, the pixel information of small scale targets will be lost, the model cannot extract the key features such as edges and textures of dial numbers, and the recognition accuracy will be directly reduced. While a large size can retain more details, it will cause the model parameter quantity and computational quantity to grow exponentially, resulting in too long reasoning time on edge devices and failing to meet the real-time processing needs of logistics sorting. In addition, the optimized package weight identification model realizes target positioning through the matching of anchor boxes and real target bounding boxes. If the output anchor box size is designed to deviate from the actual target features, the intersection over union of the anchor box and the real target will be too low, and the model will be difficult to accurately capture the target position, thereby causing missed detection or false detection. Based on the above problems, the present embodiment proposes to set the model interface parameter of the optimized package weight identification model, including the determination of the input image size and the determination of the output anchor box size, which can ensure that the input image size forms an optimal balance between detail retention and computational efficiency, avoiding both the loss of small target features caused by low resolution and the waste of computing power caused by high resolution, ensuring that the model meets both real-time performance and recognition accuracy on edge devices. In addition, it also greatly improves the adaptability of the model to different size weight targets, improves the detection recall rate of dial numbers, complete dials, shipping label areas and other targets, and effectively reduces the missed detection and false detection caused by anchor box mismatch.

[0021] 104. performing data augmentation processing on the labeled image sample set by using an image enhancement algorithm to obtain a target image sample set; In this embodiment, the actual operation environment variables of the logistics distribution center need to be combined, and multiple pixel-level and geometric-level enhancement algorithms are comprehensively used for data augmentation processing to obtain the target image sample set. Specifically, by simulating light changes, posture shifts, image noise and other real logistics scene disturbances, the scene coverage of the samples is expanded, and the problem of single scene and limited features of the labeled image sample set is alleviated, so that the model can learn more comprehensive scene features during the training process, significantly improve the generalization ability, and reduce the recognition error caused by unobserved scenes in actual application; through the collaborative use of pixel-level and geometric-level enhancement algorithms, the feature expression of the samples is enriched without changing the core labeled information, so that the model can more accurately capture the essential features of the dial display and the shipping label, reduce the sensitivity to image surface noise and posture changes, and improve the recognition accuracy. By performing data augmentation processing on the labeled image sample set, the model bias caused by uneven sample distribution is avoided, ensuring that the model can maintain stable detection performance for package weight-related targets in different sizes and different scenes. At the same time, the expanded target image sample set can effectively improve the convergence speed and stability of model training, reduce overfitting, and provide data support for optimizing the training of the package weight recognition model.

[0022] 105. based on the model interface parameters, using the target image sample set to perform multiple rounds of iterative training on the optimized package weight recognition model to obtain a target package weight recognition model; In this embodiment, before training starts, the target image sample set needs to be standardized and preprocessed according to the input image size in the interface parameters to ensure that all samples meet the model input specifications, and the model detection head is configured according to the anchor box size defined by the interface, so that the model can complete the initial positioning based on the anchor box in the initialization stage. The training process adopts a phased iterative strategy. In the first iteration, the target image sample set is loaded with a lower learning rate (such as an initial learning rate of 1e-4), and the model loss function is optimized through the back propagation algorithm to ensure that the model learns the target positioning ability while optimizing the weight calculation accuracy. Through the model interface parameters, the input image size and anchor box size are fixedly configured, so that the model does not need to adapt to diversified input formats, and the computing power can be concentrated to optimize the core feature extraction and weight regression ability, significantly improving the training efficiency. The dynamic adjustment of the iterative strategy effectively avoids the problems of model overfitting and training stagnation, and through learning rate decay and sample replenishment, the model can stably converge to the optimal weight state, improving the recognition accuracy of the model.

[0023] 106、Obtain a to-be-identified package image, and perform weight identification on the to-be-identified package image by using the target package weight identification model to obtain target package weight data.

[0024] In the embodiment, the acquisition of the to-be-identified package image needs to rely on the actual acquisition link of the logistics business scene. The clear image of the package in the process of circulation is captured through the hardware such as the sorting line high-definition industrial camera, the handheld mobile detection terminal or the warehouse entrance snapshot device. When collecting, it is necessary to ensure that the weight information carrier (dial, waybill) on the surface of the package is complete in the lens, avoid missing key features due to shooting angle deviation and shielding, and ensure that the image resolution is consistent with the interface parameter requirements of the target package weight identification model to ensure that the subsequent model can be directly read and processed. After obtaining the image, standardized preprocessing is needed. The image size is adjusted according to the input format preset by the model to eliminate the image format difference caused by different acquisition devices and ensure the consistency of the model input data. Then the preprocessed to-be-identified package image is input into the target package weight identification model. The model starts the built-in feature extraction and weight calculation process. Based on the preset output anchor box size, the extracted high-order features are positioned and classified to accurately identify the type of the weight information carrier in the image and output the pixel coordinates and confidence of the target area. Finally, the corresponding weight calculation logic is called according to the target type. If it is a dial, the numerical value is analyzed. If it is a waybill, the weight field in the text information is extracted. After data format conversion, the final target package weight data is output, together with the confidence parameter of the weight prediction, which is used to judge the reliability of the result. The automation and real-time of package weight identification are realized. Manual verification of weight is not needed. The problems such as freight calculation error and inaccurate warehouse inventory caused by manual reading deviation are reduced. The time-consuming of single package weight identification is reduced to milliseconds, and the work efficiency of logistics sorting and warehouse inventory is greatly improved.

[0025] The application discloses a package weight identification method. First, a package image sample set is obtained, and a feature labeling tool is used to label the package image sample set to obtain a labeled image sample set. Then, an initial package weight identification model is constructed, a channel attention module is introduced into the initial package weight identification model to obtain an optimized package weight identification model. Then, the model interface parameters of the optimized package weight identification model are set, an image enhancement algorithm is used to perform data enhancement processing on the labeled image sample set to obtain a target image sample set. Then, based on the model interface parameters, the target image sample set is used to perform multiple rounds of iterative training on the optimized package weight identification model to obtain a target package weight identification model. Finally, a to-be-identified package image is obtained, and the target package weight identification model is used to perform weight identification on the to-be-identified package image to obtain target package weight data. The problems of low efficiency and easy errors of manual identification are avoided, and the efficiency of logistics weight identification is improved.

[0026] Please refer toFigure 2 In the embodiment of the present application, the feature labeling of the parcel image sample set is performed by using the labeling tool to obtain a labeled image sample set, which comprises: 201. A preset classification rule is obtained, and the parcel image sample set is classified based on the classification rule to obtain a weighing panoramic image sample set, a dial image sample set, and a waybill image sample set; 202. The region feature labeling processing of the weighing panoramic image sample set is performed by using the labeling tool to obtain a region labeled image sample set; 203. The pixel feature labeling processing of the dial image sample set is performed by using the labeling tool to obtain a pixel labeled image sample set; 204. The waybill feature labeling processing of the waybill image sample set is performed by using the labeling tool to obtain a waybill labeled image sample set; 205. The region labeled image sample set, the pixel labeled image sample set, and the waybill labeled image sample set are integrated to obtain the labeled image sample set.

[0027] In the embodiment, the preset classification rule needs to be formulated in combination with the core requirements of the parcel weight recognition task and the morphological differences of the weight information carriers in the logistics scene. The rule usually takes the weight information presentation mode as the core classification basis, and clearly divides the images in the parcel image sample set into three categories: weighing panoramic images, dial images, and waybill images. Among them, the weighing panoramic image refers to an image containing a complete parcel and a matching weighing device (such as a platform scale or a platform scale), which needs to simultaneously present the overall shape of the parcel and the weight display area of the weighing device; the dial image specifically refers to a close-up image focusing on the dial of the weighing device, which needs to clearly present the dial scale, pointer, or digital display screen, etc. weight reading carrier; the waybill image is an image containing a parcel waybill, and the waybill needs to have a clear weight information field marked on it. Through the automatic classification processing of the parcel image sample set by the classification rule, the algorithm detects whether the image contains the overall outline of the weighing device, the dial features (such as a circular scale dial, a rectangular display screen), or the waybill features (such as a standard waybill frame, a specific weight field text), and classifies the images meeting the corresponding features into the weighing panoramic image sample set, the dial image sample set, and the waybill image sample set, respectively.

[0028] In this embodiment, after classification, the professional annotation tool (such as LabelImg, VGGImageAnnotator) is used to implement targeted annotation processing according to the feature differences of different types of sample sets. For the weight panoramic image sample set, the annotation focuses on the range of the weight information region. The weight display region of the weighing device is framed in the image using the annotation tool, and the pixel coordinates, width and height parameters of the region are recorded to form regional annotation information, and finally a regional annotation image sample set containing regional annotation is obtained. For the dial image sample set, the annotation needs to be as deep as the pixel level. For each character of the scale line, pointer tip or digital display on the dial, the position boundary in the image is determined pixel by pixel through the annotation tool, and the mapping relationship between the scale value and the corresponding pixel region is accurately recorded to generate pixel-level annotation data, and then a pixel annotation image sample set is obtained. For the waybill image sample set, the core of the annotation is to locate and mark the weight information field on the waybill. The text region of the weight keyword and its corresponding value in the waybill is framed using the annotation tool, and the field type and value format are recorded to form the waybill feature annotation information, and finally a waybill annotation image sample set is obtained. The targeted annotation processing provides fine supervision information for subsequent model training. The regional annotation supports the model to quickly locate the weight information region in the panoramic image, the pixel annotation guarantees the accuracy of the dial reading recognition, and the waybill annotation helps the model to accurately extract the weight of the waybill text. The multi-dimensional annotation information improves the recognition ability of the model for different weight carriers, provides comprehensive training data support for the model, effectively avoids the insufficient generalization ability of the model caused by single sample type, and ensures that the model can adapt to the recognition needs of different weight information carriers in actual application.

[0029] Referring to Figure 3 In the embodiment of the application, the initial package weight recognition model includes a feature extraction module and a target detection module, and the feature extraction module and the target detection module are connected. The channel attention module is introduced into the initial package weight recognition model to obtain an optimized package weight recognition model, which comprises: 301. The channel attention module is introduced between the feature extraction module and the target detection module to obtain a preliminary optimization model; 302. A preset feature map dimension matching rule is obtained; 303. The preliminary optimization model is structurally adapted and adjusted based on the feature map dimension matching rule to obtain the optimized package weight recognition model.

[0030] In the present embodiment, the core architecture of the initial package weight identification model is composed of a feature extraction module and a target detection module, which realize feature transmission through a fixed data link, wherein the feature extraction module is responsible for extracting edge, texture and high-order semantic features (such as dial outline, waybill area features) from the input package image layer by layer, and outputs the extracted multi-channel feature map to the target detection module, and the target detection module completes the positioning and preliminary identification of the weight-related targets (dial, waybill) based on these features, forming a complete basic identification link. When optimizing the initial model, first, a channel attention module needs to be introduced in the feature transmission path between the feature extraction module and the target detection module to build a preliminary optimization model. The core function of the channel attention module is to dynamically allocate weights to the multi-channel feature map output by the feature extraction module, by calculating the contribution of each channel feature to the weight identification task, to strengthen the response intensity of key feature channels such as dial display texture and waybill identification, while suppressing the signal transmission of invalid feature channels such as background texture and packaging interference, so that the feature map entering the target detection module is more focused on the core identification target, laying the foundation for improving the detection accuracy. The introduction of the channel attention module directly strengthens the distinction between core features and interference information, solves the redundancy problem in feature extraction in the initial model, enables the target detection module to efficiently utilize key features, significantly improves the identification accuracy of dial display and waybill identification, and reduces the weight data misjudgment caused by feature confusion.

[0031] In the embodiment, after introducing the channel attention module, a preset feature map dimension matching rule needs to be obtained. The rule is a standardized specification based on the input and output feature specifications of each module of the model, mainly including matching requirements of feature map channel number, resolution and data format. For example, the channel number of the output feature map of the feature extraction module needs to be consistent with the input channel number of the channel attention module, the resolution of the output feature map of the channel attention module needs to be adapted to the input resolution of the target detection module, so as to ensure that there is no dimensional disorder or information loss in the feature transmission process. Based on the feature map dimension matching rule, the preliminary optimized model is subjected to structure adaptation adjustment processing. If the channel number of the output feature map of the feature extraction module does not match the input requirement of the channel attention module, a 1x1 convolution layer is added between the two to adjust the channel number. The channel number of the feature map is converted to a range that meets the input specification of the attention module through linear transformation. If the resolution of the output feature map of the channel attention module is different from the input resolution of the target detection module, interpolation sampling or pooling operation is introduced for resolution calibration to ensure that the feature map size is consistent with the receiving specification of the target detection module. At the same time, the data flow interface of each module is unified in format to ensure that there is no conflict in data type and storage format when the feature map is transmitted between modules. Finally, the structure adaptation adjustment is completed to form a functional complete optimized package weight identification model, which avoids model training failure or inference abnormality caused by incompatible feature dimensions between modules, and ensures stable conversion of the preliminary optimized model to a usable optimized model.

[0032] Please refer to Figure 4 In the embodiment of the application, the model interface parameters of the optimized package weight identification model are set, including: 401. Adopting a statistical processing algorithm to process the resolution of the labeled image sample set to obtain sample resolution data; 402. Determining and setting the input image size parameter of the optimized package weight identification model based on the sample resolution data; 403. Obtaining the image size information of the labeled image sample set, and adopting a K-Means clustering algorithm to process the image size information for clustering analysis to determine and set the output anchor frame size parameter of the optimized package weight identification model.

[0033] In this embodiment, firstly, statistical processing of resolution of the labeled image sample set needs to be carried out by using a statistical algorithm. The process needs to traverse all the labeled images in the sample set, extract the width and height pixel values of each image, and generate complete sample resolution data by calculating statistical indicators such as mean, median, standard deviation and frequency distribution. During the statistical process, the concentration trend and dispersion degree of the resolution distribution need to be focused on. For example, if the resolution of more than 80% of the images in the sample set is concentrated in the 480x480 pixel to 720x720 pixel interval, and the median is 640x640 pixels, the median can be taken as the core reference basis, and adjusted according to the model inference efficiency requirements. If the edge device has limited computing power, the input image size parameter can be determined as 640x640 pixels on the premise of ensuring that the core features (dial numbers, waybill texts) are not lost, which can avoid the loss of small scale features due to low resolution and prevent the increase of computing burden due to high resolution, ensure that the parameter setting is highly compatible with the actual resolution features of the sample and the hardware, avoid feature loss or waste of computing power due to improper size setting, and ensure that the model can extract effective features with optimal efficiency.

[0034] In this embodiment, after completing the input image size parameter setting, the output anchor box size parameter needs to be further determined. Firstly, the target labeling information corresponding to each image is extracted from the labeled image sample set, such as the bounding box width and height of the dial and waybill, to form an image size information set. Then, the K-Means clustering algorithm is used to analyze the clustering of the bounding box size data in the set. The clustering process takes the width and height of the bounding box as the feature dimension, determines the clustering center by calculating the Euclidean distance between different size data, and iteratively optimizes until the clustering result converges. The number of clusters needs to be set according to the diversity of the target scale in the sample. Usually, 3-5 groups of anchor boxes with different sizes are determined, such as 10x10 pixels, 20x20 pixels, 30x30 pixels, etc., to adapt to the detection needs of targets of different sizes, ensure that the anchor box size can cover the weight-related targets of different scales in the sample, reduce the matching error between the anchor box and the real target, and further improve the detection recall rate and positioning accuracy of the model for targets of different scales.

[0035] Referring to Figure 5 In the embodiment of the present application, the image enhancement algorithm includes an affine transformation algorithm, a pixel gray value adjustment algorithm and an image stitching algorithm. The labeled image sample set is processed by using the image enhancement algorithm to obtain a target image sample set, which includes: 501. The labeled image sample set is randomly flipped and rotated by using the affine transformation algorithm to obtain a preliminary enhanced image sample set; 502. The preliminary enhanced image sample set is processed by using the pixel gray value adjustment algorithm to adjust the contrast to obtain a light adaptation image sample set; 503. The image stitching algorithm is used to perform multi-image fusion processing on the light adaptation image sample set to obtain the target image sample set.

[0036] In this embodiment, first, an affine transformation algorithm is used to perform random flipping and rotation processing on the original labeled image sample set. The algorithm changes the spatial coordinate distribution of image pixels through matrix transformation principles. Random flipping includes flipping operations in the horizontal and vertical directions, simulating different placement orientations in the logistics sorting scene. The rotation processing randomly selects a rotation angle within a predetermined reasonable angle range, restores the attitude deviation of the package caused by stacking and handling, and synchronously performs coordinate mapping conversion on the label information in the image to ensure that the position of the dial area and the shipping label after flipping and rotation is accurately marked with the image content, avoiding misplacement of the label, thereby obtaining a preliminary enhanced image sample set containing attitude diversity features. Then, a pixel gray value adjustment algorithm is used to perform contrast adjustment processing on the preliminary enhanced image sample set. The algorithm optimizes the image visual features by changing the gray scale distribution range of the image pixels. Specifically, the dynamic interval of the pixel gray value is adjusted through linear or nonlinear transformation, including both increasing the contrast to strengthen the dial scale, shipping label text, and background boundary discrimination, and reducing the contrast to simulate complex lighting environments such as weak light and backlight, so that the image sample can cover the visual features of the package under different lighting intensities. At the same time, the integrity of the label information is strictly maintained during the adjustment process, and the core feature attributes of the target area are not changed. After processing, a light adaptation image sample set that adapts to multiple lighting scenes is formed. Finally, an image stitching algorithm is used to perform multi-image fusion processing on the light adaptation image sample set. The algorithm selects non-overlapping effective areas of different images in the sample set and uses feature point matching and image fusion technology to stitch multiple images into a single complete image. In the stitching process, it is necessary to ensure that the target areas (dial and shipping label) of each image are unobstructed and clearly identifiable, and at the same time, through smoothing processing, the transition marks of the stitching boundary are eliminated, so that the fused image has more rich scene information, such as stitching the dial area and the shipping label area of different packages to simulate a multi-package detection scene, further expanding the scene diversity of the sample, and ultimately obtaining a target image sample set with attitude diversity, light adaptation, and scene complexity. This enables the model to be exposed to more comprehensive scene features and target shapes during the training process, significantly improving the generalization ability and recognition accuracy of the model, and ensuring that the model can accurately and stably recognize package weight-related targets in complex real-world scenarios such as logistics sorting and warehouse inventory.

[0037] Please refer to Figure 6 In the embodiment of the present application, based on the model interface parameters, the target image sample set is used to perform multi-round iterative training on the optimized package weight recognition model to obtain a target package weight recognition model, which comprises: 601. Obtain actual package weight data corresponding to the target image sample set; 602、based on the model interface parameters, inputting the target image sample set into the optimized package weight recognition model for weight recognition to obtain predicted package weight data; 603、based on the actual package weight data and the predicted package weight data, calculating a model loss to obtain a FocalLoss model loss; 604、based on the FocalLoss model loss, iteratively updating the weight parameters of the optimized package weight recognition model by using a back propagation algorithm; 605、when a preset iteration stop condition is met, outputting a target package weight recognition model.

[0038] In the embodiment, first, actual package weight data corresponding to the target image sample set needs to be obtained. The data needs to be recorded synchronously at the time of image collection by using a high-precision weighing device (such as an industrial electronic platform scale or a ground scale), to ensure that the real weight information of the package corresponding to each image is accurate and reliable, and to provide a reliable supervision basis for subsequent model loss calculation. Subsequently, based on preset model interface parameters, the target image sample set is preprocessed according to the input format defined by the interface, and then is inputted into the optimized package weight recognition model in batches. The model completes the recognition and weight analysis of the weight information carrier in the image through the synergistic effect of the feature extraction module, the channel attention module and the target detection module, and finally outputs the predicted package weight data corresponding to each image to form a complete prediction result set.

[0039] In the embodiment, FocalLoss is selected as the loss function. By introducing a focus parameter and a balance factor, the function can effectively solve the problems of sample class imbalance and difficult sample weight imbalance. For difficult samples with large weight prediction errors (such as small size dials and blurred waybill samples), FocalLoss automatically increases the loss weight of the difficult samples, prompting the model to focus on optimizing the prediction accuracy of these samples during training. For easy samples with small prediction errors, the loss weight is reduced to avoid the model paying too much attention to simple samples, resulting in low training efficiency. The FocalLoss model loss calculated by the actual package weight data and the predicted package weight data can more accurately reflect the current weight prediction deviation of the model. Then, the weight parameters of the optimized package weight recognition model are iteratively updated using the back propagation algorithm. The algorithm starts from the loss function, reversely calculates the gradient of each layer parameter on the loss along the network level of the model, and then adjusts the parameter value according to the gradient direction and the preset learning rate, so that the overall loss of the model gradually decreases and the weight prediction accuracy continuously improves. The entire iterative update process needs to be repeated until the preset iteration stopping condition is met. The condition usually includes multiple dimensional judgment criteria, for example, the FocalLoss loss of the model on the validation set does not decrease for several rounds (such as 5 rounds), the number of iterations reaches the preset maximum value (such as 100 rounds), or the weight prediction error of the model is less than the set threshold (such as an error of less than 0.1 kg). When any of the conditions is met, the parameter update is stopped and the final target package weight recognition model is output, effectively solving the limitations of traditional loss functions in the sample imbalance scenario, enabling the model to optimize the prediction ability of difficult samples and significantly improving the weight recognition accuracy in complex scenarios.

[0040] Please refer to Figure 7 In the embodiment of the application, after the target package weight data is obtained by using the target package weight recognition model to perform weight recognition on the to-be-identified package image, the method further comprises: 701. Obtain a preset theoretical package weight data; 702. Perform deviation calculation based on the theoretical package weight data and the target package weight data to obtain a deviation value; 703. Obtain a preset deviation threshold, compare the deviation threshold with the deviation value, and when the deviation value is less than or equal to the deviation threshold, confirm that the target package weight data is valid data.

[0041] In this embodiment, first, the preset theoretical package weight data needs to be obtained, which is the reference weight information determined in advance based on the physical properties of the package, the packaging specifications and the logistics business rules. The sources include the weight data declared when the package is delivered, the theoretical weight value calculated according to the size and material of the goods, or the reference weight calibrated in advance by standard weighing equipment, to ensure that the data is authoritative and accurate. Then, the deviation is calculated based on the theoretical package weight data and the target package weight data output by the target package weight identification model. The deviation calculation adopts a calculation method that fits the accuracy requirements of the logistics business, and the deviation value is obtained by quantifying the numerical difference between the two. The calculation process needs to strictly follow the numerical operation specification to ensure that the deviation value can truly reflect the deviation degree of the target weight data from the theoretical reference, and avoid judgment errors caused by improper calculation methods. Then, the preset deviation threshold is obtained, which is a reasonable value developed by combining the accuracy requirements of the weight identification, the error tolerance range of the freight calculation and the industry standards. The setting needs to consider both the identification accuracy and the business practicality, to ensure the reliability of the weight data and avoid too strict threshold values that misjudge too many valid data. The obtained deviation value is compared with the preset deviation threshold. If the deviation value is less than or equal to the deviation threshold, it means that the deviation degree of the target package weight data from the theoretical reference is within the acceptable range, which meets the accuracy requirements of the logistics business for weight data. Therefore, it is confirmed that the target package weight data is valid and can be used for subsequent business links such as freight settlement and warehouse management. If the deviation value is greater than the deviation threshold, it means that the target package weight data is abnormal, which triggers the alarm mechanism to remind relevant personnel to verify, to ensure that the data flowing into the subsequent business links has high reliability, and to reduce the problems such as freight disputes and inventory management confusion caused by weight data errors.

[0042] The package weight identification method in the embodiments of the present application is described above, and the package weight identification device in the embodiments of the present application is described below. Please refer to Figure 8 An embodiment of the package weight identification device in the embodiments of the present application includes: The data acquisition module 801 is configured to acquire a package image sample set, and perform feature labeling on the package image sample set by using a labeling tool to obtain a labeled image sample set. The model construction module 802 is configured to construct an initial package weight identification model, introduce a channel attention module into the initial package weight identification model, and obtain an optimized package weight identification model. The parameter setting module 803 is configured to set model interface parameters of the optimized package weight identification model. The data enhancement module 804 is configured to perform data enhancement processing on the labeled image sample set by using an image enhancement algorithm to obtain a target image sample set. The model training module 805 is configured to perform multi-round iterative training on the optimization package weight recognition model based on the model interface parameters and the target image sample set, to obtain a target package weight recognition model. The recognition module 806 is configured to obtain a to-be-recognized package image, and perform weight recognition on the to-be-recognized package image by using the target package weight recognition model, to obtain target package weight data.

[0043] Based on the same idea as the method in the above embodiment, the device provided in the present application can implement the method of the above embodiment.

[0044] The above Figure 8 The package weight recognition device in the embodiment of the present application is described in detail from the perspective of a modular functional entity, and the package weight recognition device in the embodiment of the present application is described in detail from the perspective of hardware processing.

[0045] Figure 9 FIG. 9 is a structural schematic diagram of a package weight recognition device provided in the embodiment of the present application. The package weight recognition device 900 can be quite different due to different configurations or performances, and can include one or more processors (central processing units, CPUs) 910 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 933 or data 932. The memory 920 and the storage media 930 can be temporary storage or persistent storage. The programs stored in the storage media 930 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the package weight recognition device 900. Further, the processor 910 can be configured to communicate with the storage media 930, and execute the series of instruction operations in the storage media 930 on the package weight recognition device 900, to implement the steps of the package weight recognition method provided in each method embodiment.

[0046] The package weight recognition device 900 can further include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input and output interfaces 960, and / or one or more operating systems 931, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art can understand that Figure 9 The structure of the package weight recognition device shown does not constitute a limitation on the package weight recognition device, and can include more or fewer components than shown, or combine certain components, or different component arrangements.

[0047] The application further provides a computer readable storage medium, which can be a nonvolatile computer readable storage medium or a volatile computer readable storage medium, and the computer readable storage medium stores instructions, and the instructions make a computer execute the steps of the parcel weight identification method when the instructions are run on the computer.

[0048] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system or device, unit can refer to the corresponding processes in the foregoing method embodiments, and will not be described here.

[0049] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0050] Finally, it should be noted that: the above only for the preferred examples of the present application, and not for limiting the present application, although the present application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, it still can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for identifying package weight, characterized in that, include: Obtain a set of package image samples, and use an annotation tool to perform feature annotation on the package image sample set to obtain an annotated image sample set; An initial package weight recognition model is constructed, and a channel attention module is introduced into the initial package weight recognition model to obtain an optimized package weight recognition model; Set the model interface parameters of the optimized package weight recognition model; The labeled image sample set is subjected to data augmentation processing using an image enhancement algorithm to obtain the target image sample set; Based on the model interface parameters, the optimized package weight recognition model is trained in multiple rounds using the target image sample set to obtain the target package weight recognition model. Obtain an image of the package to be identified, and use the target package weight recognition model to identify the weight of the package to be identified, thereby obtaining the target package weight data.

2. The package weight identification method according to claim 1, characterized in that, The step of using an annotation tool to perform feature annotation on the package image sample set to obtain an annotated image sample set includes: Obtain preset classification rules, and classify the package image sample set based on the classification rules to obtain a weighing panoramic image sample set, a dial image sample set, and a waybill image sample set; The annotation tool is used to perform regional feature annotation processing on the weighing panoramic image sample set to obtain a region-annotated image sample set; The pixel feature annotation process of the dial image sample set is performed using the annotation tool to obtain a pixel-annotated image sample set; The annotation tool is used to perform waybill feature annotation processing on the waybill image sample set to obtain a waybill annotated image sample set; The labeled image sample set is obtained by integrating the region labeled image sample set, the pixel labeled image sample set, and the waybill labeled image sample set.

3. The package weight identification method according to claim 1, characterized in that, The initial package weight recognition model includes a feature extraction module and a target detection module, which are connected together. Introducing a channel attention module into the initial package weight recognition model to obtain an optimized package weight recognition model includes: By introducing the channel attention module between the feature extraction module and the target detection module, a preliminary optimized model is obtained. Obtain the preset feature map dimension matching rules; Based on the feature map dimension matching rules, the preliminary optimization model is structurally adapted and adjusted to obtain the optimized package weight recognition model.

4. The package weight identification method according to claim 1, characterized in that, The setting of the model interface parameters for the optimized package weight recognition model includes: The labeled image sample set was subjected to resolution statistical processing using a statistical algorithm to obtain sample resolution data. The input image size parameters of the optimized package weight recognition model are determined and set based on the sample resolution data. The image size information of the labeled image sample set is obtained, and the K-Means clustering algorithm is used to perform cluster analysis on the image size information to determine and set the output anchor frame size parameters of the optimized package weight recognition model.

5. The package weight identification method according to claim 1, characterized in that, The image enhancement algorithm includes an affine transformation algorithm, a pixel grayscale adjustment algorithm, and an image stitching algorithm. The step of using the image enhancement algorithm to perform data enhancement processing on the labeled image sample set to obtain the target image sample set includes: The affine transformation algorithm is used to randomly flip and rotate the labeled image sample set to obtain a preliminary enhanced image sample set; The pixel grayscale value adjustment algorithm is used to perform contrast adjustment processing on the preliminary enhanced image sample set to obtain the illumination-adapted image sample set; The image stitching algorithm described above is used to perform multi-image fusion processing on the illumination-adapted image sample set to obtain the target image sample set.

6. The package weight identification method according to claim 1, characterized in that, The step of performing multiple rounds of iterative training on the optimized package weight recognition model based on the model interface parameters and the target image sample set to obtain the target package weight recognition model includes: Obtain the actual package weight data corresponding to the target image sample set; Based on the model interface parameters, the target image sample set is input into the optimized package weight recognition model for weight recognition to obtain predicted package weight data; The model loss is calculated based on the actual package weight data and the predicted package weight data, resulting in the FocalLoss model loss. Based on the FocalLoss model loss, the weight parameters of the optimized package weight recognition model are iteratively updated using the backpropagation algorithm. When the preset iteration stopping condition is met, the target package weight recognition model is output.

7. The package weight identification method according to claim 1, characterized in that, After using the target package weight recognition model to identify the weight of the package image and obtain the target package weight data, the method further includes: Obtain the preset theoretical package weight data; The deviation value is obtained by calculating the deviation based on the theoretical package weight data and the target package weight data; A preset deviation threshold is obtained, and the deviation threshold is compared with the deviation value. When the deviation value is less than or equal to the deviation threshold, the target package weight data is confirmed as valid data.

8. A package weight recognition device, characterized in that, include: Data acquisition module: used to acquire a package image sample set, and to use an annotation tool to perform feature annotation on the package image sample set to obtain an annotated image sample set; Model building module: used to build an initial package weight recognition model. A channel attention module is introduced into the initial package weight recognition model to obtain an optimized package weight recognition model. Parameter setting module: Used to set the model interface parameters of the optimized package weight recognition model; Data augmentation module: used to perform data augmentation processing on the labeled image sample set using image augmentation algorithms to obtain the target image sample set; Model training module: used to perform multiple rounds of iterative training on the optimized package weight recognition model based on the model interface parameters and the target image sample set, so as to obtain the target package weight recognition model; Recognition module: used to acquire an image of the package to be identified, and to use the target package weight recognition model to identify the weight of the package image to obtain the target package weight data.

9. A package weight recognition device, characterized in that, The package weight recognition device includes: a memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause the package weight identification device to perform the steps of the package weight identification method as described in any one of claims 1-7.

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