Packaging material visual identification method, device, computer equipment and storage medium

By synchronous prediction and weighted fusion of the visual recognition model of packaging materials, the problem of low accuracy of traditional packaging material recognition methods is solved, and more efficient and accurate packaging material recognition is achieved.

CN114663717BActive Publication Date: 2024-11-26SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011542872.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-22
Publication Date
2024-11-26
Estimated Expiration
2040-12-22

AI Technical Summary

Technical Problem

Traditional packaging material identification methods are susceptible to on-site environment because classification reasoning equipment is easily affected by the on-site environment, resulting in low accuracy in packaging material identification.

Method used

By obtaining the image data to be identified, detecting the number of images, and inputting the image data into the trained packaging material visual recognition model for synchronous prediction, combined with weighted fusion technology, the accuracy of packaging material recognition is improved.

Benefits of technology

It improves the accuracy and efficiency of packaging material identification, enhances the ability to identify packaging material categories, and is suitable for the identification of multiple packaging material categories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114663717B_ABST
    Figure CN114663717B_ABST
Patent Text Reader

Abstract

The present application relates to a packaging material visual recognition method, device, computer equipment and storage medium. The method comprises: obtaining image data to be recognized, the image data to be recognized carrying an order identification; detecting the number of images to be recognized in the image data to be recognized; when the image data to be recognized includes at least two images to be recognized, inputting the image data to be recognized into a trained packaging material visual recognition model, performing synchronous prediction on the images to be recognized through the packaging material visual recognition model, and obtaining an initial packaging material visual recognition result corresponding to the images to be recognized; performing weighted fusion on the initial packaging material visual recognition result, and obtaining a target packaging material visual recognition result corresponding to the order identification. The use of this method can improve the efficiency and accuracy of packaging material visual recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a packaging material visual recognition method, device, computer equipment and storage medium. Background Art

[0002] With the development of computer technology, packaging material identification technology has emerged. Packaging material identification technology refers to the identification of the types of packaging materials used to make items. Packaging material identification technology can be applied to multiple technical fields. For example, in the field of logistics, packaging material identification technology can specifically refer to the identification of the types of packaging materials used to make packages. Common types of packaging materials include cartons, document envelopes, packaging plastic bags, recyclable packaging materials, etc.

[0003] In traditional technology, the commonly used method for packaging material identification is to deploy classification and reasoning equipment on the parcel sorting line to identify packaging materials.

[0004] However, the traditional method has the problem of low accuracy in packaging material recognition because the classification and reasoning equipment is easily affected by the on-site environment. Summary of the invention

[0005] Based on this, it is necessary to provide a packaging material visual recognition method, device, computer equipment and storage medium that can improve the accuracy of packaging material recognition in order to address the above technical problems.

[0006] A packaging material visual identification method, the method comprising:

[0007] Acquire the image data to be identified, where the image data to be identified carries an order identifier;

[0008] Detecting the number of to-be-recognized images in the to-be-recognized image data;

[0009] When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to perform synchronous prediction on the images to be recognized to obtain an initial packaging material visual recognition result corresponding to the images to be recognized;

[0010] The initial packaging material visual recognition results are weighted fused to obtain the target packaging material visual recognition results corresponding to the order identification.

[0011] In one embodiment, after detecting the number of to-be-recognized images in the to-be-recognized image data, the method further includes:

[0012] When the image data to be identified includes a single image to be identified, storing the single image to be identified in a preset image cache space;

[0013] Return to the step of obtaining the image data to be recognized, until the number of images in the preset image cache space reaches the preset synchronization processing threshold, input the cached image to be recognized in the preset image cache space into the trained packaging material visual recognition model, and obtain the predicted packaging material visual recognition result corresponding to the cached image to be recognized;

[0014] According to the predicted packaging material visual recognition result, a target packaging material visual recognition result of the order identification corresponding to the cached image to be recognized is obtained.

[0015] In one embodiment, the packaging material visual identification method further comprises:

[0016] Acquire sample image data carrying packaging material annotations;

[0017] The initial packaging material visual recognition model is trained according to the sample image data to obtain a trained packaging material visual recognition model.

[0018] In one embodiment, the initial packaging material visual recognition model is trained according to the sample image data to obtain the trained packaging material visual recognition model, including:

[0019] The initial packaging material visual recognition model is trained according to the sample image data to obtain the packaging material visual recognition model to be optimized;

[0020] The optimization tool is called to optimize the packaging material visual recognition model to be optimized, the convolution layer, batch normalization layer, and activation layer in the packaging material visual recognition model to be optimized are merged into a calculation layer, and the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized is quantified to obtain the trained packaging material visual recognition model.

[0021] In one embodiment, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to synchronously predict the image to be recognized, so as to obtain an initial packaging material visual recognition result corresponding to the image to be recognized, including:

[0022] Input the image data to be recognized and the number of images to be recognized into the trained packaging material visual recognition model, and perform synchronous prediction on the images to be recognized by the packaging material visual recognition model to obtain packaging material visual recognition prediction results corresponding to the image data to be recognized;

[0023] The packaging material visual recognition prediction results are divided according to the preset recognition prediction vector length to obtain the initial packaging material visual recognition results corresponding to the image to be recognized.

[0024] In one embodiment, the packaging material visual recognition prediction results are divided according to the preset recognition prediction vector length, and the initial packaging material visual recognition results corresponding to the image to be recognized are obtained, including:

[0025] Determine the storage location of the packaging material visual recognition prediction result in the preset memory space;

[0026] Set the memory pointer according to the storage location;

[0027] The packaging material visual recognition prediction results are divided according to the memory pointer and the preset recognition prediction vector length to obtain the initial packaging material visual recognition results corresponding to the image to be recognized.

[0028] In one embodiment, the initial packaging material visual recognition results are weightedly fused to obtain the target packaging material visual recognition results corresponding to the order identifier, including:

[0029] Based on the initial packaging material visual recognition results, the confidence that the packaging material belongs to each preset packaging material category and the frequency of occurrence of the category are calculated, and the packaging material corresponds to the order identification;

[0030] Calculate the category weight of each preset packaging material category according to the category occurrence frequency and the preset weight formula;

[0031] According to the confidence, the category weight and the preset category confidence prior value, the category probability of the packaging material belonging to each preset packaging material category is obtained;

[0032] According to the category probability, the visual recognition result of the target packaging material corresponding to the order identification is obtained.

[0033] A packaging material visual identification device, the device comprising:

[0034] An acquisition module is used to acquire image data to be identified, where the image data to be identified carries an order identifier;

[0035] A detection module, used for detecting the number of images to be identified in the image data to be identified;

[0036] A prediction module, for inputting the image data to be recognized into a trained packaging material visual recognition model when the image data to be recognized includes at least two images to be recognized, and performing synchronous prediction of the images to be recognized by the packaging material visual recognition model to obtain an initial packaging material visual recognition result corresponding to the images to be recognized;

[0037] The processing module is used to perform weighted fusion on the initial packaging material visual recognition results to obtain the target packaging material visual recognition results corresponding to the order identification.

[0038] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0039] Acquire the image data to be identified, where the image data to be identified carries an order identifier;

[0040] Detecting the number of to-be-recognized images in the to-be-recognized image data;

[0041] When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to perform synchronous prediction on the images to be recognized to obtain an initial packaging material visual recognition result corresponding to the images to be recognized;

[0042] The initial packaging material visual recognition results are weighted fused to obtain the target packaging material visual recognition results corresponding to the order identification.

[0043] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0044] Acquire the image data to be identified, where the image data to be identified carries an order identifier;

[0045] Detecting the number of to-be-recognized images in the to-be-recognized image data;

[0046] When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to perform synchronous prediction on the images to be recognized to obtain an initial packaging material visual recognition result corresponding to the images to be recognized;

[0047] The initial packaging material visual recognition results are weighted fused to obtain the target packaging material visual recognition results corresponding to the order identification.

[0048] The above-mentioned packaging material visual recognition method, device, computer equipment and storage medium obtain image data to be recognized. When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the image to be recognized is synchronously predicted by the packaging material visual recognition model to obtain an initial packaging material visual recognition result corresponding to the image to be recognized. The packaging material visual recognition efficiency can be improved by synchronous prediction, and the initial packaging material visual recognition result can be weightedly fused to obtain a target packaging material visual recognition result corresponding to the order mark. The packaging material visual recognition accuracy can be improved by weighted fusion. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of a process of a packaging material visual recognition method in one embodiment;

[0050] Figure 2 A schematic diagram of a packaging material visual recognition method in one embodiment;

[0051] Figure 3 A schematic diagram of a packaging material visual recognition method in another embodiment;

[0052] Figure 4 is a structural block diagram of a packaging material visual recognition device in one embodiment;

[0053] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] In one embodiment, Figure 1 As shown, a packaging material visual recognition method is provided. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0056] Step 102: Acquire the image data to be identified, where the image data to be identified carries an order identifier.

[0057] The image data to be identified refers to the image data collected by the image acquisition device configured by the existing sorting equipment in the parcel transfer yard. Due to the different types and functions of the sorting equipment, the configured image acquisition devices are not exactly the same, so the images to be identified collected by different parcels are not exactly the same. For example, the image data to be identified may include only a single image to be identified. For another example, the image data to be identified may include at least two images to be identified. The order identifier is used to distinguish the parcels corresponding to the image data to be identified. For example, the order identifier may specifically refer to the order number of the parcel corresponding to the image data to be identified.

[0058] For example, common sorting equipment includes: matrix camera sorting equipment, pendulum wheel sorting equipment, small-piece bagging sorting equipment and small-piece turntable sorting equipment. For matrix camera sorting equipment and pendulum wheel sorting equipment, image acquisition devices are configured at multiple viewing angles, so at least two images to be identified can be acquired for each package at the same time. However, small-piece bagging sorting equipment and small-piece turntable sorting equipment are only configured with image acquisition devices at the top, so only a single image to be identified can be acquired for each package.

[0059] Specifically, the image acquisition device configured by the sorting equipment at the parcel transfer site will collect the image data to be identified, and the collected image data to be identified will be first stored locally on the industrial computer, and then transmitted to the server through the network transmission protocol by the forwarding service mechanism, so that the server can obtain the image data to be identified. Furthermore, the server includes a graphics processor, and the server can obtain the image data to be identified from the transmitted data by using the graphics processor to perform image decoding, and then perform the next step of image processing in the graphics processor.

[0060] Step 104: Detect the number of images to be recognized in the image data to be recognized.

[0061] Specifically, since the number of images to be identified collected by the image acquisition devices configured in different sorting devices is not exactly the same, after obtaining the image data to be identified, the server must first detect the number of images to be identified in the image data to be identified, and further perform visual identification of packaging materials in different ways according to the number of images to be identified. For example, the number of images to be identified in the image data to be identified can be a single image or at least two images.

[0062] Step 106, when the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into the trained packaging material visual recognition model, and the packaging material visual recognition model is used to synchronously predict the images to be recognized to obtain initial packaging material visual recognition results corresponding to the images to be recognized.

[0063] Among them, the trained packaging material visual recognition model refers to a model that identifies the packaging material category of a package based on the image to be recognized, and it can output the packaging material category corresponding to the image to be recognized. For example, common packaging material categories include cartons, document envelopes, packaging plastic bags, recyclable packaging materials, etc. Further, for express delivery companies, since they are equipped with their own brand packaging materials when packaging packages, the packaging material categories can be further divided into self-branded cartons, other cartons, self-branded document envelopes, other document envelopes, self-branded packaging plastic bags, other packaging plastic bags, self-branded recyclable packaging materials, other recyclable packaging materials, etc. The initial packaging material visual recognition result refers to the packaging material category of the packaging material corresponding to the image to be recognized output by the trained packaging material visual recognition model and the probability of belonging to the packaging material category.

[0064] Specifically, when the image data to be identified includes at least two images to be identified, the server will first input the image data to be identified into the trained packaging material visual recognition model, and perform synchronous prediction on the images to be identified through the packaging material visual recognition model to obtain packaging material visual recognition prediction results corresponding to the image data to be identified, and then divide the initial packaging material visual recognition results corresponding to each image to be identified from the packaging material visual recognition prediction results.

[0065] Step 108: weighted fusion is performed on the initial packaging material visual recognition results to obtain a target packaging material visual recognition result corresponding to the order identifier.

[0066] Among them, since the initial packaging material visual recognition result corresponds to the image to be recognized, and the image data to be recognized includes at least two images to be recognized, it is necessary to perform weighted fusion on the initial packaging material visual recognition result to obtain the target packaging material visual recognition result corresponding to the order logo, that is, comprehensively consider the initial packaging material visual recognition results corresponding to all images to be recognized to obtain the target packaging material visual recognition result.

[0067] Specifically, the server will calculate the confidence that the packaging material belongs to each preset packaging material category and the category occurrence frequency based on the initial packaging material visual recognition result, and then calculate the category weight of each preset packaging material category based on the category occurrence frequency. Finally, based on the category weight, confidence and preset category confidence prior value, the server obtains the category probability that the packaging material belongs to each preset packaging material category, and obtains the target packaging material visual recognition result based on the category probability.

[0068] Among them, the confidence level of belonging to each preset packaging material category refers to the probability that the packaging material in the initial packaging material visual recognition result belongs to the packaging material category. The category occurrence frequency refers to the frequency of each preset packaging material category appearing in all initial packaging material visual recognition results, which is a value between 0 and 1. The category weight is used to characterize the weight of each preset packaging material category. The category weight in this embodiment is mainly used to widen the weight difference between the preset packaging material category with a high category occurrence frequency and the preset packaging material category with a low category occurrence frequency, so that the preset packaging material category with a high category occurrence frequency has a higher confidence level. The category confidence prior value is used to measure the priority level of different preset packaging material categories and balance the difficulty of classification of different packaging material categories. For example, for preset packaging material categories with high priority and preset packaging material categories that are easier to distinguish, a higher category confidence prior value can be set in advance.

[0069] The above-mentioned packaging material visual recognition method obtains image data to be recognized. When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the image to be recognized is synchronously predicted by the packaging material visual recognition model to obtain an initial packaging material visual recognition result corresponding to the image to be recognized. The packaging material visual recognition efficiency can be improved by synchronous prediction, and the target packaging material visual recognition result corresponding to the order mark can be obtained by weighted fusion of the initial packaging material visual recognition result. The packaging material visual recognition accuracy can be improved by weighted fusion.

[0070] In one embodiment, after detecting the number of to-be-recognized images in the to-be-recognized image data, the method further includes:

[0071] When the image data to be identified includes a single image to be identified, storing the single image to be identified in a preset image cache space;

[0072] Return to the step of obtaining the image data to be recognized, until the number of images in the preset image cache space reaches the preset synchronization processing threshold, input the cached image to be recognized in the preset image cache space into the trained packaging material visual recognition model, and obtain the predicted packaging material visual recognition result corresponding to the cached image to be recognized;

[0073] According to the predicted packaging material visual recognition result, a target packaging material visual recognition result of the order identification corresponding to the cached image to be recognized is obtained.

[0074] The preset image cache space refers to a preset space for image cache. The preset synchronous processing threshold refers to a preset number of images that can be processed simultaneously, which is the same as the threshold of the number of images that can be processed simultaneously by the trained packaging material visual recognition model. The threshold of the number of images that can be processed simultaneously by the model can be set as needed.

[0075] Specifically, when the image data to be identified includes a single image to be identified, the server will store the single image to be identified in a preset image cache space, return to the step of obtaining the image data to be identified, continue to obtain the image data to be identified and detect the number of images to be identified in the image data to be identified, when the image data to be identified includes a single image to be identified, continue to store the single image to be identified in the preset image cache space, return to the step of obtaining the image data to be identified, until the number of images in the preset image cache space reaches the preset synchronization processing threshold, input the cached image to be identified in the preset image cache space into the trained packaging material visual recognition model for synchronous prediction, obtain the undivided prediction results corresponding to all cached images to be identified, and then divide the undivided prediction results according to the preset recognition prediction vector length to obtain the predicted packaging material visual recognition results corresponding to each cached image to be identified, and obtain the target packaging material visual recognition results of the order identification corresponding to the cached image to be identified according to the predicted packaging material visual recognition results. Among them, the preset recognition prediction vector length is the preset number of packaging material categories.

[0076] Among them, the method of dividing the undivided prediction results according to the preset recognition prediction vector length can be: determining the storage position of the undivided prediction results in the preset memory space, setting the corresponding memory pointer to point to the starting position according to the storage position, and dividing the undivided prediction results according to the starting position and the preset recognition prediction vector length to obtain the predicted packaging material visual recognition result corresponding to each cached image to be recognized.

[0077] It should be noted that, in this embodiment, after the cached image to be identified in the preset image cache space is input into the trained packaging material visual recognition model for synchronous prediction, the data in the preset image cache space will be cleared to cache a new single image to be identified. If, after returning to the step of obtaining the image data to be identified, the obtained image data to be identified includes at least two images to be identified, the server will directly input the image data to be identified into the trained packaging material visual recognition model for processing to obtain the target packaging material visual recognition result corresponding to the order identification.

[0078] In this embodiment, by storing a single image to be identified in a preset image cache space, when the number of images in the preset image cache space reaches a preset synchronous processing threshold, the cached image to be identified in the preset image cache space is input into the trained packaging material visual recognition model to obtain a predicted packaging material visual recognition result corresponding to the cached image to be identified, and based on the predicted packaging material visual recognition result, a target packaging material visual recognition result of the order mark is obtained, which can achieve full utilization of the synchronous prediction of the packaging material visual recognition model, thereby improving the recognition efficiency.

[0079] In one embodiment, the packaging material visual identification method further comprises:

[0080] Acquire sample image data carrying packaging material annotations;

[0081] The initial packaging material visual recognition model is trained according to the sample image data to obtain a trained packaging material visual recognition model.

[0082] The packaging material label is used to characterize the preset packaging material category corresponding to the sample image in the sample image data. The sample image refers to the packaging material image of the package that has been collected. The initial packaging material visual recognition model refers to the packaging material visual recognition model that has not yet been parameter adjusted. For example, the packaging material visual recognition model can specifically refer to a classification model, and the classification model can specifically be ResNet (Deep residual network), etc. In this embodiment, the classification model is not specifically limited here.

[0083] Specifically, when training the packaging material visual recognition model, the server will obtain sample image data carrying packaging material annotations, input the sample image in the sample image data into the initial packaging material visual recognition model, obtain the sample image prediction result output by the initial packaging material visual recognition model, compare the sample image prediction result with the packaging material annotation carried by the sample image, calculate the model loss function, and adjust the model parameters of the initial packaging material visual recognition model by back propagation according to the model loss function until the model loss function meets the preset requirements, thereby obtaining the packaging material visual recognition model to be optimized, and then optimizing the packaging material visual recognition model to be optimized to obtain the trained packaging material visual recognition model. Among them, until the model loss function meets the preset requirements may refer to the model loss function convergence or the model loss function is less than the preset loss function threshold, etc., which is not specifically limited in this embodiment.

[0084] In this embodiment, by acquiring sample image data carrying packaging material annotations, the initial packaging material visual recognition model is trained according to the sample image data to obtain a trained packaging material visual recognition model, thereby enabling the training of the packaging material visual recognition model.

[0085] In one embodiment, the initial packaging material visual recognition model is trained according to the sample image data to obtain the trained packaging material visual recognition model, including:

[0086] The initial packaging material visual recognition model is trained according to the sample image data to obtain the packaging material visual recognition model to be optimized;

[0087] The optimization tool is called to optimize the packaging material visual recognition model to be optimized, the convolution layer, batch normalization layer, and activation layer in the packaging material visual recognition model to be optimized are merged into a calculation layer, and the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized is quantified to obtain the trained packaging material visual recognition model.

[0088] The optimization tool refers to a tool for optimizing a model. For example, the optimization tool may specifically refer to a TensorRT tool.

[0089] Specifically, the server will first train the initial packaging material visual recognition model based on the sample image data to obtain the packaging material visual recognition model to be optimized, and then call the optimization tool to perform layer fusion and weight quantization on the packaging material visual recognition model to be optimized to obtain the trained packaging material visual recognition model. Layer fusion refers to merging the convolution layer, batch normalization layer, and activation layer in the packaging material visual recognition model to be optimized into a calculation layer for calculation, and weight quantization refers to quantizing the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized. For example, weight quantization can specifically refer to quantizing the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized from 32-bit floating point numbers to 16-bit floating point numbers, 8-bit integers, etc. When optimizing the packaging material visual recognition model to be optimized, the threshold for the number of images that the model can process simultaneously will be set so that the optimized trained packaging material visual recognition model can support simultaneous reasoning of multiple images.

[0090] In this embodiment, after obtaining the packaging material visual recognition model to be optimized, the optimization tool is called to perform layer fusion and weight quantization on the packaging material visual recognition model to be optimized, so as to obtain a trained packaging material visual recognition model.

[0091] In one embodiment, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to synchronously predict the image to be recognized, so as to obtain an initial packaging material visual recognition result corresponding to the image to be recognized, including:

[0092] Input the image data to be recognized and the number of images to be recognized into the trained packaging material visual recognition model, and perform synchronous prediction on the images to be recognized by the packaging material visual recognition model to obtain packaging material visual recognition prediction results corresponding to the image data to be recognized;

[0093] The packaging material visual recognition prediction results are divided according to the preset recognition prediction vector length to obtain the initial packaging material visual recognition results corresponding to the image to be recognized.

[0094] The preset recognition prediction vector length refers to a preset recognition prediction vector length, which is the same as the number of preset packaging material categories, that is, when there are X preset packaging material categories, the preset recognition prediction vector length is X.

[0095] Specifically, the server will input the image data to be identified and the number of images to be identified into the trained packaging material visual recognition model, and synchronously predict the images to be identified through the packaging material visual recognition model to obtain the packaging material visual recognition prediction results corresponding to the image data to be identified. Since synchronous prediction is performed here, the packaging material visual recognition prediction results output by the packaging material visual recognition model are not divided. In order to obtain the initial packaging material visual recognition results corresponding to each image to be identified, it is necessary to further divide the packaging material visual recognition prediction results according to the preset recognition prediction vector length, and obtain the prediction results to be sorted corresponding to each image to be identified through division. The prediction results to be sorted here refer to the probability that the image to be identified belongs to each preset packaging material category. By sorting the probabilities that the image to be identified belongs to each preset packaging material category, the packaging material category with the largest probability can be selected as the initial packaging material visual recognition result corresponding to the image to be identified. Furthermore, before the image data to be identified is input into the trained packaging material visual recognition model, it is also necessary to perform image preprocessing on the image to be identified in the image data to make the packaging material visual recognition more accurate.

[0096] For example, Figure 2 As shown, the image data to be identified includes three images to be identified. When visually identifying packaging materials, the server will input the image data to be identified and the number of images to be identified into the trained packaging material visual recognition model, and synchronously predict the images to be identified through the packaging material visual recognition model to obtain the packaging material visual recognition prediction results corresponding to the image data to be identified (i.e. Figure 2 The inference results in the GPU (Graphics Processing Unit) are then divided according to the preset recognition prediction vector length to obtain the prediction results to be sorted corresponding to the image to be recognized (i.e. Figure 2The inference results in the CPU (Central Processing Unit) are further sorted to obtain the initial packaging material visual recognition results corresponding to the image to be recognized (i.e. Figure 2 Category 1, Category 2 and Category 3).

[0097] It should be noted that the visual recognition of packaging materials in the present application can be realized by the cooperation of the graphics processor and the central processing unit in the server. When obtaining the image data to be recognized, the server can obtain the image data to be recognized from the transmitted data by using the graphics processor to perform image decoding, and then detect the number of images to be recognized in the image data to be recognized in the graphics processor. When the image data to be recognized includes three images to be recognized, the image data to be recognized including the three images to be recognized are input into the trained visual recognition model of packaging materials to obtain the visual recognition prediction results of packaging materials corresponding to the image data to be recognized, and then the visual recognition prediction results of packaging materials corresponding to the image data to be recognized are transmitted to the central processing unit, so that the central processing unit can divide the visual recognition prediction results of packaging materials according to the preset recognition prediction vector length to obtain the initial visual recognition results of packaging materials corresponding to the image to be recognized. In this way, the number of data transmissions between the central processing unit and the graphics processor can be reduced, thereby improving the visual recognition efficiency of packaging materials.

[0098] In this embodiment, after obtaining the packaging material visual recognition prediction results corresponding to the image data to be recognized, the packaging material visual recognition prediction results are divided according to the preset recognition prediction vector length to obtain the initial packaging material visual recognition results corresponding to the image to be recognized, thereby achieving the acquisition of the initial packaging material visual recognition results.

[0099] In one embodiment, the packaging material visual recognition prediction results are divided according to the preset recognition prediction vector length, and the initial packaging material visual recognition results corresponding to the image to be recognized are obtained, including:

[0100] Determine the storage location of the packaging material visual recognition prediction result in the preset memory space;

[0101] Set the memory pointer according to the storage location;

[0102] The packaging material visual recognition prediction results are divided according to the memory pointer and the preset recognition prediction vector length to obtain the initial packaging material visual recognition results corresponding to the image to be recognized.

[0103] Specifically, the obtained packaging material visual recognition prediction results will be stored in the preset memory space. The server needs to first determine the storage location of the packaging material visual recognition prediction results in the preset memory space, set a memory pointer according to the storage location to point to the starting storage location in the storage location, and then divide the packaging material visual recognition prediction results according to the memory pointer and the preset recognition prediction vector length. The prediction results to be sorted corresponding to each image to be identified are obtained through division. The prediction results to be sorted here refer to the probability that the image to be identified belongs to each preset packaging material category. By sorting the probabilities that the image to be identified belongs to each preset packaging material category, the packaging material category with the highest probability can be selected as the initial packaging material visual recognition result corresponding to the image to be identified. Furthermore, when dividing the packaging material visual recognition prediction results according to the memory pointer and the preset recognition prediction vector length, the method used is: slide the memory pointer according to the preset recognition prediction vector length, and determine the prediction results to be sorted corresponding to each image to be identified by sliding successively.

[0104] For example, Figure 2 As shown in the figure, the visual recognition prediction results of the packaging materials corresponding to the image data to be recognized (i.e. Figure 2 The inference result (GPU) in the packaging material visual recognition model is the prediction result output by the packaging material visual recognition model for the image data to be recognized. When it is necessary to determine the initial packaging material visual recognition result corresponding to the image to be recognized in the image data to be recognized, the server will first determine the storage location of the packaging material visual recognition prediction result in the preset memory space, and set the memory pointer according to the storage location to point to the starting storage location in the storage location (such as Figure 2 202 in the figure), and then slide the memory pointer according to the preset recognition prediction vector length. When sliding for the first time, the memory pointer will slide to Figure 2 204 in the image to be identified, thereby obtaining the prediction result to be sorted corresponding to the first image to be identified. According to the prediction result to be sorted, the category of the first image to be identified is category 1. When sliding for the second time, the memory pointer will slide to Figure 2 206 in the memory, thereby obtaining the prediction result to be sorted corresponding to the second image to be identified. According to the prediction result to be sorted, the category of the second image to be identified is category 2. When sliding for the third time, the memory pointer will slide to Figure 2 208 in the image, thereby obtaining a prediction result to be sorted corresponding to the third image to be identified. According to the prediction result to be sorted, the category of the third image to be identified is category 3.

[0105] In this embodiment, by determining the storage location of the packaging material visual recognition prediction results in a preset memory space, setting a memory pointer according to the storage location, and dividing the packaging material visual recognition prediction results according to the memory pointer and the preset recognition prediction vector length, the initial packaging material visual recognition results corresponding to the image to be recognized are obtained, thereby realizing the division of the packaging material visual recognition prediction results and obtaining the initial packaging material visual recognition results.

[0106] In one embodiment, the initial packaging material visual recognition results are weightedly fused to obtain the target packaging material visual recognition results corresponding to the order identifier, including:

[0107] Based on the initial packaging material visual recognition results, the confidence that the packaging material belongs to each preset packaging material category and the frequency of occurrence of the category are calculated, and the packaging material corresponds to the order identification;

[0108] Calculate the category weight of each preset packaging material category according to the category occurrence frequency and the preset weight formula;

[0109] According to the confidence, the category weight and the preset category confidence prior value, the category probability of the packaging material belonging to each preset packaging material category is obtained;

[0110] According to the category probability, the visual recognition result of the target packaging material corresponding to the order identification is obtained.

[0111] Specifically, the server will count the confidence that the packaging material belongs to each preset packaging material category based on the initial packaging material visual recognition result, and calculate the category occurrence frequency. According to the category occurrence frequency and the preset weight formula, the server will calculate the category weight of each preset packaging material category. According to the confidence, category weight and preset category confidence prior value, the server will obtain the category probability that the packaging material belongs to each preset packaging material category, normalize the category probability, sort the normalized category probabilities, and determine that the preset packaging material category corresponding to the maximum category probability is the target packaging material visual recognition result corresponding to the order identifier.

[0112] The preset weight formula can be set as needed. For example, the preset weight formula can be where n c refers to the frequency of occurrence of the category, w c is the category weight, and the category probability can be specifically the product of the confidence, the category weight, and the preset category confidence prior value. The formula for normalizing the category probability can be: where p c and p i It refers to the class probability.

[0113] In this embodiment, the confidence that the packaging material belongs to each preset packaging material category and the category occurrence frequency are first calculated, and then the category weight of each preset packaging material category is calculated according to the category occurrence frequency and the preset weight formula. According to the confidence, the category weight and the preset category confidence prior value, the category probability that the packaging material belongs to each preset packaging material category is obtained, and finally, according to the category probability, the target packaging material visual recognition result corresponding to the order identification is obtained, which can realize the calculation of the target packaging material visual recognition result.

[0114] like Figure 3 As shown, a schematic diagram is used to illustrate the packaging material visual identification method of the present application.

[0115] The parcel transfer yard includes a matrix sorting line and a small-piece sorting line. The matrix sorting line is equipped with four image acquisition devices (camera 1, camera 2, camera 3, and camera 4), and the small-piece sorting line is equipped with one image acquisition device (camera 5 and camera 6). The image acquisition device on each sorting line acquires camera images (image data to be recognized) and transmits them to the edge inference server (i.e., server). The edge inference server obtains the camera image carrying the order identification, detects the number of images to be recognized in the camera image, and adopts different methods for further processing according to the number of images to be recognized.

[0116] For the matrix sorting line, its camera image includes four images to be identified. The edge inference server will input the camera image into the trained packaging material visual recognition model, and use the packaging material visual recognition model to synchronously predict the image to be identified in the camera image to obtain the initial packaging material visual recognition result corresponding to the image to be identified. The initial packaging material visual recognition result is weightedly fused to obtain the target packaging material visual recognition result corresponding to the order logo (i.e., classification fusion).

[0117] For the small-item sorting line, the camera image is a single image to be identified. The edge inference server will store the single image to be identified in the preset image cache space, and return to the step of obtaining the image data to be identified until the number of images in the preset image cache space reaches the preset synchronization processing threshold. The cached image to be identified in the preset image cache space is input into the trained packaging material visual recognition model to obtain the predicted packaging material visual recognition result corresponding to the cached image to be identified. According to the predicted packaging material visual recognition result, the target packaging material visual recognition result (i.e., the order identification corresponding to the cached image to be identified) is obtained. Figure 3 in "Group order").

[0118] It should be understood that, although the steps in each flow chart involved in the above-described embodiment are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in each flow chart involved in the above-described embodiment may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0119] In one embodiment, Figure 4 As shown, a packaging material visual recognition device is provided, including: an acquisition module 402, a detection module 404, a prediction module 406 and a processing module 408, wherein:

[0120] An acquisition module 402 is used to acquire image data to be identified, where the image data to be identified carries an order identifier;

[0121] A detection module 404 is used to detect the number of to-be-recognized images in the to-be-recognized image data;

[0122] A prediction module 406 is used for inputting the image data to be recognized into the trained packaging material visual recognition model when the image data to be recognized includes at least two images to be recognized, and synchronously predicting the images to be recognized by the packaging material visual recognition model to obtain an initial packaging material visual recognition result corresponding to the images to be recognized;

[0123] The processing module 408 is used to perform weighted fusion on the initial packaging material visual recognition results to obtain a target packaging material visual recognition result corresponding to the order identifier.

[0124] The above-mentioned packaging material visual recognition device obtains image data to be recognized. When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the image to be recognized is synchronously predicted by the packaging material visual recognition model to obtain an initial packaging material visual recognition result corresponding to the image to be recognized. The packaging material visual recognition efficiency can be improved by synchronous prediction, and the target packaging material visual recognition result corresponding to the order mark can be obtained by weighted fusion of the initial packaging material visual recognition result. The packaging material visual recognition accuracy can be improved by weighted fusion.

[0125] In one embodiment, the packaging material visual recognition device also includes an order-binding module, which is used to store the single image to be recognized into a preset image cache space when the image data to be recognized includes a single image to be recognized, and return to the step of obtaining the image data to be recognized until the number of images in the preset image cache space reaches a preset synchronization processing threshold, and input the cached images to be recognized in the preset image cache space into the trained packaging material visual recognition model to obtain a predicted packaging material visual recognition result corresponding to the cached images to be recognized, and obtain a target packaging material visual recognition result of the order identification corresponding to the cached images to be recognized based on the predicted packaging material visual recognition result.

[0126] In one embodiment, the packaging material visual recognition device further includes a training module, which is used to obtain sample image data carrying packaging material annotations, train an initial packaging material visual recognition model based on the sample image data, and obtain a trained packaging material visual recognition model.

[0127] In one embodiment, the training module is also used to train the initial packaging material visual recognition model according to the sample image data to obtain the packaging material visual recognition model to be optimized, call the optimization tool to optimize the packaging material visual recognition model to be optimized, merge the convolution layer, batch normalization layer and activation layer in the packaging material visual recognition model to be optimized into an operation layer, and quantify the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized to obtain a trained packaging material visual recognition model.

[0128] In one embodiment, the prediction module is also used to input the image data to be identified and the number of images to be identified into a trained packaging material visual recognition model, and synchronously predict the image to be identified through the packaging material visual recognition model to obtain the packaging material visual recognition prediction results corresponding to the image data to be identified, and divide the packaging material visual recognition prediction results according to the preset recognition prediction vector length to obtain the initial packaging material visual recognition results corresponding to the image to be identified.

[0129] In one embodiment, the prediction module is also used to determine the storage location of the packaging material visual recognition prediction results in a preset memory space, set a memory pointer according to the storage location, divide the packaging material visual recognition prediction results according to the memory pointer and the preset recognition prediction vector length, and obtain an initial packaging material visual recognition result corresponding to the image to be recognized.

[0130] In one embodiment, the processing module is also used to calculate the confidence that the packaging material belongs to each preset packaging material category and the category occurrence frequency based on the initial packaging material visual recognition result. The packaging material corresponds to the order identification. The category weight of each preset packaging material category is calculated according to the category occurrence frequency and the preset weight formula. The category probability that the packaging material belongs to each preset packaging material category is obtained according to the confidence, category weight and preset category confidence prior value. According to the category probability, the target packaging material visual recognition result corresponding to the order identification is obtained.

[0131] The specific definition of the packaging material visual identification device can be found in the definition of the packaging material visual identification method above, which will not be repeated here. Each module in the above packaging material visual identification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0132] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sample image data, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a packaging material visual recognition method is implemented.

[0133] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0134] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0135] Acquire the image data to be identified, where the image data to be identified carries an order identifier;

[0136] Detecting the number of to-be-recognized images in the to-be-recognized image data;

[0137] When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to perform synchronous prediction on the images to be recognized to obtain an initial packaging material visual recognition result corresponding to the images to be recognized;

[0138] The initial packaging material visual recognition results are weighted fused to obtain the target packaging material visual recognition results corresponding to the order identification.

[0139] In one embodiment, the processor further implements the following steps when executing the computer program: when the image data to be identified includes a single image to be identified, the single image to be identified is stored in a preset image cache space, and the step of obtaining the image data to be identified is returned until the number of images in the preset image cache space reaches a preset synchronization processing threshold, and the cached image to be identified in the preset image cache space is input into the trained packaging material visual recognition model to obtain a predicted packaging material visual recognition result corresponding to the cached image to be identified, and based on the predicted packaging material visual recognition result, a target packaging material visual recognition result of the order identification corresponding to the cached image to be identified is obtained.

[0140] In one embodiment, when the processor executes the computer program, the following steps are further implemented: acquiring sample image data carrying packaging material annotations, training an initial packaging material visual recognition model based on the sample image data, and obtaining a trained packaging material visual recognition model.

[0141] In one embodiment, when the processor executes the computer program, the following steps are further implemented: training the initial packaging material visual recognition model according to the sample image data to obtain the packaging material visual recognition model to be optimized, calling the optimization tool to optimize the packaging material visual recognition model to be optimized, merging the convolution layer, batch normalization layer and activation layer in the packaging material visual recognition model to be optimized into an operation layer, and quantifying the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized to obtain the trained packaging material visual recognition model.

[0142] In one embodiment, when the processor executes the computer program, the following steps are also implemented: inputting the image data to be identified and the number of images to be identified into a trained packaging material visual recognition model, synchronously predicting the images to be identified through the packaging material visual recognition model to obtain packaging material visual recognition prediction results corresponding to the image data to be identified, dividing the packaging material visual recognition prediction results according to a preset recognition prediction vector length, and obtaining initial packaging material visual recognition results corresponding to the images to be identified.

[0143] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the storage location of the packaging material visual recognition prediction result in a preset memory space, setting a memory pointer according to the storage location, dividing the packaging material visual recognition prediction result according to the memory pointer and the preset recognition prediction vector length, and obtaining an initial packaging material visual recognition result corresponding to the image to be recognized.

[0144] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the initial packaging material visual recognition result, the confidence that the packaging material belongs to each preset packaging material category and the category occurrence frequency are calculated, the packaging material corresponds to the order identification, and the category weight of each preset packaging material category is calculated based on the category occurrence frequency and the preset weight formula; based on the confidence, the category weight and the preset category confidence prior value, the category probability that the packaging material belongs to each preset packaging material category is obtained; based on the category probability, the target packaging material visual recognition result corresponding to the order identification is obtained.

[0145] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0146] Acquire the image data to be identified, where the image data to be identified carries an order identifier;

[0147] Detecting the number of to-be-recognized images in the to-be-recognized image data;

[0148] When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to perform synchronous prediction on the images to be recognized to obtain an initial packaging material visual recognition result corresponding to the images to be recognized;

[0149] The initial packaging material visual recognition results are weighted fused to obtain the target packaging material visual recognition results corresponding to the order identification.

[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the image data to be identified includes a single image to be identified, the single image to be identified is stored in a preset image cache space, and the step of obtaining the image data to be identified is returned until the number of images in the preset image cache space reaches a preset synchronization processing threshold, and the cached image to be identified in the preset image cache space is input into the trained packaging material visual recognition model to obtain a predicted packaging material visual recognition result corresponding to the cached image to be identified, and based on the predicted packaging material visual recognition result, a target packaging material visual recognition result of the order identification corresponding to the cached image to be identified is obtained.

[0151] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: acquiring sample image data carrying packaging material annotations, training an initial packaging material visual recognition model based on the sample image data, and obtaining a trained packaging material visual recognition model.

[0152] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: training the initial packaging material visual recognition model according to the sample image data to obtain the packaging material visual recognition model to be optimized, calling the optimization tool to optimize the packaging material visual recognition model to be optimized, merging the convolution layer, batch normalization layer and activation layer in the packaging material visual recognition model to be optimized into an operation layer, and quantifying the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized to obtain the trained packaging material visual recognition model.

[0153] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: inputting the image data to be identified and the number of images to be identified into a trained packaging material visual recognition model, synchronously predicting the images to be identified through the packaging material visual recognition model to obtain packaging material visual recognition prediction results corresponding to the image data to be identified, dividing the packaging material visual recognition prediction results according to a preset recognition prediction vector length, and obtaining initial packaging material visual recognition results corresponding to the images to be identified.

[0154] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the storage location of the packaging material visual recognition prediction result in a preset memory space, setting a memory pointer according to the storage location, dividing the packaging material visual recognition prediction result according to the memory pointer and the preset recognition prediction vector length, and obtaining an initial packaging material visual recognition result corresponding to the image to be recognized.

[0155] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the initial packaging material visual recognition result, the confidence that the packaging material belongs to each preset packaging material category and the category occurrence frequency are calculated, the packaging material corresponds to the order identification, and the category weight of each preset packaging material category is calculated based on the category occurrence frequency and a preset weight formula; based on the confidence, the category weight and the preset category confidence prior value, the category probability that the packaging material belongs to each preset packaging material category is obtained; based on the category probability, the target packaging material visual recognition result corresponding to the order identification is obtained.

[0156] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0157] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0158] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A packaging material visual identification method, characterized in that: The method comprises: Acquire image data to be identified, where the image data to be identified carries an order identifier; Detecting the number of images to be identified in the image data to be identified; When the image data to be recognized includes at least two images to be recognized, the image data to be recognized is input into a trained packaging material visual recognition model, and the packaging material visual recognition model is used to synchronously predict the images to be recognized to obtain initial packaging material visual recognition results corresponding to the images to be recognized; Calculating, based on the initial packaging material visual recognition results, the confidence that the packaging material belongs to each preset packaging material category and the category occurrence frequency, wherein the packaging material corresponds to the order identifier, and the category occurrence frequency refers to the frequency at which each preset packaging material category appears in all initial packaging material visual recognition results; Obtaining the category probability that the packaging material belongs to each preset packaging material category according to the category occurrence frequency, the confidence and the preset category confidence prior value; According to the category probability, a target packaging material visual recognition result corresponding to the order identification is obtained.

2. The method according to claim 1, characterized in that After detecting the number of the to-be-recognized images in the to-be-recognized image data, the method further includes: When the image data to be identified includes a single image to be identified, storing the single image to be identified in a preset image cache space; Returning to the step of acquiring the image data to be recognized, until the number of images in the preset image cache space reaches a preset synchronization processing threshold, the cached image to be recognized in the preset image cache space is input into the trained packaging material visual recognition model to obtain a predicted packaging material visual recognition result corresponding to the cached image to be recognized; According to the predicted packaging material visual recognition result, a target packaging material visual recognition result of the order identification corresponding to the cached image to be recognized is obtained.

3. The method according to claim 1, characterized in that Also includes: Acquire sample image data carrying packaging material annotations; The initial packaging material visual recognition model is trained according to the sample image data to obtain a trained packaging material visual recognition model.

4. The method according to claim 3, characterized in that The step of training the initial packaging material visual recognition model according to the sample image data to obtain a trained packaging material visual recognition model comprises: Training the initial packaging material visual recognition model according to the sample image data to obtain a packaging material visual recognition model to be optimized; An optimization tool is called to optimize the packaging material visual recognition model to be optimized, the convolution layer, the batch normalization layer, and the activation layer in the packaging material visual recognition model to be optimized are merged into a calculation layer, and the accuracy of the model weight parameters of the packaging material visual recognition model to be optimized is quantified to obtain a trained packaging material visual recognition model.

5. The method according to claim 1, characterized in that The step of inputting the image data to be recognized into a trained packaging material visual recognition model, and synchronously predicting the image to be recognized by the packaging material visual recognition model to obtain an initial packaging material visual recognition result corresponding to the image to be recognized includes: Inputting the image data to be recognized and the number of the images to be recognized into a trained packaging material visual recognition model, and synchronously predicting the images to be recognized by the packaging material visual recognition model to obtain a packaging material visual recognition prediction result corresponding to the image data to be recognized; The packaging material visual recognition prediction results are divided according to a preset recognition prediction vector length to obtain an initial packaging material visual recognition result corresponding to the image to be recognized.

6. The method according to claim 5, characterized in that The step of dividing the packaging material visual recognition prediction result according to the preset recognition prediction vector length to obtain the initial packaging material visual recognition result corresponding to the image to be recognized includes: Determining a storage location of the packaging material visual recognition prediction result in a preset memory space; Setting a memory pointer according to the storage location; The packaging material visual recognition prediction result is divided according to the memory pointer and the preset recognition prediction vector length to obtain an initial packaging material visual recognition result corresponding to the image to be recognized.

7. The method according to claim 1, characterized in that The obtaining the category probability that the packaging material belongs to each preset packaging material category according to the category occurrence frequency, the confidence and the preset category confidence prior value includes: Calculate the category weight of each preset packaging material category according to the frequency of occurrence of the category and the preset weight formula; According to the confidence, the category weight and the preset category confidence prior value, the category probability that the packaging material belongs to each preset packaging material category is obtained.

8. A packaging material visual identification device, characterized in that: The device comprises: An acquisition module, used for acquiring image data to be identified, wherein the image data to be identified carries an order identifier; A detection module, used for detecting the number of images to be identified in the image data to be identified; A prediction module, configured to input the image data to be recognized into a trained packaging material visual recognition model when the image data to be recognized includes at least two images to be recognized, and synchronously predict the images to be recognized through the packaging material visual recognition model to obtain an initial packaging material visual recognition result corresponding to the images to be recognized; A processing module is used to calculate, based on the initial packaging material visual recognition result, the confidence that the packaging material belongs to each preset packaging material category and the category occurrence frequency, wherein the packaging material corresponds to the order identifier, and the category occurrence frequency refers to the frequency at which each preset packaging material category appears in all initial packaging material visual recognition results; based on the category occurrence frequency, the confidence and a preset category confidence prior value, obtain the category probability that the packaging material belongs to each preset packaging material category; based on the category probability, obtain the target packaging material visual recognition result corresponding to the order identifier.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.