Multilayer cascade express package image identification method

Through the multi-layered express packaging image recognition method, the multi-label data set is constructed using the YOLOv8 framework model, which solves the problem of low efficiency in express packaging tracking and supervision in the existing technology, and realizes efficient and intelligent express packaging identification and management .

CN119251547AActive Publication Date: 2025-01-03TSINGHUA UNIVERSITY

Patent Information

Application Number
CN202411222490.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-01-03
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

The existing technology lacks efficient, intelligent, sustainable and low-cost tools, making it difficult to achieve extensive and lasting tracking and supervision of express packaging, resulting in low environmental impact and management efficiency.

Method used

Using a multi-layered express packaging image recognition method, by collecting and constructing multi-label express packaging data sets, pre-training and migration using the YOLOv8 framework model, internal and external packaging classification model, internal buffer packaging classification model, and external packaging material Classification model, external packaging method classification model and multi-objective positioning recognition model to realize the identification of express packaging images.

Benefits of technology

It realizes efficient identification of express packaging images, facilitates tracking and supervision, and improves the efficiency and sustainability of environmental management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251547A_ABST
    Figure CN119251547A_ABST
Patent Text Reader

Abstract

The invention provides a multi-layer cascade express package image identification method, which comprises the steps of collecting express package image data, constructing a multi-label express package data set, pre-training a YOLOv8 framework model, migrating the pre-trained model to a corresponding sub-data set in the multi-label express package data set, and identifying the express package image according to the sub-data set. Respectively constructing an internal and external package classification model, an internal cushion package classification model, an external package material classification model, an external packaging mode classification model and a multi-target positioning identification model, judging the type of the to-be-identified image, if the to-be-identified image is a single-target package image, inputting the to-be-identified image into the internal and external package classification model, and if the to-be-identified image is a single-target package image, outputting the to-be-identified image; and inputting an output result of the internal and external package classification model into an external package material classification model, an external packaging mode classification model and an internal cushion package classification model for identification, and if the image is a multi-target package image, inputting a to-be-identified image into a multi-target positioning identification model for identification of the multi-target package image. According to the invention, express package image identification can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of express package recognition, and in particular to a multi-layer cascade express package image recognition method. Background Art

[0002] Faced with the massive amount of express packaging waste and its environmental impact, the rapid identification of express packaging is the basis for analyzing the current status of express packaging use, tracking the green performance of the industry, evaluating the effectiveness of policy implementation, and proposing management path improvement directions. However, due to the lack of efficient, intelligent, sustainable, and low-cost application tools, it is difficult to achieve extensive and lasting tracking and supervision. Therefore, it is necessary to design a multi-layer cascade express packaging image recognition method. Summary of the invention

[0003] In order to overcome the deficiencies of the prior art, an object of the present invention is to provide a multi-layer cascade express packaging image recognition method.

[0004] To achieve the above object, the present invention provides the following solutions:

[0005] The present invention provides a multi-layer cascade express packaging image recognition method, comprising:

[0006] Collect express packaging image data;

[0007] Construct a multi-label express packaging dataset based on express packaging image data;

[0008] Pre-train the YOLOv8 framework model based on the preset data set to obtain the pre-trained YOLOv8n-cls model;

[0009] Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset, and build internal and external packaging classification models, internal buffer packaging classification models, external packaging material classification models, external packaging method classification models and multi-target positioning and recognition models respectively;

[0010] The type of the image to be identified is determined according to the number of targets contained. If it is a single-target packaging image, the image to be identified is input into the internal and external packaging classification model, and the output result of the internal and external packaging classification model is input into the external packaging material classification model, the external packing method classification model and the internal buffer packaging classification model to identify the single-target packaging image. If it is a multi-target packaging image, the image to be identified is input into the multi-target positioning and recognition model to identify the multi-target packaging image.

[0011] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0012] The present invention provides a multi-layer cascade express packaging image recognition method, the method includes collecting express packaging image data, constructing a multi-label express packaging data set based on the express packaging image data, pre-training a YOLOv8 framework model based on a preset data set to obtain a pre-trained YOLOv8n-cls model, migrating the pre-trained YOLOv8n-cls model to a corresponding sub-data set in the multi-label express packaging data set, respectively constructing an internal and external packaging classification model, an internal buffer packaging classification model, an external packaging material classification model, an external packaging method classification model and a multi-target positioning recognition model, judging the type of an image to be recognized according to the number of targets contained, if it is a single-target packaging image, inputting the image to be recognized into the internal and external packaging classification model, inputting the output result of the internal and external packaging classification model into the external packaging material classification model, the external packaging method classification model and the internal buffer packaging classification model, and recognizing the single-target packaging image, and if it is a multi-target packaging image, inputting the image to be recognized into the multi-target positioning recognition model, and recognizing the multi-target packaging image. The present invention can realize express packaging image recognition and is easy to use. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0014] Figure 1 A flow chart of a method provided by an embodiment of the present invention;

[0015] Figure 2 A schematic diagram of an overall model provided for an embodiment of the present invention;

[0016] Figure 3 Schematic diagram of data enhancement methods;

[0017] Figure 4 This is a schematic diagram of representative images of each category in the multi-label express packaging dataset;

[0018] Figure 5 This is the working interface diagram of the LabelImg annotation platform;

[0019] Figure 6 Schematic diagram of the number and composition of images of different label categories;

[0020] Figure 7 This is a schematic diagram of the test performance of the internal and external packaging classification task;

[0021] Figure 8 This is a schematic diagram of the test performance of the internal and external packaging classification task;

[0022] Fig. 9 Schematic diagram of the training process for the internal buffer packaging classification task;

[0023] Fig.10 This is a schematic diagram of the test performance of the internal cushioning packaging classification task;

[0024] Fig.11 Schematic diagram of the training and verification process for the outer packaging material task;

[0025] Fig.12 This is a schematic diagram of the outer packaging material task test performance;

[0026] Fig.13 Schematic diagram of the training and verification process for the external packaging classification task;

[0027] Fig.14 This is a schematic diagram of the test performance of the external packaging classification task;

[0028] Fig.15 This is a schematic diagram of the target distribution characteristics of the Multi-Parcel sub-dataset;

[0029] Fig.16 Schematic diagram of the training and verification process for the shelf packaging object detection task (YOLOv8s). DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0032] Figure 1 A flow chart of a method provided by an embodiment of the present invention, Figure 2 The overall model schematic diagram provided by the embodiment of the present invention is as follows: Figure 1 and Figure 2 As shown, the present invention provides a multi-layer cascade express packaging image recognition method, comprising:

[0033] Step 100: Collect express packaging image data;

[0034] Step 200: construct a multi-label express packaging dataset based on express packaging image data;

[0035] Step 300: Pre-training the YOLOv8 framework model based on a preset data set to obtain a pre-trained YOLOv8n-cls model;

[0036] Step 400: Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset, and respectively construct an internal and external packaging classification model, an internal buffer packaging classification model, an external packaging material classification model, an external packaging method classification model, and a multi-target positioning and recognition model;

[0037] Step 500: Determine the type of the image to be identified based on the number of targets contained therein, and determine whether it is a single-target packaging image or a multi-target packaging image. If it is a single-target packaging image, input the image to be identified into the internal and external packaging classification model to distinguish between the external packaging image and the internal packaging image. Input the output result of the internal and external packaging classification model into the external packaging material classification model, the external packing method classification model and the internal cushioning packaging classification model to identify the single-target packaging image for identifying the outer packaging material, the opening method of the carton-type express packaging, and whether it contains inner cushioning material. If it is a multi-target packaging image, input the image to be identified into the multi-target positioning and recognition model to identify the multi-target packaging image and identify the outer packaging material and the opening method of the carton-type express packaging.

[0038] In step 100, express packaging image data is collected, specifically:

[0039] This paper obtains express packaging image data through two ways: network search and field research. Network search refers to obtaining target images through image search engines combined with search keywords. For multi-target packaging images, first search for relevant images on Baidu Image URLs with keywords such as "express shelf", "express rack", "express post", "express placement", "express outlets", and "express stacking". After screening images that meet the requirements, further snowball collection is combined with similar image search functions, and automatic download is achieved through relevant codes. For single-target express packaging images, search with keywords such as "express box", "express box", "express plastic bag", "bubble bag", "woven bag", "foam box", "express envelope", "inside express packaging", and "outside express packaging". Similarly, the number of target images is expanded in a snowball manner. In view of the limitations of the generally low resolution of images collected by network retrieval, the lack of some image types, and the relatively single object scenes, in order to enhance the application ability of the model in actual scenes, it is necessary to further supplement the collection of real-world images. Therefore, the present invention uses an offline field survey method to conduct real image collection at multiple express collection points and consumers in Beijing from January to March 2023, capturing the image performance of express packaging under different venue backgrounds, shooting tools, placement methods, angle directions and lighting conditions;

[0040] Based on the above technical process, after manual screening, cleaning and cropping, and elimination of irrelevant, repeated and invalid images, the present invention retains a total of 550 valid images of multi-target packaging and 2346 valid images of single-target packaging, of which 1031 are retained from network collection, accounting for 35% of the original data; 1865 are retained from field surveys, accounting for 65%.

[0041] In step 200, a multi-label express packaging dataset is constructed based on the express packaging image data, specifically:

[0042] First, the collected express packaging image data is enhanced, specifically:

[0043] In order to solve the problem of insufficient image data of some categories and improve the generalization ability of model building, the present invention expands the number of data sets through data enhancement. Data enhancement refers to generating more training samples by applying basic geometric transformations such as rotation, flipping, scaling and translation. At the same time, more diversified images can be generated by introducing random noise, brightness adjustment and color transformation. The former is particularly important for processing small sample data sets or when it is difficult to obtain actual scene data. The latter can make the model better adapt to different scenes and lighting conditions, reduce the risk of overfitting, and improve the robustness of the model in complex environments. It is a common operation in computer vision tasks. In the raw data processing stage, the present invention performs a variety of data enhancement processing on categories with relatively insufficient data and difficult to identify, such as express envelopes in single-target packaging, box-tape over-winding, box-external buffer and multi-target packaging images based on Python scripts, including horizontal flip transformation, vertical flip transformation, horizontal and vertical flip transformation, random cropping and random adjustment of image brightness, contrast, saturation and hue. At the same time, Mosaic enhancement is turned on at the model image input end. Mosaic augmentation refers to the process of randomly scaling, cropping, and arranging four different images to generate a new image. This data augmentation method enriches the style, background, and quantity of the data, strengthens the ability to detect small targets, and increases the batch processing image in disguise on the basis of unchanged memory requirements. It is an efficient data augmentation method. Examples of different types of data augmentation methods are as follows: Figure 3 shown.

[0044] The express packaging image data after data enhancement is labeled and divided. For single-target packaging images, they are divided into packaging external images and packaging internal images. The packaging external images are divided into cartons, dark plastic bags, light plastic bags, bubble bags, foam boxes, woven bags and express envelopes according to the material. According to the packaging method and express packaging management policy objectives, the cartons are divided into ordinary boxes, bag boxes, damaged boxes, boxes with excessive tape wrapping and external buffer boxes. The packaging internal images include those with buffer materials and those without buffer materials. For multi-target packaging images, the label division is consistent with the packaging external images. They and related English annotations are introduced in detail:

[0045] The dataset has ten types of labels. For single-parcel images, we first distinguish between outside-packaging and inside-packaging images. For outside-packaging images, we divide them into cartons, plastic bags (dark), plastic bags (light), bubble bags, foam boxes, woven bags, and envelopes according to the materials. At the same time, we further divide cartons into regular boxes, plastic bags, broken boxes, overwrap boxes, and cushion boxes according to the packaging methods and express packaging management policy objectives. Among them, the damaged box will affect the reusability of express packaging, overwrap tape and cushion outside the box can be used as evaluation indicators of whether the express packaging is over-packed, and the outer bag of the box can be used as an evaluation indicator of the current status of plastic reduction. For the internal packaging images, they are divided into inner-withcushion and inner-withoutcushion. For multi-parcel images, only external judgment is performed, i.e., the outer packaging material and packaging method. The label classification is the same as that of a single package. The representative images of each label category are as follows: Figure 4 shown.

[0046] The visual open source labeling tool LabelImg is used to manually label the enhanced express packaging image data to obtain a multi-label express packaging dataset. The detailed introduction is as follows:

[0047] The labeling method of the dataset varies depending on the task type. For multi-target express packaging images for target detection tasks, a label file containing category and location information needs to be created for each image. This paper uses a visual open source labeling tool LabelImg to manually process each sample image, including selecting the target location in the image with a rectangular box and labeling it as the ground truth. The labeling platform work interface is as follows: Figure 5 As shown. The annotation results are saved as PASCAL VOC format XML files by default. At the same time, the target category and location information of the XML file are extracted through Python scripts and converted into YOLO format TXT files synchronously. Among them, the PASCAL VOC format XML file contains 5 kinds of information: category name (Name), minimum value of the horizontal coordinate of the annotation box (Xmin), maximum value of the horizontal coordinate (Xmax), minimum value of the vertical coordinate (Ymin) and minimum value of the vertical coordinate (Ymax); the YOLO format TXT file contains 4 kinds of information: category name (expressed by digital index), coordinates of the center point of the annotation box (x, y), length of the annotation box (w), and width of the annotation box (h). The quality of data annotation has a significant impact on the performance and generalization ability of model training. Therefore, after the annotation is completed, the present invention arranges a third party to review the data to ensure the accuracy and consistency of the annotation. For single-target express packaging images for classification tasks, the images are manually visually classified, placed in different subfolders under the same directory, named with unique category labels, and a label file is made to encode different categories, that is, the classification task annotation is completed.

[0048] In addition, data division needs to be introduced: the complete model development process includes model training, verification and testing, which correspond to the use of training set, verification set and test set respectively. The training set is the largest subset in the data set, and its role is to train the model. The model can learn from the training set and guide network optimization through the loss function. If you only focus on the loss function on the training set during the training process, there will be a risk of overfitting, that is, the model performs well on the training data but has poor generalization. Therefore, the verification set, as another important component of the data set, can monitor whether the model is overfitting to decide whether to stop training, that is, the performance of the model on the training set continues to rise but the performance on the verification set decreases instead of rising. At the same time, the verification set can test the state and convergence of the model and guide the adjustment of hyperparameters, and continuously screen and optimize within the same model. The test set is used to evaluate the final performance of the model. It judges whether the model is feasible by inputting data it has never seen before. Therefore, the error on the test set can approximate the generalization error of the model in real scenarios and serve as a comparison benchmark between different models. The effects of the model on the training set, validation set, and test set will be different. In order to make the model reasonably generalized and popularized, it is generally required that the data used in the training set, validation set, and test set are not repeated but have similar distribution. The optimal split ratio of the training set, validation set, and test set depends on the size of the data set, the complexity of the model, and the number of label categories. Common split ratios include 7:2:1 and 8:1:1. In different development experiments, the present invention consistently divides the training set, validation set, and test set according to 8:1:1. The number of labels in the data set is distributed as follows: Figure 6 shown.

[0049] In step 300, the YOLOv8 framework model is pre-trained based on a preset data set to obtain a pre-trained YOLOv8n-cls model, specifically:

[0050] Transfer learning is a common technology in the field of computer vision. The idea is to pre-train the model using a large data set, and then transfer the trained weights and biases to a small sample data set for a specific task for fine-tuning, which can accelerate network convergence, improve model training speed, and reduce computing resource consumption. More importantly, training a convolutional neural network requires a large amount of well-annotated data to achieve high prediction performance. Transfer learning can overcome the shortcoming of insufficient data and effectively solve the overfitting problem that is prone to occur when there is a lack of labeled data. Therefore, it is often used in small sample data sets. The MEPD data set constructed by the present invention is smaller in scale than other data sets in the field of target detection (samples of a single category are less than 1000), and has more categories and some categories are difficult to distinguish. Therefore, the present invention applies a transfer learning strategy based on the PASCAL VOC data set to assist in the development of the model.

[0051] This invention introduces the model training, verification and testing settings, where the hardware facilities and software environment are:

[0052] The training, verification and testing of the model are implemented on the GPU computing power rental platform AutoDL. The hardware configuration is as follows: GPU selects RTX 3090 (24GB)*1, CPU selects 15vCPU Intel(R) Xeon(R) Platinum 8338C CPU@2.60GHz, system hard disk size is 25GB, data hard disk size is 100GB, and memory is 80GB;

[0053] The software environment uses the Ubuntu 20.04 operating system. Ubuntu is a computer operating system similar to Windows. It provides a user interface and application management functions, allowing users to perform various tasks on the computer. Based on the Linux kernel, the Ubuntu open source system is safer, more stable and more flexible than the Windows system. At the same time, the PyTorch 2.0.0 deep learning framework is configured. The deep learning framework is a software library that provides a set of pre-built tools and functions for designing, training and verifying deep learning models. These frameworks are designed to simplify the development process of deep learning models, enabling developers to build, train and deploy complex neural network models faster. PyTorch is one of the most common deep learning frameworks. Compared with other frameworks such as TensorFlow, PyTorch, Keras and Caffe, it is more concise, easy to use, has strong community support, and is highly integrated with other Python libraries. In terms of programming language, Python 3.8 programming language and Cuda 11.8 parallel computing platform are selected. CUDA is a parallel computing platform and programming model released by NVIDIA. It allows developers to use NVIDIA's graphics processors for general computing, making it easier to develop and run parallel applications.

[0054] Configurations and hyper-parameters are: Configurations and hyper-parameters settings are important steps before model training. Configurations and hyper-parameters are exogenous variables of the model and need to be manually pre-set by researchers based on their own modeling experience. Compared with the internal parameters of the model, that is, the values ​​learned and estimated by the model from the training data, such as network weights and biases, hyper-parameters are used to help the model learn the configuration and settings of internal parameters. These settings will affect the performance, speed and accuracy of the model to a certain extent. It is very important to carefully adjust and experiment according to the training feedback to achieve the best performance for a given task, which can further improve the performance of the model and enhance the model performance. The main configurations and hyper-parameters that need to be set are as follows:

[0055] 1. Number of training rounds (Epochs)

[0056] When all training samples have undergone one forward propagation and one backward propagation in the network, one round of training is considered completed. The number of training rounds determines how many rounds the model will be trained. The more rounds of training, the more fully the model learns the data, but it also increases the training time. For new data sets whose learning difficulty is uncertain, you can increase the number of rounds to find better performance, such as 300 rounds. The default is 100 rounds.

[0057] 2. Early Stop Waiting Rounds (Patience)

[0058] If no significant improvement in the model performance on the validation set is observed within a certain number of rounds during training, training will be stopped. The parameter that determines the number of waiting rounds is the early stopping waiting round number. Early stopping can effectively reduce overfitting by reducing the effective scale of each parameter dimension. The default value is 50 rounds.

[0059] 3. Input image size (Imgsz)

[0060] This parameter determines the size of the input image. It specifies the side length or width and height combination of the input image through an integer value. For example, 640 means that the width and height of the image are both 640 pixels. If there are a large number of small objects in the dataset, increasing the input image size can improve the resolution so that these objects can be better detected. The default value for object detection tasks is 640, and the default value for classification tasks is 224.

[0061] 4. Batch processing images (Batch size)

[0062] During the training process, the data is divided into multiple batches for processing. Each batch contains a certain number of images. The parameter that determines the number of images in each batch is the batch processing image. The size of the batch processing image will affect the degree and speed of model optimization. It is generally believed that the larger the batch processing image, the better, because the larger the batch processing image, the more it can represent the distribution of the entire data set, and the gradient is relatively more accurate, which helps the model learn. However, the larger the batch processing image, the more graphics card memory space it occupies, the higher the hardware resource requirements, and the risk of overfitting will also increase. The default value is 16.

[0063] 5. Initial learning rate (Ir0)

[0064] The learning rate is a hyperparameter that controls the update step of the model parameters. It guides how to use the gradient of the loss function to adjust the network weights in gradient descent, and determines whether the network can succeed or how long it takes to successfully find the global minimum. If the learning rate is too large, the loss function may directly cross the global optimal point; if the learning rate is too small, it will increase the convergence complexity of the network and easily fall into the local minimum (saddle point). The initial learning rate determines the parameter update speed at the beginning of training. It is generally believed that the initial learning rate can be set larger (0.01-0.001) to make the network loss value drop faster. In the case of transfer learning, since the model has converged on the original data, a smaller initial learning rate (≤0.0001) should be set at this time to fine-tune on the new data. The default value is 0.01.

[0065] 6. Final learning rate (lrf)

[0066] The final learning rate is used to control the attenuation of the learning rate during training. It is a coefficient compared to the initial learning rate, obtained by multiplying the initial learning rate by the proportional coefficient. As the number of iterations increases, gradually reducing the learning rate can prevent the global optimal solution from being exceeded. It is generally believed that the attenuation of the learning rate should be more than 100 times near the end of training. The default value is 0.01.

[0067] 7. Optimizer

[0068] An optimizer is an algorithm used in deep learning to adjust model parameters to minimize the loss function. The optimizer updates the model parameters based on the gradient information of the loss function, so that the value of the loss function continues to decrease, thereby improving the performance of the model. Different optimizers are suitable for different scenarios. Common optimizers include SGD, Adam, AdamW, and RMSProp. You need to choose according to the task requirements. If set to auto, the optimizer will be automatically selected. The default value is auto.

[0069] 8. Momentum

[0070] Momentum is a technique to accelerate the gradient descent process and increase the stability of parameter updates. According to the energy conversion principle between potential energy and kinetic energy in physics, the larger the momentum, the greater the energy converted into potential energy, and the more likely it is to break free from the constraints of the local concave domain and enter the global concave domain. This parameter specifies the intensity of accelerated gradient descent. The most common setting for momentum is 0.9, and the default value is 0.937. If set to SGD optimizer or Adam optimizer, the default value is beta1.

[0071] 9. Confidence threshold (Conf)

[0072] The confidence threshold is a parameter used to filter prediction results with low confidence scores during the validation, testing, and prediction stages. It determines the minimum confidence score for a prediction to be considered valid, and implements the classification function in target detection. The confidence threshold is set by the researcher and its value is between 0 and 1. To retain more possible results, the threshold can be lowered; to increase the accuracy of the retained results, the threshold can be lowered. The default value for validation and test mode is 0.001, and the default value for prediction mode is 0.25.

[0073] 10. Interaction over Union threshold (IoU)

[0074] The Intersection-over-Union (IoU) threshold is used to filter out parameters with low overlap between the predicted bounding box and the true bounding box during non-maximum suppression (NMS) in the validation, test, and prediction stages, and to achieve positioning in object detection. The IoU threshold is set by researchers and its value is between 0 and 1. To retain more possible results, the threshold can be lowered; to increase the accuracy of the retained results, the threshold can be lowered. The default value is 0.7.

[0075] 11. Bounding box loss weight (Box loss)

[0076] Bounding box loss weight is a type of hyperparameter in the object detection task that is used to adjust the model's emphasis on the accuracy of the target bounding box coordinate prediction. The bounding box loss weight focuses on the prediction error of the bounding box coordinates, that is, the difference between the bounding box predicted by the model and the actual target bounding box. Researchers can improve the model's performance in object positioning by adjusting the bounding box loss weight. The default value is 7.5.

[0077] 12. Class loss weight (Cls loss)

[0078] Class loss weight is a type of hyperparameter in the object detection task, which is used to adjust the model's emphasis on the classification accuracy of different categories. Class loss weight focuses on the model's classification accuracy for each category to ensure that the model can correctly identify the category of the input object. Researchers improve the performance of the model in multi-category scenarios by adjusting the class loss weight. The default value is 0.5.

[0079] 13. Focus distribution loss weight (Dfl loss)

[0080] The focus distribution loss weight is a type of hyperparameter in the object detection task, which is used to strengthen or weaken the loss weight of the model's attention to different areas in the training data, and can solve the imbalance problem between the target area and the background area in the training sample. By adjusting the focus distribution loss weight, researchers can pay more attention to those areas that are easily ignored or difficult to classify, thereby improving the performance of the model in complex scenes. The default value is 1.5.

[0081] The performance evaluation indicators are:

[0082] Performance evaluation indicators are important references for analyzing model training performance, performing iterative optimization within the model, and conducting comparisons between different models. In the model output, if the predicted value is a positive example, it is recorded as Positive (P); the predicted value is a negative example, which is recorded as Negative (N). If the predicted value is the same as the true value, the prediction is correct, which is recorded as True (T); if the predicted value is opposite to the true value, the prediction is wrong, which is recorded as False (F). Therefore, true positive (TP) means that the predicted value is the same as the true value, that is, the predicted value is a positive example and the true value is also a positive sample, which represents the number of positive samples correctly identified; true negative (TN) means that the predicted value is the same as the true value, that is, the predicted value is a negative example and the true value is a negative sample, which represents the number of negative samples correctly identified; false positive (FP) means that the predicted value is different from the true value, that is, the predicted value is a positive example and the true value is a negative sample, which represents the number of falsely reported negative samples; false negative (FN) means that the predicted value is different from the true value, that is, the predicted value is a negative example and the true value is a positive sample, which represents the number of missed positive samples. Based on this, various metrics can be calculated to evaluate the model performance for classification and object detection tasks.

[0083] 1. Confusion matrix

[0084] The confusion matrix is ​​a specific table layout that counts the number of predictions for each category. Each row represents the actual category, each column represents the predicted category, and the diagonal represents TP. The confusion matrix directly reflects the number of TP, TN, FP, and FN in each category, and can derive other model evaluation indicators through combined calculation. It is the most basic and intuitive method to measure classification accuracy.

[0085] 2. Loss

[0086] Loss refers to the difference between the prediction and the actual label of each sample calculated based on the loss function during the classification task training process. Loss can guide the optimization direction of the model through back propagation and is an indicator for evaluating the performance of the model during the training process. Usually the goal of training is to minimize the loss so that the model can classify more accurately. The loss value of the model ranges from 0 to 1. The closer the loss is to 0, the better the training effect of the model is.

[0087] 3. Top1 accuracy

[0088]

[0089] The TOP1 accuracy rate refers to the label with the highest probability among the n classification probabilities of the test image. If it is the same as the correct label, it means that the classification is successful. The TOP1 accuracy rate indicates the ratio of the number of correctly classified images to the number of all test images, and is mainly used in classification tasks. The value range of the TOP1 accuracy rate is 0-1. The higher the TOP1 accuracy rate, the better the model effect.

[0090] 4. Precision (P)

[0091]

[0092] Precision measures the proportion of correct predictions among the positive examples predicted by the model, also known as precision. Precision measures the accuracy of the model in the samples predicted as positive examples. A higher precision means that the model misclassifies negative samples as positive examples less often, but it may be accompanied by missed detections. The precision value range is 0-1, and a higher precision means that the model performance is relatively better.

[0093] 5. Recall (R)

[0094]

[0095] Recall rate refers to the proportion of samples that are actually positive examples that are correctly predicted as positive examples by the model, also known as recall rate. Recall rate focuses on the model's coverage of samples that are actually positive examples. A higher recall rate means that the model is more able to capture positive examples, but it may be accompanied by more misjudgments. The recall rate ranges from 0 to 1. A higher recall rate means that the model performance is relatively better.

[0096] 6. Average Precision (AP)

[0097]

[0098] Average precision refers to the calculus of precision under different recall rates. Precision and recall are a pair of conflicting variables controlled by the confidence threshold, that is, the probability threshold at which a sample is judged to be a certain category. When the confidence threshold is low, many samples with low confidence are considered true, with high recall but low precision; when the confidence threshold is high, only samples with high confidence can be considered true, with high precision but low recall. Average precision calculates the area under the PR curve by statistically calculating the precision at different recall levels, drawing the precision-recall (PR) curve, and calculating the area under the PR curve, thereby achieving a comprehensive consideration of these two indicators. In most cases, the model uses 0.5 as the classification threshold by default, that is, AP 50 The value range of average precision is 0-1. The higher the average precision, the closer the curve is to the upper right corner, and the closer the overall area is to 1, which means that the model can maintain a high recall rate while also maintaining a high precision, and the performance of the model is relatively better.

[0099] 7. Mean Average Precision (mAP)

[0100]

[0101] The mean average precision is the arithmetic mean of the average precision of different categories, and C is the number of label categories. In object detection tasks, there are usually multiple categories. The mean average precision provides a global performance indicator and is one of the most commonly used indicators. In most cases, the model uses 0.5 as the classification threshold by default, i.e. mAP. 50 The average precision value ranges from 0 to 1. A higher average precision value indicates a better performance of the model.

[0102] 8. F-Score

[0103]

[0104] The F score is the harmonic mean of precision and recall. If β is 1 (i.e., the F1 score), precision is as important as recall; if β is less than 1, precision is more important than recall; if β is greater than 1, recall is more important than precision. The F score ranges from 0 to 1. A higher F score means a wider F1 curve with a top closer to 1, indicating that the confidence threshold range for both good recall and good precision is large, and the model performance is relatively better.

[0105] 9. Frames Per Second (FPS)

[0106] The frame rate per second refers to the number of images that the model processes and detects within one second, and is the main indicator of model speed. The frame rate per second of the model can be calculated based on the total detection time and the total number of images detected during the test. The frame rate per second is affected by multiple factors such as hardware and image resolution, and needs to be evaluated based on specific application scenarios and real-time requirements. Generally, the larger the frame rate, the better the model performance.

[0107] 10. Floating-point operations per second (GFLOPs)

[0108] Floating-point operations per second measures the number of floating-point operations a computer or processor can perform per second, measuring the computer's performance in processing mathematical operations. Usually measured in gigabytes per second (Giga), a higher number of floating-point operations per second means that the model can complete these tasks faster, with higher computing speed and efficiency.

[0109] In step 400, the pre-trained YOLOv8n-cls model is migrated to the corresponding sub-dataset in the multi-label express packaging dataset to build an internal and external packaging classification model, specifically:

[0110] The Inside Oustisde Clssification Task (IOCT) is to classify the outside and inside of a package for a single-target express package image.

[0111] Extract packaging exterior images and packaging interior images from the Multi-labels Express Packaging Datasets (MEPD), construct the Inside-Oustisde sub-dataset, and divide it into training set, validation set and test set according to 8:1:1;

[0112] The pre-trained YOLOv8n-cls model was migrated to the Inside-Oustisde sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 100 rounds, the input image size was set to 224, the batch processing images were set to 16, and the early stopping function was turned off. The optimizer automatically selected AdamW according to the iteration situation, the initial learning rate was set to 0.000714, the momentum was set to 0.9, and the final learning rate was set to 0.01. Mosaic data enhancement was turned on and turned off in the last 10 rounds of training to obtain the internal and external packaging classification model. Finally, the model training was started, and automatic testing was turned on after the training was completed.

[0113] Model training and verification process Figure 7The results show that the loss value of the model converged to 0.00016 on the training set, converged to 0.16191 on the validation set, and the Top1 accuracy converged to 0.96693. The overall training effect of the model is good;

[0114] The network weights and biases of the best round are retained as the model training output and tested on the test set. The results show that the average processing time per image is 1.3ms, including 0.2ms for preprocessing, 1.1ms for inference, 0.0ms for loss calculation, 0.0ms for post-processing, and 769 frames per second. The model test performed well, and the test results are as follows: Figure 8 shown.

[0115] In step 400, the pre-trained YOLOv8n-cls model is migrated to the corresponding sub-dataset in the multi-label express packaging dataset to build an internal buffer packaging classification model, specifically:

[0116] The Inside Cushion Classification Task (ICCT) is to determine whether there is an internal cushioning package in the input single-target express package internal image.

[0117] Extract images marked as containing cushioning materials and not containing cushioning materials from the multi-label express packaging dataset, construct the Inside-Cushion sub-dataset, and divide it into training set, validation set and test set according to 8:1:1;

[0118] Migrate the pre-trained YOLOv8n-cls model to the Inside-Cushion sub-dataset for training fine-tuning, set the relevant configurations and hyperparameters, set the training rounds to 100 rounds, the input image size to 224, the batch processing images to 16, and turn off the early stopping function. The optimizer automatically selects AdamW according to the iteration situation, the initial learning rate is set to 0.000714, the momentum is set to 0.9, and the final learning rate is set to 0.01. Mosaic data enhancement is turned on and turned off in the last 10 rounds of training to obtain the inner-cushion packaging classification model. Finally, start model training and turn on automatic testing after training.

[0119] Model training and verification process Fig. 9 The results show that the loss value of the model converges to 0.00001 on the training set, converges to 0.1620 on the validation set, and the Top1 accuracy converges to 0.95865. The overall training effect of the model is good.

[0120] The network weights and biases of the best round are retained as the model training output and tested on the test set. The results show that the average processing time per image is 2.3ms, including 0.2ms for preprocessing, 2.1ms for inference, 0.0ms for loss calculation, 0.0ms for post-processing, and 435 frames per second. The model test performed well, and the test results are as follows: Fig.10 shown.

[0121] In step 400, the pre-trained YOLOv8n-cls model is migrated to the corresponding sub-dataset in the multi-label express packaging dataset, and the outer packaging material classification model is constructed respectively, specifically:

[0122] The Outside Material Classification Task (OMCT) is to classify and judge the packaging material of the input single-target express packaging external image;

[0123] Extract images labeled as cartons, dark plastic bags, light plastic bags, bubble bags, foam boxes, woven bags, and express envelopes from the multi-label express packaging dataset, construct the Outside-Material sub-dataset, and divide it into training set, validation set, and test set according to 8:1:1;

[0124] Migrate the pre-trained YOLOv8n-cls model to the Outside-Material sub-dataset for training fine-tuning, set the relevant configurations and hyperparameters, set the training rounds to 100 rounds, the input image size to 224, the batch processing images to 16, and turn off the early stopping function. The optimizer automatically selects AdamW according to the iteration situation, sets the initial learning rate to 0.01, the momentum to 0.9, and the final learning rate to 0.01. Turn on mosaic data enhancement and turn it off in the last 10 rounds of training to obtain the outer packaging material classification model. Finally, start model training and turn on automatic testing after training.

[0125] Model training and verification process Fig.11 The results show that the loss value of the model converges to 0.00015 on the training set, converges to 0.57311 on the validation set, the Top1 accuracy converges to 0.98443, the network parameter volume is 2.83MB, and the overall training effect of the model is good.

[0126] The network weights and biases of the best round are retained as the model training output and tested on the test set. The results show that the average processing time per image is 0.9ms, including 0.1ms for preprocessing, 0.8ms for inference, 0.0ms for loss calculation, 0.0ms for post-processing, and 1111 frames per second. The overall Top1 accuracy on the test set is 0.985, and the model test performance is good. Fig.12 shown.

[0127] In step 400, the pre-trained YOLOv8n-cls model is migrated to the corresponding sub-dataset in the multi-label express packaging dataset to build an external packaging classification model, including:

[0128] The Outside Packing Classification Task (OPCT) is to classify and judge the packing method of the input single-target box-type express packaging external image;

[0129] Extract images labeled as ordinary boxes, bagged boxes, damaged boxes, boxes with excessive tape wrapping, and outside buffer boxes from the multi-label express packaging dataset, construct the Outside-Packing sub-dataset, and divide it into training set, validation set, and test set according to 8:1:1;

[0130] The pre-trained YOLOv8n-cls model was migrated to the Outside-Packing sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 100 rounds, the input image size was set to 224, the batch processing images were set to 16, and the early stopping function was turned off. The optimizer automatically selected AdamW according to the iteration situation, the initial learning rate was set to 0.000714, the momentum was set to 0.9, and the final learning rate was set to 0.01. Mosaic data enhancement was turned on and turned off in the last 10 rounds of training to obtain the outside-packing classification model. Finally, the model training was started, and automatic testing was turned on after the training was completed.

[0131] Model training and verification process Fig.13 The results show that the loss value of the model converged to 0.00013 on the training set, converged to 0.46169 on the validation set, and the Top1 accuracy converged to 0.97908. The overall training effect of the model is good;

[0132] The network weights and biases of the best round are retained as the model training output and tested on the test set. The results show that the average processing time per image is 0.4ms, including 0.0ms for preprocessing, 0.4ms for inference, 0.0ms for loss calculation, 0.0ms for post-processing, and 2500 frames per second. The overall Top1 accuracy on the test set is 0.978, and the model test performance is good. Fig.14 shown.

[0133] In step 400, the pre-trained YOLOv8n-cls model is migrated to the corresponding sub-dataset in the multi-label express packaging dataset to build a multi-target positioning and recognition model, including:

[0134] Multi Parcel Detection Task (MPDT) is to input express package images containing multiple targets to locate the package and identify the outer packaging material;

[0135] Extract images with multi-target packaging image-related labels from the multi-label express packaging dataset. Specifically, as shown above, construct the Multi-Parcel sub-dataset and divide it into training set, validation set and test set according to 8:1:1;

[0136] The pre-trained YOLOv8l model was migrated to the Multi-Parcel sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 50 rounds, the input image size was set to 640, the batch processing images were set to 16, the optimizer automatically selected SGD according to the iteration situation, the initial learning rate was set to 0.01, the momentum was set to 0.9, the final learning rate was set to 0.01, the confidence threshold in the verification and testing stages was set to 0.001, the intersection-over-union ratio threshold was set to 0.7, the bounding box loss weight was set to 7.5, the classification loss weight was set to 0.5, and the focus distribution loss weight was set to 1.5. Mosaic data enhancement was turned on and turned off in the last 10 rounds of training to obtain a multi-target positioning and recognition model;

[0137] This paper conducts multiple experiments and adjusts the model configuration to identify and optimize key hyperparameters, ultimately improving model performance. The process is described in detail:

[0138] First, the present invention provides the target distribution characteristics of the Multi-Parcel sub-dataset such as Fig.15As shown, the present invention first selects the yolov8s model with relatively balanced performance in various indicators of detection accuracy, detection speed and model lightweight, and migrates it to the Multi-Parcel sub-dataset for further training and fine-tuning. For configuration and hyperparameters, they are set according to the default mode, specifically: the training rounds are set to 300 rounds, the early stop waiting rounds are 50 rounds, the input image size is 640, and the batch processing images are 16. The optimizer automatically selects SGD according to the task characteristics, the initial learning rate is 0.01, the momentum is 0.9, and the final learning rate is 0.01. The confidence threshold in the verification and testing phases is set to 0.001, the intersection and union ratio threshold is 0.7, the bounding box loss weight is set to 7.5, the classification loss weight is 0.5, and the focus distribution loss weight is 1.5. Mosaic data enhancement is turned on and turned off in the last 10 rounds of training. Finally, start model training and turn on automatic testing after the training is completed.

[0139] Model training and verification process Fig.16 As shown. The results show that the bounding box loss value of the model converges to 0.55727 on the training set and to 0.64748 on the validation set; the category loss value converges to 0.3519 on the training set and to 0.4252 on the validation set; the focal distribution loss value converges to 0.85822 on the training set and to 0.89365 on the validation set. At the same time, on the validation set, the precision converges to 0.91137, the recall converges to 0.79073, the average precision mean 50 converges to 0.85531, the average precision mean 5095 converges to 0.70899, the network parameter amount is 11.1M, the number of floating-point operations per second is 28.5, and the overall training effect of the model is average.

[0140] The network weights and biases of the best round are retained as the model training output and tested on the test set. The results show that the average processing time per image is 2.7ms, including 0.6ms for preprocessing, 1.4ms for inference, 0.0ms for loss calculation, and 0.7ms for post-processing. The average precision mean 50 on the test set is 0.865, and the F1 score is 0.85. The model test performance is average.

[0141] In view of the performance of YOLOV8s, the model accuracy and recall rate need to be further improved. Therefore, the yolov8l model with relatively higher detection accuracy but larger model parameters and slower detection speed is selected to migrate to the Multi-Parcel sub-dataset for further training and fine-tuning;

[0142] For configuration and hyperparameters, set them according to the default mode, specifically: training rounds are set to 300 rounds, early stop waiting rounds are set to 50 rounds, input image size is 640, batch processing images are 16, the optimizer is automatically selected as SGD according to the characteristics of the task, the initial learning rate is 0.01, the momentum is 0.9, the final learning rate is 0.01, the confidence threshold in the verification and testing phases is set to 0.001, the intersection ratio threshold is 0.7, the bounding box loss weight is set to 7.5, the classification loss weight is 0.5, the focal distribution loss weight is 1.5, and the mosaic data enhancement is turned on and turned off in the last 10 rounds of training. Finally, start model training and turn on automatic testing after the training is completed;

[0143] From the results of the model training and verification process, we can see that the bounding box loss value of the model converges to 0.32614 on the training set and to 0.43175 on the verification set; the category loss value converges to 0.2071 on the training set and to 0.27192 on the verification set; the focal distribution loss value converges to 0.80945 on the training set and to 0.85342 on the verification set. At the same time, on the verification set, the precision converges to 0.9518, the recall converges to 0.86116, the average precision mean 50 converges to 0.90715, the average precision mean 5095 converges to 0.82256, the network parameter volume is 43.6M, the number of floating point operations per second is 165.4, and the overall training effect of the model is better.

[0144] The network weights and biases of the best round are retained as the model training output and tested on the test set. The results show that the average processing time per image is 5.1ms, including 0.6ms for preprocessing, 3.9ms for inference, 0.0ms for loss calculation, and 0.6ms for post-processing. The average precision mean 50 on the test set is 0.909, and the F1 score is 0.89, and the model test performance is better.

[0145] In order to verify the applicability and superiority of the selected model in the shelf packaging target detection task of this study, and to avoid missing other potential algorithm frameworks with better performance, this paper further compares the YOLOv8 algorithm with other target detection algorithms on the Multi-Parcel dataset, including common single-stage and two-stage algorithms such as Faster RCNN, SSD, Efficientddet and YOLOX. In different experiments, the hardware facilities and software environment are consistent, the hyperparameters are preset to the default mode of each algorithm, and the training cycle is 300 rounds. Table 1 shows the comparison results of different algorithms.

[0146] Table 1 Comparison of different algorithm models

[0147]

[0148] The results show that the mAP50 index performance proves that the YOLOv8l model is significantly higher than other models in detection accuracy, and it is the only algorithm that reaches more than 90%. Indicators related to detection speed, such as GFLOPS, show that YOLOv8l, as a two-stage model algorithm, still has certain advantages in speed compared to other one-stage algorithms such as Faster RCNN and Efficientdet, but compared with other two-stage algorithms such as SSD, YOLOX and YOLOv8s, the detection speed will inevitably be reduced due to the large model parameters. This is a question of the balance between detection accuracy and detection speed. Based on the actual needs of this study, the requirement for detection accuracy is higher than that for detection speed, and the detection speed of YOLOv8l is still within an acceptable range, so YOLOv8l is the best feasible model.

[0149] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0150] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A multi-layer cascade express packaging image recognition method, characterized in that: include: Collect express packaging image data; Construct a multi-label express packaging dataset based on express packaging image data; Pre-train the YOLOv8 framework model based on the preset data set to obtain the pre-trained YOLOv8n-cls model; Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset, and build internal and external packaging classification models, internal buffer packaging classification models, external packaging material classification models, external packaging method classification models and multi-target positioning and recognition models respectively; The type of the image to be identified is determined according to the number of targets contained. If it is a single-target packaging image, the image to be identified is input into the internal and external packaging classification model, and the output result of the internal and external packaging classification model is input into the external packaging material classification model, the external packing method classification model and the internal buffer packaging classification model to identify the single-target packaging image. If it is a multi-target packaging image, the image to be identified is input into the multi-target positioning and recognition model to identify the multi-target packaging image.

2. The method according to claim 1, characterized in that: Collect express packaging image data, specifically: Express packaging image data is collected through two methods: network retrieval and actual investigation.

3. The method according to claim 1, characterized in that A multi-label express packaging dataset is constructed based on express packaging image data, specifically: Perform data enhancement on the collected express packaging image data; Label division is performed on the express packaging image data after data enhancement. For single-target packaging images, they are divided into packaging external images and packaging internal images. The packaging external images are divided into cartons, dark plastic bags, light plastic bags, bubble bags, foam boxes, woven bags and express envelopes according to the materials. According to the packaging method and express packaging management policy objectives, cartons are divided into ordinary boxes, bag boxes, damaged boxes, boxes with excessive tape wrapping and external buffer boxes. The packaging internal images include those with buffer materials and those without buffer materials. For multi-target packaging images, the label division is consistent with the packaging external images; The visual open source labeling tool LabelImg is used to manually label the express packaging image data after data enhancement to obtain a multi-label express packaging dataset.

4. The method according to claim 3, characterized in that Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset to build an internal and external packaging classification model, specifically: Extract packaging exterior images and packaging interior images from the multi-label express packaging dataset, construct the Inside-Oustisde sub-dataset, and divide it into training set, validation set and test set according to 8:1:1; The pre-trained YOLOv8n-cls model was migrated to the Inside-Oustisde sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 100 rounds, the input image size was set to 224, the batch processing images were set to 16, and the early stopping function was turned off. The optimizer automatically selected AdamW according to the iteration situation, the initial learning rate was set to 0.000714, the momentum was set to 0.9, and the final learning rate was set to 0.

01. Mosaic data enhancement was turned on and turned off in the last 10 rounds of training to obtain the internal and external packaging classification model.

5. The method according to claim 3, characterized in that: Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset to build an internal buffer packaging classification model, specifically: Extract images marked as containing cushioning materials and not containing cushioning materials from the multi-label express packaging dataset, construct the Inside-Cushion sub-dataset, and divide it into training set, validation set and test set according to 8:1:1; The pre-trained YOLOv8n-cls model was migrated to the Inside-Cushion sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 100 rounds, the input image size was set to 224, the batch processing images were set to 16, and the early stopping function was turned off. The optimizer automatically selected AdamW according to the iteration situation, the initial learning rate was set to 0.000714, the momentum was set to 0.9, and the final learning rate was set to 0.

01. Mosaic data enhancement was turned on and turned off in the last 10 rounds of training to obtain the inner-cushion packaging classification model.

6. The method according to claim 3, characterized in that Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset, and build the outer packaging material classification model respectively, specifically: Extract images labeled as cartons, dark plastic bags, light plastic bags, bubble bags, foam boxes, woven bags, and express envelopes from the multi-label express packaging dataset, construct the Outside-Material sub-dataset, and divide it into training set, validation set, and test set according to 8:1:1; The pre-trained YOLOv8n-cls model was migrated to the Outside-Material sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 100 rounds, the input image size was set to 224, the batch processing images were set to 16, and the early stopping function was turned off. The optimizer automatically selected AdamW according to the iteration situation, the initial learning rate was set to 0.01, the momentum was set to 0.9, and the final learning rate was set to 0.

01. Mosaic data enhancement was turned on and turned off in the last 10 rounds of training to obtain the outer packaging material classification model.

7. The method according to claim 3, characterized in that Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset to build an external packaging classification model, including: Extract images labeled as ordinary boxes, bagged boxes, damaged boxes, boxes with excessive tape wrapping, and outside buffer boxes from the multi-label express packaging dataset, construct the Outside-Packing sub-dataset, and divide it into training set, validation set, and test set according to 8:1:1; The pre-trained YOLOv8n-cls model was migrated to the Outside-Packing sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 100 rounds, the input image size was set to 224, the batch processing images were set to 16, and the early stopping function was turned off. The optimizer automatically selected AdamW according to the iteration situation, the initial learning rate was set to 0.000714, the momentum was set to 0.9, and the final learning rate was set to 0.

01. Mosaic data enhancement was turned on and turned off in the last 10 rounds of training to obtain the outside-packing classification model.

8. The method according to claim 3, characterized in that Migrate the pre-trained YOLOv8n-cls model to the corresponding sub-dataset in the multi-label express packaging dataset to build a multi-target positioning and recognition model, including: Extract images with multi-target packaging image-related labels from the multi-label express packaging dataset, construct the Multi-Parcel sub-dataset, and divide it into training set, validation set and test set according to 8:1:1; The pre-trained YOLOv8l model was migrated to the Multi-Parcel sub-dataset for training fine-tuning, and the relevant configurations and hyperparameters were set. The training rounds were set to 50 rounds, the input image size was set to 640, the batch processing images were set to 16, the optimizer automatically selected SGD according to the iteration situation, the initial learning rate was set to 0.01, the momentum was set to 0.9, the final learning rate was set to 0.01, the confidence threshold in the verification and testing stages was set to 0.001, the intersection-over-union ratio threshold was set to 0.7, the bounding box loss weight was set to 7.5, the classification loss weight was set to 0.5, the focus distribution loss weight was set to 1.5, the mosaic data enhancement was turned on and turned off in the last 10 rounds of training, and a multi-target positioning and recognition model was obtained.

Citation Information

Patent Citations

  • Multi-target object motion tracking method based on neural network

    CN111612002A

  • Cascade detection method for safety helmets of oil unloading workers in complex environment and small target recognition scene

    CN112861646A

  • Article package storage method and device, storage medium and electronic device

    CN113023214A

  • Target detection method and device, computer equipment and medium

    CN116797951A

Cited By

  • Storage packaging operation identification method and device, electronic equipment and storage medium

    CN121121636A

  • Face and palm mixed detection method, electronic equipment, storage medium and program product

    CN121582656A