Parcel feature recognition method, device and equipment and storage medium

By combining cascaded regional convolutional neural networks and attention modules, the shortcomings of package feature recognition in logistics sorting are solved, achieving efficient and accurate package sorting, reducing manual intervention and error rates, and improving logistics operation efficiency.

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

Patent Information

Application Number
CN202511712701.2
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 sorting technologies lack in-depth detection and effective analysis of key details such as package appearance and packaging labels, resulting in frequent sorting errors, low efficiency, reliance on manual operation, and significant influence from subjective factors, making it difficult to adapt to business scale and complex package characteristics.

Method used

A package feature recognition model is constructed using a cascaded regional convolutional neural network. An attention module is introduced, and combined with image enhancement algorithms and multiple rounds of iterative training, the model achieves accurate recognition of package features, including feature annotation, data augmentation, and model optimization.

Benefits of technology

It improves the accuracy of package sorting, reduces missorting, reduces reliance on manual sorting, and enhances operational efficiency and customer satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582641A_ABST
    Figure CN121582641A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent logistics, in particular to a parcel feature 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, and obtaining a labeled image sample set; constructing an initial parcel feature recognition model based on the cascaded region convolutional neural network, introducing an attention module into the initial parcel feature recognition model to obtain an optimized parcel feature recognition model, and then performing data enhancement processing on a labeled image sample set by adopting an image enhancement algorithm to obtain a labeled image sample set; and performing multi-round iterative training on the optimized parcel feature recognition model by using the obtained target image sample set to obtain a target parcel feature recognition model, finally obtaining a to-be-recognized parcel image, performing feature recognition on the to-be-recognized parcel image by using the target parcel feature recognition model to obtain target parcel feature data, and storing the target parcel feature data in a database. Workers can classify the parcels according to detailed features of the parcels, and the sorting accuracy is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent logistics technology, and in particular to a method, apparatus, device, and storage medium for package feature identification. Background Technology

[0002] In the modern logistics industry, parcel sorting, as a core link in the express delivery chain, directly impacts the operational efficiency and customer service experience of logistics companies. With the rapid development of e-commerce, logistics volume has exploded, and parcel specifications, packaging types, and appearance characteristics have become increasingly diverse, constantly raising the bar for the precision and intelligence of the sorting process. However, current mainstream parcel sorting technologies still have significant limitations. Their core detection dimensions focus on basic physical attributes such as weight and volume, lacking in-depth detection and effective analysis of key details such as parcel appearance and packaging labels.

[0003] This technological limitation makes it difficult to accurately classify packages based on their complete attributes, leading to frequent sorting errors, misdeliveries, and omissions. This not only increases the cost of reverse logistics processing but also severely impacts overall operational efficiency and customer satisfaction. Meanwhile, traditional sorting methods still rely to some extent on manual operation. Manual sorting is not only inefficient and labor-intensive but also prone to judgment bias due to subjective factors, making it difficult to adapt to the ever-increasing scale of business and the complex characteristics of packages. Summary of the Invention

[0004] In order to overcome the shortcomings of the prior art, the present invention aims to provide a package feature identification method, device, equipment and storage medium, which reduces the reliance on manual sorting, reduces labor costs and sorting workload, and improves the efficiency of logistics package sorting.

[0005] The first aspect of this invention provides a package feature recognition method, comprising: acquiring a package image sample set; using an annotation tool to annotate the package image sample set to obtain an annotated image sample set; constructing an initial package feature recognition model based on a cascaded region convolutional neural network; introducing an attention module into the initial package feature recognition model to obtain an optimized package feature recognition model; using an image enhancement algorithm to perform data enhancement processing on the annotated image sample set to obtain a target image sample set; using the target image sample set to perform multiple rounds of iterative training on the optimized package feature recognition model to obtain a target package feature recognition model; acquiring a package image to be recognized; and using the target package feature recognition model to perform feature recognition on the package image to be recognized to obtain target package feature data.

[0006] Optionally, in a first implementation of the first aspect of the present invention, 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: obtaining a preset special package identification rule; classifying the package image sample set based on the special package identification rule to obtain a normal package image sample set and a special package image sample set; using the annotation tool to perform special identification annotation on the special package image sample set to obtain a special marked image sample set; obtaining a preset feature marking rule; and using the annotation tool to perform physical feature annotation, appearance feature annotation, and packaging feature annotation on the normal package image sample set and the special marked image sample set according to the feature marking rule to obtain the annotated image sample set.

[0007] Optionally, in a second implementation of the first aspect of the present invention, the initial package feature recognition model includes a backbone feature extraction module, which includes a final feature extraction layer and a global average pooling layer, the final feature extraction layer and the global average pooling layer being connected; the step of introducing an attention module into the initial package feature recognition model to obtain an optimized package feature recognition model includes: introducing the attention module between the final feature extraction layer and the global average pooling layer to obtain a preliminary optimized model; obtaining a preset feature map dimension matching rule; and performing structural adaptation adjustment processing on the preliminary optimized model based on the feature map dimension matching rule to obtain the optimized package feature recognition model.

[0008] Optionally, in a third implementation of the first aspect of the present invention, 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 a target image sample set includes: using the affine transformation algorithm to randomly flip and rotate the labeled image sample set to obtain a preliminary enhanced image sample set; using the pixel grayscale adjustment algorithm to perform contrast adjustment processing on the preliminary enhanced image sample set to obtain a lighting-adapted image sample set; and using the image stitching algorithm to perform multi-image fusion processing on the lighting-adapted image sample set to obtain the target image sample set.

[0009] Optionally, in a fourth implementation of the first aspect of the present invention, the step of using the target image sample set to perform multiple rounds of iterative training on the optimized package feature recognition model to obtain the target package feature recognition model includes: acquiring actual package feature data corresponding to the target image sample set; inputting the target image sample set into the optimized package feature recognition model to perform package feature recognition and obtain predicted package feature data; calculating the model loss based on the actual package feature data and the predicted package feature data to obtain the Focal Loss model loss; calculating the gradient of the parameters in the optimized package feature recognition model using the backpropagation algorithm based on the Focal Loss model loss to obtain multiple parameter gradients; using the AdamW optimizer to iteratively update the weight parameters of the optimized package feature recognition model according to the multiple parameter gradients; and outputting the target package feature recognition model when a preset iteration stopping condition is met.

[0010] Optionally, in a fifth implementation of the first aspect of the present invention, the target package feature recognition model further includes a three-level cascaded detection module and a global feature extraction module, wherein the backbone feature extraction module, the three-level cascaded detection module, and the global feature extraction module are connected sequentially; the step of using the target package feature recognition model to perform feature recognition on the image of the package to be identified to obtain target package feature data includes: performing multi-scale feature extraction processing on the image of the package to be identified based on the backbone feature extraction module to obtain a multi-scale high-dimensional feature map; inputting the multi-scale high-dimensional feature map into the three-level cascaded detection module for cascaded detection processing to obtain a target candidate region and target local features; and inputting the target candidate region and the target local features into the global feature extraction module for global feature extraction processing to obtain the target package feature data.

[0011] Optionally, in a sixth implementation of the first aspect of the present invention, the three-stage cascaded detection module includes a first-stage detection submodule, a second-stage detection submodule, and a third-stage detection submodule, which are sequentially connected. The step of inputting the multi-scale high-dimensional feature map into the three-stage cascaded detection module for cascaded detection processing to obtain a target candidate region and corresponding local features includes: inputting the multi-scale high-dimensional feature map into the first-stage detection submodule for sliding window traversal processing and candidate region generation processing to obtain an initial candidate region and initial local features; inputting the initial candidate region and initial local features into the second-stage detection submodule for classification accuracy optimization processing and bounding box position correction processing to obtain an optimized candidate region and optimized local features; and inputting the optimized candidate region and optimized local features into the third-stage detection submodule for classification result confirmation processing and bounding box coordinate refinement processing to obtain the target candidate region and the target local features.

[0012] A second aspect of the present invention provides a package feature recognition device, comprising: a data acquisition module for acquiring a package image sample set and using an annotation tool to annotate the package image sample set to obtain an annotated image sample set; a model building module for constructing an initial package feature recognition model based on a cascaded region convolutional neural network; a model optimization module for introducing an attention module into the initial package feature recognition model to obtain an optimized package feature recognition model; a data augmentation module for performing data augmentation processing on the annotated image sample set using an image augmentation algorithm to obtain a target image sample set; a model training module for performing multiple rounds of iterative training on the optimized package feature recognition model using the target image sample set to obtain a target package feature recognition model; and a recognition module for acquiring a package image to be recognized and using the target package feature recognition model to perform feature recognition on the package image to be recognized to obtain target package feature data.

[0013] A third aspect of the present invention provides a package feature recognition device, the package feature recognition device comprising: a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to cause the package feature recognition device to perform the various steps of the package feature recognition method described in any of the preceding claims.

[0014] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the steps of the package feature recognition method described in any of the preceding claims.

[0015] In the technical solution of this invention, firstly, a set of package image samples is acquired, and the package image sample set is labeled with features using a labeling tool to obtain a labeled image sample set. Then, an initial package feature recognition model is constructed based on a cascaded region convolutional neural network. An attention module is introduced into the initial package feature recognition model to obtain an optimized package feature recognition model. Next, an image enhancement algorithm is used to perform data enhancement processing on the labeled image sample set to obtain a target image sample set. The optimized package feature recognition model is then trained iteratively multiple times using the target image sample set to obtain a target package feature recognition model. Finally, images of packages to be identified are acquired, and the target package feature recognition model is used to perform feature recognition on the images of packages to be identified to obtain target package feature data. This allows staff to classify packages according to their detailed features, effectively improving sorting accuracy, reducing package misclassification, and enhancing customer satisfaction. Attached Figure Description

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

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

[0018] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the package feature recognition method in this invention includes: 101. Obtain a package image sample set, and use an annotation tool to perform feature annotation on the package image sample set to obtain an annotated image sample set; In this embodiment, the data collection process comprehensively covers package types corresponding to various logistics channels. This ensures that the sample library includes not only regular packages of different specifications such as small, medium, and large items, but also packages with special attributes such as dampness, damage, and special markings. This fully replicates the diversity of package characteristics in actual logistics scenarios, comprehensively covering package samples of multiple specifications, scenarios, and special attributes. This effectively avoids model bias caused by sample homogeneity and provides a rich and realistic data source for subsequent model training. After sample collection, professional annotation tools are used for feature annotation. Commonly used tools include LabelImg, VGGImage Annotator, and LabelBox. The annotation process strictly follows standardized operating procedures to ensure that all annotation content forms an accurate mapping with the corresponding sample image. At the same time, the annotation accuracy is controlled at the pixel level. The final annotated image sample set ensures the accuracy and reliability of the annotation information, provides supervision signals for the model to learn key information such as package appearance features and packaging markings, ensures the consistency and usability of the sample set, improves the training effect and generalization ability of the subsequent package feature recognition model, and provides solid data support for the intelligent upgrade of the logistics sorting process, helping to reduce sorting error rates and improve operational efficiency.

[0019] 102. Construct an initial package feature recognition model based on a cascaded region convolutional neural network; In this embodiment, Cascade R-CNN is a deep learning-based object detection framework. Its core advantage lies in its multi-stage cascaded detection structure, which progressively optimizes the accuracy and robustness of object recognition, making it particularly suitable for the diverse package sizes and complex scenarios required in logistics. This network, with a cascaded detector as its core architecture, overcomes the limitations of traditional single-stage detection models in candidate region selection and optimization. Through multi-stage progressively improving selection criteria and refined model design, it achieves accurate target localization and classification. Structurally, Cascade R-CNN comprises three core modules: a backbone feature extraction network, a region proposal network, and a multi-stage cascaded detection head. The backbone network is responsible for extracting multi-scale, high-dimensional semantic features from the input image, providing a feature foundation rich in detailed information for subsequent detection. The region proposal network, as the first-stage detection module, generates preliminary candidate regions by traversing the feature map through a sliding window and filters background regions using a low intersection-over-union (IOU) threshold, efficiently selecting potential targets. Subsequent multi-stage detection heads then use more refined classifiers and bounding box regressors in sequence, gradually increasing the IOU filtering threshold, iteratively optimizing the candidate regions output from the previous stage, continuously correcting the target position and classification results, and ultimately achieving high-precision target detection.

[0020] 103. An attention module is introduced into the initial package feature recognition model to obtain an optimized package feature recognition model; In this embodiment, to further enhance the model's ability to capture the correlation between global features and contextual information, an attention module based on a self-attention mechanism is introduced into the initial package feature recognition model to construct an optimized package feature recognition model. This attention module employs a deep fusion design, relying on a multi-head self-attention mechanism to enhance features. The module has eight independent attention heads, each capable of focusing on different dimensions of package features. For example, some attention heads focus on the packaging material texture and overall shape, while others focus on key information such as the location of markings. By calculating the correlation weights between features, a precise mapping relationship between local and global features of the package is established. To balance model performance and computational efficiency and avoid excessive computational burden from the attention module, a convolutional layer with a stride of 2 is used before the module input to downsample the feature map output by the backbone network, reducing the feature map size to one-quarter of its original size. Simultaneously, residual connections and layer normalization operations are added before and after the attention module to effectively prevent the vanishing gradient problem during model training. This ensures that global and local features are deeply integrated without interference, allowing the model to retain the core advantage of Cascade R-CNN's progressive accuracy improvement while compensating for the shortcomings of traditional models in utilizing contextual information through global feature association reinforcement. The multi-head self-attention mechanism can fully exploit the contextual relationships between package features. When a package is partially occluded, the model can infer the attributes of the occluded area through the label features and material features of the unoccluded area, effectively avoiding the feature misjudgment problem caused by local occlusion in traditional convolutional neural networks. For complex situations such as package stacking and large size differences common in logistics scenarios, the attention module's strong ability to capture global features allows the model to overcome the limitations of local features, integrating multi-dimensional information from a holistic perspective, significantly improving the accuracy and robustness of feature recognition.

[0021] Furthermore, to ensure the optimized package feature recognition model has good adaptability and training stability in real-world logistics scenarios, the model interface parameters need to be systematically configured. Regarding the output anchor box parameter settings, a customized design is implemented based on the actual size distribution patterns of package samples. Three core scales—128×128 pixels, 256×256 pixels, and 512×512 pixels—are selected, combined with aspect ratios of 1:1, 1:2, and 2:1 to form a multi-dimensional anchor box set. This comprehensively covers different package types, including small, medium, and large items, ensuring the model can accurately match the morphological features of various packages during the candidate region generation stage, avoiding missed or false detections due to insufficient anchor box adaptability. In terms of basic training parameter configuration, the input image size is fixed at 800×1000 pixels. Standardizing the image size ensures the consistency and stability of feature extraction. The batch processing size is set to 8, which balances hardware computing load and training efficiency while ensuring that the model can fully learn the sample feature distribution. The initial learning rate is set to 0.001 to provide a reasonable gradient descent step size for iterative updates of model parameters, helping the model to converge quickly to the optimal solution and reducing oscillations during training.

[0022] 104. The labeled image sample set is subjected to data augmentation processing using an image enhancement algorithm to obtain the target image sample set; In this embodiment, to improve the model's generalization ability and robustness, and to adapt to the diversity and complexity of package images in logistics scenarios, an image enhancement algorithm including geometric transformation, pixel adjustment, and mosaic enhancement is adopted to systematically enhance the labeled image sample set, ultimately obtaining the target image sample set. Specifically, geometric transformation simulates the posture changes and shooting angle differences that packages may experience in actual sorting scenarios through operations such as random cropping, flipping, rotation, and scaling, such as packages being tilted or partially included in the frame, effectively expanding the posture distribution range of the samples; pixel adjustment performs random fine-tuning of the image's brightness, contrast, saturation, and hue, while introducing random noise addition to simulate environmental interference factors such as different lighting conditions, differences in shooting equipment, and packaging stains, enhancing the model's adaptability to pixel-level changes; mosaic enhancement stitches four different package images into a new image at random proportions, increasing the background complexity and target density of the samples while retaining the original annotation information of each image, enabling the model to learn the feature patterns of complex scenarios such as multiple overlapping packages and mixed backgrounds during training. Diverse augmentation operations effectively expand the quantity and distribution dimensions of the sample set, avoiding overfitting problems caused by a single sample and improving the model's generalization ability in practical applications.

[0023] 105. The optimized package feature recognition model is trained iteratively multiple times using the target image sample set to obtain the target package feature recognition model; In this embodiment, the training process strictly follows the standardized workflow of deep learning model training. First, the target image sample set is divided into a training set, a validation set, and a test set according to a preset ratio. The training set is used for forward learning and gradient updates of model parameters, the validation set is used to monitor the generalization performance of the model during training in real time, and the test set is used to finally evaluate the model's overall detection performance. During training, training set samples are input into the model in batches. The model, through the collaborative work of the backbone feature extraction module, the three-level cascaded detection module, and the attention module, completes the extraction, optimization, and global correlation modeling of package features, outputting predicted package feature data. Subsequently, based on the prediction results and actual package feature data, the Focal Loss value is calculated to adapt to the class imbalance scenario in logistics package detection. Then, the gradient of each parameter is solved using the backpropagation algorithm, and the AdamW optimizer is used to iteratively update the model weight parameters, gradually reducing the training loss. After each iteration, the model performance is evaluated using the validation set, and training strategies such as the learning rate are dynamically adjusted. If the validation loss continuously increases, the current training is terminated in time to avoid overfitting, ensuring that the model maintains good generalization ability while improving training accuracy. Training is conducted using a rich and diverse set of target image samples, enabling the model to fully learn the feature patterns of packages of different specifications, scenarios, and attributes, effectively improving the model's adaptability to complex logistics scenarios. Gradient updates and parameter optimizations during multiple iterations allow the model to gradually correct initial parameter deviations and continuously approach the optimal parameter combination, significantly improving the accuracy of package feature recognition, including bounding box positioning accuracy, feature category determination accuracy, and confidence reliability.

[0024] 106. Obtain an image of the package to be identified, and use the target package feature recognition model to perform feature recognition on the image of the package to be identified to obtain target package feature data.

[0025] In this embodiment, images of packages awaiting sorting at the distribution center are acquired using an image acquisition device. This ensures the images are clear and completely cover the package's main body and key appearance information. The images are then input into a trained target package feature recognition model to perform full-process feature recognition processing to obtain target package feature data. Specifically, the package image undergoes standardization preprocessing, adjusting it to the model's preset input size and normalizing pixels to ensure consistent feature extraction. The preprocessed image is then input into the target package feature recognition model, which outputs target package feature data including precise bounding box coordinates, feature category labels, and category confidence levels. This data comprehensively covers key information such as package specifications (e.g., weight, volume), appearance features (e.g., color, shape), packaging information (e.g., packaging material, packaging brand), and special markings (e.g., dampness, damage). The target package feature recognition model, after multiple rounds of iterative training and structural optimization, possesses powerful feature capture capabilities and anti-interference performance. It can accurately handle issues such as diverse package specifications, stacking and occlusion, and complex environments in logistics scenarios, ensuring the accuracy and reliability of feature recognition results. The output target package feature data is comprehensive and accurate, providing core data support for subsequent intelligent sorting, route planning, and damage detection of packages. This helps logistics companies achieve intelligent upgrades in sorting processes, reduce the error rate and labor intensity of manual sorting, lower operating costs, and improve the timeliness and customer satisfaction of express delivery.

[0026] This application discloses a package feature recognition method. First, a package image sample set is acquired. Then, a labeling tool is used to annotate the package image sample set to obtain a labeled image sample set. Next, an initial package feature recognition model is constructed based on a cascaded region convolutional neural network. An attention module is introduced into the initial package feature recognition model to obtain an optimized package feature recognition model. Then, an image enhancement algorithm is used to perform data enhancement processing on the labeled image sample set to obtain a target image sample set. The optimized package feature recognition model is then trained iteratively using the target image sample set to obtain a target package feature recognition model. Finally, images of packages to be recognized are acquired, and the target package feature recognition model is used to perform feature recognition on the images of the packages to be recognized to obtain target package feature data. This allows staff to classify packages based on detailed features, effectively improving sorting accuracy, reducing package misclassification, and enhancing customer satisfaction.

[0027] Please see Figure 2 In this embodiment of the invention, 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: 201. Obtain preset special package recognition rules, and classify the package image sample set based on the special package recognition rules to obtain a normal package image sample set and a special package image sample set; 202. Use the annotation tool to perform special labeling on the special package image sample set to obtain a special labeled image sample set; 203. Obtain the preset feature labeling rules, and use the labeling tool to perform physical feature labeling, appearance feature labeling, and packaging feature labeling on the normal package image sample set and the special labeling image sample set according to the feature labeling rules, so as to obtain the labeled image sample set.

[0028] In this embodiment, to achieve accurate labeling and classification management of multi-dimensional features of packages, a preset special package identification rule is first obtained. This rule is based on the logistics industry's definition standards for special packages, covering key judgment conditions such as dampness, damage, and the presence of special shipping markings. Based on this rule, the collected package image sample set is systematically classified, and samples meeting the special package judgment criteria and regular samples are selected, resulting in normal package image sample sets and special package image sample sets, ensuring the relevance and rationality of sample classification. For the special package image sample set, a professional labeling tool is used for specialized labeling, accurately marking the location and attributes of the differentiated features of special packages, forming a specially marked image sample set. This provides clear supervisory signals for the model to learn the distinguishing features of special packages. Subsequently, pre-defined feature labeling rules were obtained. These rules clarified the specific labeling dimensions for physical features, appearance features, and packaging features. Physical features encompass basic attributes such as package size and shape; appearance features include visual information such as texture, color, and local details; and packaging features involve key aspects such as packaging material, integrity, and logo patterns. Based on these rules, professional labeling tools were used to comprehensively label both the normal package image sample set and the specially labeled image sample set, ensuring that the core features of all samples were accurately labeled. This resulted in a structurally complete and information-rich labeled image sample set. The pre-defined rules enabled accurate classification and targeted labeling of samples, allowing the labeled image sample set to cover both the general features of normal packages and the differentiated attributes of special packages, enriching the feature dimensions and representativeness of the samples. The combination of specialized labels for special packages and multi-dimensional feature labels provided the model with more detailed and comprehensive supervisory information, helping the model accurately learn the feature differences between normal and special packages and improving the sensitivity and accuracy of special package recognition.

[0029] Please see Figure 3 In this embodiment of the invention, the initial package feature recognition model includes a backbone feature extraction module, which includes a final feature extraction layer and a global average pooling layer, and the final feature extraction layer and the global average pooling layer are connected; the step of introducing an attention module into the initial package feature recognition model to obtain an optimized package feature recognition model includes: 301. Introduce the attention module between the final feature extraction layer and the global average pooling layer to obtain a preliminary optimized model; 302. Obtain the preset feature map dimension matching rules; 303. Based on the feature map dimension matching rules, the preliminary optimization model is subjected to structural adaptation and adjustment processing to obtain the optimized package feature recognition model.

[0030] In this embodiment, the initial package feature recognition model includes a backbone feature extraction module, which comprises a final feature extraction layer and a global average pooling layer, connected sequentially. The final feature extraction layer is responsible for outputting a high-dimensional final feature map of the package, while the global average pooling layer performs dimensionality compression and feature aggregation on this feature map, providing adaptive feature input for subsequent classification tasks. An attention module is embedded between the final feature extraction layer and the global average pooling layer of the initial package feature recognition model to form a preliminary optimized model, specifically between the last two layers (layer 4 and layer 5) of the backbone feature extraction module. This allows for direct global correlation modeling of the high-dimensional final features, effectively strengthening the mapping relationship between local and global features and contextual information of the package. This overcomes the limitation of traditional convolutional networks relying on local receptive fields, which leads to insufficient global information capture, and improves the model's adaptability to complex scenarios such as occlusion and stacking. Subsequently, a preset feature map dimension matching rule is obtained. This rule is based on the input and output dimension requirements of the attention module, the output feature map specifications of the final feature extraction layer, and the input adaptation standard of the global average pooling layer. It covers core adaptation logic such as feature map channel number adjustment and size normalization. Based on this rule, the preliminary optimized model is structurally adapted and adjusted. By adding adaptive convolutional layers or adjusting the feature map dimension, it is ensured that the feature map output by the final feature extraction layer can meet the input requirements of the attention module. At the same time, the globally correlated feature map output by the attention module can be seamlessly connected to the global average pooling layer. Finally, an optimized wrapper feature recognition model with structural compatibility and smooth feature transfer is formed. This ensures high compatibility between the new module and the original model architecture, avoids dimension mismatch or information loss problems during feature transfer, and ensures the effective integration of global feature enhancement and the advantages of the original feature extraction. Please see Figure 4 In this embodiment of the invention, the image enhancement algorithm includes an affine transformation algorithm, a pixel grayscale value 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: 401. The labeled image sample set is randomly flipped and rotated using the affine transformation algorithm to obtain a preliminary enhanced image sample set; 402. 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; 403. The image stitching algorithm described above is used to perform multi-image fusion processing on the illumination adaptation image sample set to obtain the target image sample set.

[0031] In this embodiment, to improve the model's generalization ability and adaptability to complex scenes, the image enhancement algorithm encompasses affine transformation, pixel grayscale adjustment, and image stitching algorithms. Through a phased, progressive processing, the system's data enhancement is achieved on the labeled image sample set, ultimately yielding the target image sample set. Specifically, firstly, an affine transformation algorithm is used to randomly flip and rotate the labeled image sample set. The random flipping includes both horizontal and vertical directions, and the rotation angle is randomly selected within a reasonable range. This simulates the visual changes caused by different placement postures and shooting angles of packages in actual sorting scenarios, achieving geometric transformation to expand the diversity of sample postures and obtaining a preliminary enhanced image sample set. This effectively expands the dimension of sample posture distribution, enabling the model to learn the characteristic patterns of packages under different placement states during training, reducing recognition bias caused by a single posture. Next, a pixel grayscale adjustment algorithm is used to perform contrast adjustment processing on the preliminary enhanced image sample set. By dynamically adjusting the range of image pixel grayscale distribution, different lighting conditions and shooting angles are simulated. The visual effects of package images under different device light sensitivity were analyzed, and pixel-level feature adaptation optimization was completed to form a lighting-adapted image sample set. This enhanced the model's adaptability to environmental interference such as lighting changes and device differences, and improved the stability of pixel-level feature recognition. Finally, an image stitching algorithm was used to perform multi-image fusion processing on the lighting-adapted image sample set. Four different package images were selected and stitched into a single image according to random proportions and positions. At the same time, it was ensured that the annotation information of each original image was accurately mapped to the corresponding area after stitching. This achieved mosaic enhancement to improve the complexity of the sample background and the density of the target. Finally, a target image sample set was generated, which not only increased the number of samples, but also simulated complex scenes of package stacking and dense distribution, and strengthened the model's ability to handle multiple targets and complex backgrounds.

[0032] Please see Figure 5 In this embodiment of the invention, the step of performing multiple rounds of iterative training on the optimized package feature recognition model using the target image sample set to obtain the target package feature recognition model includes: 501. Obtain the actual package feature data corresponding to the target image sample set; 502. Input the target image sample set into the optimized package feature recognition model to perform package feature recognition and obtain predicted package feature data; 503. Calculate the model loss based on the actual package feature data and the predicted package feature data to obtain the Focal Loss model loss; 504. Based on the Focal Loss model loss, the gradient of the parameters in the optimized package feature recognition model is calculated using the backpropagation algorithm to obtain multiple parameter gradients; 505. Using the AdamW optimizer, the weight parameters of the optimized package feature recognition model are iteratively updated based on multiple parameter gradients; 506. When the preset iteration stopping condition is met, output the target package feature recognition model.

[0033] In this embodiment, firstly, actual package feature data corresponding one-to-one with the target image sample set is acquired. This data includes the true bounding box coordinates, category labels, and special attribute identifiers of the packages, providing an accurate supervision benchmark for model training. Then, the target image sample set is input into the optimized package feature recognition model to complete package feature extraction, global association, and accurate recognition, outputting predicted package feature data containing predicted bounding boxes, category probabilities, and confidence scores. Based on the actual package feature data and the predicted package feature data, the model loss is calculated. Focal Loss is used as the loss function to address the class imbalance problem in package samples. Specifically, the alpha parameter is set to balance the weight ratio of positive and negative samples, effectively reducing the interference of a large number of background samples and common package samples on the loss calculation. Simultaneously, the gamma parameter is set to increase the loss weight of difficult-to-distinguish samples, forcing the model to focus more on feature learning of minority special package samples and difficult-to-distinguish samples during training. Finally, the Focal Loss model loss is obtained, accurately solving the class imbalance problem caused by too many background samples and too few special package samples in the package sample set, strengthening the model's feature learning of minority and difficult-to-distinguish samples, and improving the recognition sensitivity of special packages. Based on this loss value, the gradients of each weight parameter in the package feature recognition model are calculated layer by layer using the backpropagation algorithm, resulting in multiple parameter gradients. The AdamW optimizer, combined with a cosine annealing learning rate scheduling strategy, is used to iteratively update the model weight parameters according to each parameter gradient. The cosine annealing strategy periodically adjusts the learning rate to ensure the step size and efficiency of parameter updates in the early stages of training, and gradually reduces the learning rate in the later stages to achieve accurate convergence. The total training epochs are set to 100. The preset iteration stopping condition is that the mean accuracy of the validation set shows no improvement for five consecutive epochs. When this condition is met, training stops, outputting a stable target package feature recognition model. This effectively prevents overfitting and ensures that the output target package feature recognition model has good generalization ability.

[0034] Please see Figure 6In this embodiment of the invention, the target package feature recognition model further includes a three-level cascaded detection module and a global feature extraction module, wherein the backbone feature extraction module, the three-level cascaded detection module, and the global feature extraction module are connected sequentially; the step of using the target package feature recognition model to perform feature recognition on the image of the package to be recognized to obtain target package feature data includes: 601. Based on the backbone feature extraction module, perform multi-scale feature extraction processing on the image of the package to be identified to obtain a multi-scale high-dimensional feature map; 602. Input the multi-scale high-dimensional feature map into the three-level cascaded detection module to perform cascaded detection processing to obtain the target candidate region and target local features; 603. Input the target candidate region and the target local features into the global feature extraction module to perform global feature extraction processing and obtain the target package feature data.

[0035] In this embodiment, firstly, the backbone feature extraction module performs multi-scale feature extraction processing on the image of the package to be identified. This module uses convolution and pooling operations of a deep network structure to extract feature information from different levels of the image, from low-dimensional texture and mid-dimensional contour to high-dimensional semantics. Simultaneously, through a multi-scale feature fusion mechanism, it integrates feature representations and finally outputs a multi-scale high-dimensional feature map covering package details and overall features, providing a solid feature foundation for subsequent detection tasks. Next, the multi-scale high-dimensional feature map is input into a three-level cascaded detection module for cascaded detection processing. This module first generates preliminary candidate regions through a region proposal network and filters background interference. Then, through multi-stage progressively improving screening criteria and refined regression optimization, it continuously corrects the positional accuracy and classification reliability of the candidate regions, ultimately selecting target candidate regions with accurate positioning and clear classification. Simultaneously, it extracts the corresponding target local features of these regions, covering key package details, local identifiers, and other core information, effectively improving the positioning accuracy and classification reliability of the target candidate regions and reducing background interference and false detection risks. Finally, the target candidate region and target local features are input into the global feature extraction module for global feature extraction processing. This module, through a global correlation modeling mechanism, explores the intrinsic relationship between target local features and global image context information, making up for the limitations of local features and integrating them to form a comprehensive feature expression that includes multi-dimensional information such as package specifications, appearance features, special markings, and global morphology. The final output is target package feature data with complete structure and comprehensive information. In complex scenarios such as packages with occlusion or irregular shapes, it can fill in feature gaps through global context information, improving the robustness of feature recognition. The output target package feature data is comprehensive and reliable, providing core data support for subsequent intelligent sorting, classification management and other logistics links, and helping to improve sorting efficiency and accuracy.

[0036] Please see Figure 7In this embodiment of the invention, the three-stage cascaded detection module includes a first-stage detection submodule, a second-stage detection submodule, and a third-stage detection submodule, which are sequentially connected. The step of inputting the multi-scale high-dimensional feature map into the three-stage cascaded detection module for cascaded detection processing to obtain the target candidate region and the local features corresponding to the target candidate region includes: 701. Input the multi-scale high-dimensional feature map into the first stage detection submodule to perform sliding window traversal processing and candidate region generation processing to obtain initial candidate regions and initial local features; 702. Input the initial candidate region and the initial local features into the second stage detection submodule to perform classification accuracy optimization processing and bounding box position correction processing to obtain optimized candidate regions and optimized local features; 703. Input the optimized candidate region and the optimized local features into the third-stage detection submodule for classification result confirmation processing and bounding box coordinate refinement processing to obtain the target candidate region and the target local features.

[0037] In this embodiment, the three-stage cascaded detection module has a core architecture consisting of a first-stage detection submodule, a second-stage detection submodule, and a third-stage detection submodule. The three are connected sequentially according to the logic of progressive detection accuracy. The first-stage detection submodule corresponds to the region proposal network, while the second and third-stage detection submodules are respectively configured with more refined classifiers and bounding box regressors, forming a layer-by-layer optimized detection link. First, the multi-scale high-dimensional feature map is input into the first-stage detection submodule. A sliding window is used to traverse the feature map, combined with a preset intersection-union (IU) threshold (e.g., set to 0.1), to generate initial candidate regions containing potential packages. Simultaneously, corresponding initial local features are extracted. The core function of this stage is to quickly filter out a large number of background regions, reducing the computational load of subsequent detection. Next, the initial candidate regions and initial local features are input into the second-stage detection submodule. A refined classifier optimizes the classification accuracy, and a bounding box regressor corrects the region coordinates. The IU threshold is increased to 0.6 to filter out optimized candidate regions that better fit the actual packages, and optimized local features with improved accuracy are output simultaneously. Finally, the optimized candidate regions and optimized local features are input into the third-stage detection submodule. A high-precision classifier confirms the classification results, and a bounding box regressor further refines the coordinate parameters. The IU threshold is increased to 0.7 for rigorous filtering, ultimately yielding clearly classified and precisely located target candidate regions and their corresponding high-dimensional local features. The hierarchical and progressive detection architecture, along with the progressively increasing intersection-union (IU) threshold, enables dynamic optimization of candidate regions. This not only reduces computational costs by quickly filtering the background in the first stage but also continuously improves detection accuracy through the refined processing in the latter two stages. This effectively solves the problem of insufficient recognition capabilities of traditional detection models for blurry or occluded packages.

[0038] The package feature recognition method in the embodiments of the present invention has been described above. The package feature recognition device in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 8 One embodiment of the package feature recognition device in this invention includes: Data acquisition module 801: 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 802: Used to build an initial package feature recognition model based on a cascaded region convolutional neural network; Model optimization module 803: used to introduce an attention module into the initial package feature recognition model to obtain an optimized package feature recognition model; Data augmentation module 804: used to perform data augmentation processing on the labeled image sample set using an image augmentation algorithm to obtain a target image sample set; Model training module 805: used to perform multiple rounds of iterative training on the optimized package feature recognition model using the target image sample set to obtain the target package feature recognition model; Recognition module 806: Used to acquire an image of a package to be identified, and to perform feature recognition on the image of the package to be identified using the target package feature recognition model to obtain target package feature data.

[0039] Based on the same ideas as the methods in the above embodiments, the apparatus provided in this application can implement the methods in the above embodiments.

[0040] above Figure 8 The package feature recognition device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The package feature recognition device in this embodiment of the invention will be described in detail from the perspective of hardware processing.

[0041] Figure 9 This is a schematic diagram of the structure of a package feature recognition device 900 provided in an embodiment of the present invention. The package feature recognition device 900 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 910 (e.g., one or more processors) and a memory 920, and one or more storage media 930 (e.g., one or more mass storage devices) for storing application programs 933 or data 932. The memory 920 and storage media 930 can be temporary or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the package feature recognition device 900. Furthermore, the processor 910 may be configured to communicate with the storage media 930 and execute the series of instruction operations in the storage media 930 on the package feature recognition device 900 to implement the steps of the package feature recognition method provided in the above-described method embodiments.

[0042] The package feature recognition device 900 may also include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input / output interfaces 960, and / or one or more operating systems 931, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 9 The illustrated package feature recognition device structure does not constitute a limitation on the package feature recognition device, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0043] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the package feature recognition method.

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

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

[0046] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for identifying package features, 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 feature recognition model was constructed based on a cascaded region convolutional neural network. An attention module is introduced into the initial package feature recognition model to obtain an optimized package feature 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; The optimized package feature recognition model is trained iteratively using the target image sample set to obtain the target package feature recognition model. An image of the package to be identified is acquired, and the target package feature recognition model is used to perform feature recognition on the image of the package to be identified to obtain target package feature data.

2. The package feature recognition 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 special package recognition rules, and classify the package image sample set based on the special package recognition rules to obtain a normal package image sample set and a special package image sample set; The special package image sample set is specially labeled using the labeling tool to obtain a specially labeled image sample set; Obtain preset feature labeling rules, and use the labeling tool to perform physical feature labeling, appearance feature labeling, and packaging feature labeling on the normal package image sample set and the special labeling image sample set according to the feature labeling rules, to obtain the labeled image sample set.

3. The package feature recognition method according to claim 1, characterized in that, The initial package feature recognition model includes a backbone feature extraction module, which includes a final feature extraction layer and a global average pooling layer, with the final feature extraction layer and the global average pooling layer connected together. Introducing an attention module into the initial package feature recognition model to obtain an optimized package feature recognition model includes: The attention module is introduced between the final feature extraction layer and the global average pooling layer to obtain a preliminary optimized model. 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 feature recognition model.

4. The package feature recognition 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.

5. The package feature recognition method according to claim 1, characterized in that, The step of using the target image sample set to perform multiple rounds of iterative training on the optimized package feature recognition model to obtain the target package feature recognition model includes: Obtain the actual package feature data corresponding to the target image sample set; The target image sample set is input into the optimized package feature recognition model to perform package feature recognition and obtain predicted package feature data. The model loss is calculated based on the actual package feature data and the predicted package feature data to obtain the Focal Loss model loss; Based on the Focal Loss model loss, the gradient of the parameters in the optimized package feature recognition model is calculated using the backpropagation algorithm to obtain multiple parameter gradients; The AdamW optimizer is used to iteratively update the weight parameters of the optimized package feature recognition model based on multiple parameter gradients; When the preset iteration stopping condition is met, the target package feature recognition model is output.

6. The package feature recognition method according to claim 3, characterized in that, The target package feature recognition model further includes a three-level cascaded detection module and a global feature extraction module, wherein the backbone feature extraction module, the three-level cascaded detection module, and the global feature extraction module are connected sequentially; the step of using the target package feature recognition model to perform feature recognition on the image of the package to be recognized to obtain target package feature data includes: Based on the backbone feature extraction module, multi-scale feature extraction processing is performed on the image of the package to be identified to obtain a multi-scale high-dimensional feature map. The multi-scale high-dimensional feature map is input into the three-level cascaded detection module for cascaded detection processing to obtain the target candidate region and target local features; The target candidate region and the target local features are input into the global feature extraction module to perform global feature extraction processing and obtain the target package feature data.

7. The package feature recognition method according to claim 6, characterized in that, The three-stage cascaded detection module includes a first-stage detection submodule, a second-stage detection submodule, and a third-stage detection submodule, which are sequentially connected. The step of inputting the multi-scale high-dimensional feature map into the three-stage cascaded detection module for cascaded detection processing to obtain the target candidate region and the corresponding local features includes: The multi-scale high-dimensional feature map is input into the first-stage detection submodule to perform sliding window traversal processing and candidate region generation processing to obtain initial candidate regions and initial local features. The initial candidate region and the initial local features are input into the second-stage detection submodule for classification accuracy optimization and bounding box position correction to obtain optimized candidate regions and optimized local features. The optimized candidate region and the optimized local features are input into the third-stage detection submodule for classification result confirmation processing and bounding box coordinate refinement processing to obtain the target candidate region and the target local features.

8. A package feature 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 feature recognition model based on a cascaded region convolutional neural network; Model optimization module: used to introduce an attention module into the initial package feature recognition model to obtain an optimized package feature 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 feature recognition model using the target image sample set to obtain the target package feature recognition model; Recognition module: used to acquire an image of the package to be identified, and to perform feature recognition on the image of the package to be identified using the target package feature recognition model to obtain target package feature data.

9. A package feature recognition device, characterized in that, The package feature 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 feature recognition device to perform the various steps of the package feature recognition 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 feature recognition method as described in any one of claims 1-7.