Method and device for training anomaly detection model

Through intelligent model and graph neural network technology, the packaging weight abnormalities are identified and detected, and the problem of low accuracy of manual detection in the existing technology is solved, achieving more efficient and accurate abnormal detection.

CN119474876APending Publication Date: 2025-02-18BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411642687.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, the method of manual sampling to detect the weight of the package has low detection accuracy and cannot fully cover all packages, resulting in poor detection rate of packages with abnormal weight.

Method used

Intelligent models are used instead of manual sampling and detection. By collecting historical parcel data, identifying abnormal categories and multi-category combinations, constructing category co-occurrence graphs, using graph neural network to extract weight features, and training binary classification models to achieve abnormal detection.

Benefits of technology

It improves the efficiency and accuracy of package weight abnormality detection, supports the detection of single-category and multi-category combination packages, and provides a reliable, efficient and highly applicable detection method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474876A_ABST
    Figure CN119474876A_ABST
Patent Text Reader

Abstract

The invention provides a training method and device for an anomaly detection model, and relates to the computer technology. According to one specific embodiment, the method comprises the steps that package data of historical packages are collected, the package data comprise the category and weight information of each article in the historical packages, and the historical packages comprise single-category packages and multi-category combined packages; identifying abnormal categories and / or abnormal multi-category combinations from the package data; and determining a negative sample and a positive sample according to the abnormal category and / or the abnormal multi-category combination so as to obtain an anomaly detection model. According to the embodiment of the invention, the method is based on the constructed positive sample and negative sample of the article category dimension, and the constructed positive sample and negative sample are from the package data of the single-category package and the multi-category combined package, thereby achieving the accurate and supporting model training of the single-category package and the multi-category combined package. And a reliable, efficient and high-applicability detection method is provided for subsequent abnormal package detection based on the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a training method and device for an anomaly detection model. Background Art

[0002] In the current picking and shipping business process, especially in the transfer process, in addition to being responsible for the physical handling and sorting of packages, site staff also bear the important responsibility of sampling and testing the weight of express packages. This work mainly relies on the subjective judgment and personal experience of employees to identify and correct packages with abnormal weight records. Through manual sampling, employees will re-weigh these abnormal packages, that is, re-weigh and modify the records in the system to ensure the accuracy of the data.

[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:

[0004] The manual sampling method of detecting the weight of packages can only identify some packages with obvious abnormal weights, and the detection accuracy is low. Moreover, this method cannot fully cover all packages, which leads to a poor detection rate for packages with abnormal weights. Summary of the invention

[0005] In view of this, in order to improve the efficiency and accuracy of weight anomaly detection of packages, the embodiments of the present invention use intelligent models to replace manual sampling detection, and provide a training method and device for an anomaly detection model based on express picking services, which achieves accurate model training that supports single-category packages and multi-category combination packages, and provides a reliable, efficient, and highly applicable detection method for subsequent weight anomaly package detection based on the model.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for training an anomaly detection model is provided, comprising:

[0007] Collecting parcel data of historical parcels, wherein the parcel data includes category information and weight information of each item in the historical parcels, and the historical parcels include single-category parcels and multi-category combination parcels;

[0008] Identifying at least one of an abnormal category and an abnormal combination of multiple categories from the package data;

[0009] According to at least one of the abnormal category and the abnormal multi-category combination, determine the abnormal package in the historical packages, use the package data corresponding to the abnormal package as a negative sample, and use the package data corresponding to the remaining packages in the historical packages as positive samples;

[0010] The positive samples and the negative samples are input into a binary classification model for supervised learning to obtain an anomaly detection model.

[0011] Optionally, identifying at least one of abnormal categories and abnormal multi-category combinations from the package data includes: constructing a category co-occurrence graph based on the package data, each node in the category co-occurrence graph represents a category, each node stores weight information of items corresponding to the category represented by the node, and an edge connecting two nodes indicates that the items corresponding to the categories represented by the two nodes are in the same historical package; obtaining weight features of each node based on the category co-occurrence graph; and identifying at least one of abnormal categories and abnormal multi-category combinations in the package data based on the weight features of each node.

[0012] Optionally, based on the weight characteristics of the nodes, at least one of the abnormal categories and abnormal multi-category combinations present in the package data is identified, including: clustering the nodes based on the weight characteristics of the nodes to obtain normal clusters and abnormal clusters, and identifying the nodes in the abnormal clusters as abnormal categories; for each edge, calculating the similarity between the two nodes corresponding to the edge based on the weight characteristics of the two nodes, identifying the abnormal edge based on the similarity, and then obtaining the abnormal multi-category combination.

[0013] Optionally, the weight features of each node are obtained according to the category co-occurrence graph, including: using a graph neural network to convolve the category co-occurrence graph to obtain the weight features of each node.

[0014] Optionally, the positive samples and negative samples are input into a binary classification model for supervised learning to obtain an anomaly detection model, including: marking labels for the positive samples and the negative samples, the labels including single-category packages and multi-category combination packages; the positive samples and their corresponding labels, the negative samples and their corresponding labels are input into a binary classification model for supervised learning to obtain an anomaly detection model.

[0015] Optionally, the positive samples and their corresponding labels, the negative samples and their corresponding labels are input into a binary classification model for supervised learning, including: inputting the positive samples and their corresponding labels, the negative samples and their corresponding labels into a binary classification model for supervised learning, the binary classification model includes multiple task branches, and the multiple task branches include a single category task branch and a multi-category combination task branch; and, during the supervised learning process of the binary classification model, defining a first loss function and a second loss function corresponding to the single category task branch and the multi-category combination task branch, respectively, weighting the first loss function and the second loss function to obtain a comprehensive loss function, taking minimizing the comprehensive loss function as the learning goal, and updating the parameters of the multi-task branch at the same time, thereby obtaining an anomaly detection model.

[0016] According to a second aspect of an embodiment of the present invention, a method for detecting an abnormal package is provided, comprising:

[0017] Acquire package data of the package to be detected, wherein the package data includes category information and weight information of each item in each package;

[0018] The package data of the package to be detected is input into an anomaly detection model trained by any training method provided by the first aspect of the embodiment of the present invention, so as to output a detection result of whether there is an abnormal package in the package to be detected.

[0019] According to a third aspect of an embodiment of the present invention, a training device for an anomaly detection model is provided, comprising:

[0020] A collection module, used to collect parcel data of historical parcels, wherein the parcel data includes category information and weight information of each item in the historical parcels, and the historical parcels include single-category parcels and multi-category combination parcels;

[0021] an identification module, configured to identify at least one of an abnormal category and an abnormal combination of multiple categories from the package data;

[0022] A determination module, configured to determine an abnormal package in the historical packages according to at least one of the abnormal category and the abnormal multi-category combination, and use package data corresponding to the abnormal package as a negative sample and package data corresponding to the remaining packages in the historical packages as a positive sample;

[0023] The training module is used to input the positive samples and the negative samples into a binary classification model for supervised learning to obtain an anomaly detection model.

[0024] According to a fourth aspect of an embodiment of the present invention, there is provided an abnormal package detection device, characterized in that it includes:

[0025] An acquisition module, used to acquire package data of the package to be detected, wherein the package data includes category information and weight information of each item in each package;

[0026] The detection module is used to input the package data of the package to be detected into the anomaly detection model trained by any training method provided by the first aspect of the embodiment of the present invention, so as to output the detection result of whether there is an abnormal package in the package to be detected.

[0027] According to a fifth aspect of an embodiment of the present invention, there is provided an electronic device, including:

[0028] one or more processors;

[0029] a storage device for storing one or more programs,

[0030] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided by the first aspect and the second aspect of the embodiment of the present invention, or any optional implementation of the first aspect or the second aspect.

[0031] According to a sixth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method provided by the first aspect and the second aspect of the embodiment of the present invention, or any optional implementation method of the first aspect or the second aspect is implemented.

[0032] According to the seventh aspect of an embodiment of the present invention, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method provided by the first aspect and the second aspect of the embodiment of the present invention, or any optional implementation of the first aspect or the second aspect.

[0033] An embodiment of the invention has the following advantages or beneficial effects: by collecting package data of historical packages, the package data includes category information and weight information of each item in the historical packages, and the historical packages include single-category packages and multi-category combination packages; identifying at least one of abnormal categories and abnormal multi-category combinations from the package data; determining abnormal packages in historical packages based on at least one of the abnormal categories and abnormal multi-category combinations, and taking the package data corresponding to the abnormal packages as negative samples, and taking the package data corresponding to the remaining packages in the historical packages as positive samples; inputting the positive samples and negative samples into a binary classification model for supervised learning to obtain a technical solution for anomaly detection model, based on the constructed positive samples and negative samples of the item category dimension, and the constructed positive samples and negative samples come from the package data of single-category packages and multi-category combination packages, an accurate model training that supports single-category packages and multi-category combination packages is achieved, providing a reliable, efficient, and highly applicable detection method for subsequent abnormal package detection based on the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present invention and are used together with the specification to illustrate the technical solutions of the present invention. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0035] Figure 1is a schematic diagram of the main process of the training method of the anomaly detection model according to an embodiment of the present invention;

[0036] Figure 2 is a flowchart of a training method for an anomaly detection model according to a reference embodiment of the present invention;

[0037] Figure 3 is a schematic diagram of a category co-occurrence graph of an embodiment of the present invention;

[0038] Figure 4 is a schematic diagram of the recognition result of the category co-occurrence graph according to an embodiment of the present invention;

[0039] Figure 5 is a flowchart of a method for training an anomaly detection model according to another reference embodiment of the present invention;

[0040] Figure 6 Schematic diagram of the composition of the multi-task branch of the binary classification model of an embodiment of the present invention;

[0041] Figure 7 is an overall schematic diagram of a training method for an anomaly detection model according to an embodiment of the present invention;

[0042] Figure 8 is a schematic diagram of main modules of a training device for an anomaly detection model according to an embodiment of the present invention;

[0043] Fig. 9 is a schematic diagram of main modules of an abnormal package detection device according to an embodiment of the present invention;

[0044] Fig.10 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0045] Fig.11 It is a schematic diagram of the structure of a computer system of a terminal device suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0047] It should be noted that in the technical solution of the present invention, the collection, use, storage, sharing and transfer of user personal information involved are in compliance with the provisions of relevant laws and regulations, and it is necessary to inform the user and obtain the user's consent or authorization. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted.

[0048] The raising of the above problems and the solutions are the results obtained by the inventor after practice and careful research. The discovery process of the above problems and the solutions proposed for the above problems should be the contributions made by the inventor to the present invention during the process of the present invention.

[0049] The technical solutions in the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The components of the present invention generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0050] Figure 1 is a schematic diagram of the main process of the training method of the anomaly detection model according to an embodiment of the present invention. As an embodiment of the present invention, Figure 1 As shown, the training method of the anomaly detection model includes steps S101 to S104.

[0051] Step S101: Collecting package data of historical packages, wherein the package data includes category information and weight information of each item in the historical packages, and the historical packages include single-category packages and multi-category combination packages.

[0052] Specifically, in the embodiment of the present invention, the parcel data of historical parcels within a specified time period is collected from the database of the logistics transfer center. Considering that the parcel weight has a certain relationship with the item category, and the weight of items of the same category generally does not differ much, the historical parcels are divided into single-category parcels containing only a single-category item and multi-category combination parcels containing multiple-category items from the item category dimension. Accordingly, the parcel data also includes single-category parcel data and multi-category combination parcel data. Each parcel corresponds to a parcel data, and the parcel data records the information of each item in the parcel, which may specifically include the item SKU code, the category information to which the item belongs, the weight information of the item, and the quantity of the item.

[0053] Considering that the package data may come from different systems or platforms, there will inevitably be noise data in the obtained package data. Therefore, the obtained package data can be cleaned first. Specifically, the mean interpolation method can be used to supplement the missing values ​​in the package, delete duplicate data, and correct the wrong package information to ensure the accuracy and completeness of the data. Then the data is standardized to ensure the consistency and comparability of the data during the model training process, such as normalizing the weight information, encoding the SKU and item category, etc., so as to obtain the package data of the historical package after data cleaning and standardization, as shown in Table 1.

[0054] In Table 1, take package 1 as an example. The package contains items with SKU1 code 52 and SKU2 code 93. The category code of item SKU1 is 15, the quantity is 6, and the unit weight is 23.2. The category code of item SKU2 is 14, the quantity is 1, and the unit weight is 11.25. Similarly, it can be seen that package 2 contains item 1 with SKU1 code 93 and item 2 with SKU1 code 10. The category code of item 1 is 14, the quantity is 1, and the unit weight is 7.25; the category code of item 2 is 8, the quantity is 6, and the unit weight is 11.45. Package 3 contains item 1 with SKU1 code 15 and item 2 with SKU1 code 72. The category code of item 1 is 11, the quantity is 2, and the unit weight is 9.1; the category code of item 2 is 11, the quantity is 3, and the unit weight is 10.13. Furthermore, it can be seen from Table 1 that package 1 and package 2 are multi-category combination packages, and package 3 is a single-category package.

[0055] Step S102: Identify at least one of an abnormal category and an abnormal combination of multiple categories from the package data.

[0056] Specifically, based on the preset similar category list, the package data belonging to the same similar category in the package data are combined into a data set. For example, all categories can be divided into 5 different similar categories according to the similar category list, and each similar category forms a data set, totaling 5 data sets. Correspondingly, for multi-category combinations, based on the similar category list, other multi-category combinations similar to the multi-category combinations in the package data are combined with the multi-category combinations to form a data set. For each data set, which contains several categories or several subsets of package data of multi-category combinations, the difference between the weight of each subset and the weight of each other subset is calculated in turn, and according to the preset difference threshold, it is determined whether there is an abnormal subset in the data set, and then the corresponding abnormal category and / or multi-category combination is determined according to the abnormal subset in each data set. For example, the codes of the abnormal categories finally identified are 11 and 15, and the codes of the abnormal multi-category combinations are 14 and 15, 8 and 14.

[0057] Step S103: Determine an abnormal package in the historical packages according to at least one of the abnormal category and the abnormal multi-category combination, and use package data corresponding to the abnormal package as a negative sample, and use package data corresponding to the remaining packages in the historical packages as a positive sample.

[0058] In an embodiment of the present invention, the abnormal categories and / or abnormal multi-category combinations identified through the above steps are searched for their corresponding item SKU codes, and the item SKU codes are used to trace the source of the items and find the corresponding abnormal packages. The package data corresponding to the abnormal packages are used as negative samples, and the remaining packages in the historical packages except the abnormal packages are determined to be normal packages. Accordingly, the package data corresponding to these normal packages constitute positive samples.

[0059] It can be understood that when the number of remaining packages is much larger than the required number of positive samples, the remaining packages can be weight-checked, and the package data corresponding to the packages that have passed the weight check or are relatively good from the weight check results are used as positive samples.

[0060] Step S104: inputting the positive samples and the negative samples into a binary classification model for supervised learning to obtain an anomaly detection model.

[0061] Specifically, the above positive samples and negative samples are used as training data sets for the binary classification model, and the training data sets are input into the binary classification model. Based on the package data marked as normal weight in the positive samples, the binary classification model is trained to have the ability to detect packages with normal weight. Based on the package data marked as abnormal weight in the negative samples, the binary classification model is trained to have the ability to detect packages with abnormal weight, thereby obtaining an anomaly detection model that can detect whether the weight of a package is abnormal.

[0062] It can be understood that historical packages include single-category packages and multi-category combination packages. Accordingly, abnormal packages may be single-category packages and / or multi-category combination packages. When the abnormal packages are single-category packages and multi-category combination packages, the training sample set composed of positive samples and negative samples includes package data of single-category packages and package data of multi-category combination packages. Then, the anomaly detection model has the ability to detect single-category packages and multi-category combination packages, that is, the anomaly detection model of the embodiment of the present invention supports anomaly detection of single-category packages and anomaly detection of multi-category combination packages, has better scene adaptability, and is more in line with actual needs.

[0063] Figure 2 FIG. 1 is a flow chart of a training method for an anomaly detection model according to a reference embodiment of the present invention. As another embodiment of the present invention, Figure 2 As shown, the training method of the anomaly detection model includes:

[0064] Step S201: Collect package data of historical packages, where the package data includes category information and weight information of each item in the historical packages, and the historical packages include single-category packages and multi-category combination packages.

[0065] Step S202: construct a category co-occurrence graph based on the package data, wherein each node in the category co-occurrence graph represents a category, and each node stores weight information of items corresponding to the category represented by the node. An edge connecting two nodes indicates that the items corresponding to the categories represented by the two nodes are in the same historical package.

[0066] Specifically, in order to improve the readability of the package data and to more easily identify abnormal categories and / or abnormal multi-category combinations from the package data, the embodiment of the present invention performs a graphical conversion on the package data, and constructs a category co-occurrence graph based on the category information involved in the package data. The category information of the embodiment of the present invention can be specifically the third-level category of the item, and the package data of all acquired historical packages constitute a category co-occurrence graph, each third-level category is a node, and each node stores all item information belonging to this category node, such as the SKU code of the item, the quantity of the item, and the unit weight, etc. If two categories appear in the same historical package, then a connecting edge is created between them.

[0067] Figure 3 is a schematic diagram of a category co-occurrence graph of an embodiment of the present invention. Each node is a third-level category code in the package data, and the line between two nodes represents that the items of the two categories belong to one package. It can be understood that when a package contains items of two or more categories, it can be represented by connecting two nodes in it. For example, if the items of category code 1, category code 15 and category code 9 belong to one package, then a line is established between the node of category code 1 and the node of category code 15, a line is established between the node of category code 15 and the node of category code 9, and a line is established between the node of category code 1 and the node of category code 9.

[0068] Step S203: Obtain the weight feature of each node according to the category co-occurrence graph.

[0069] Specifically, based on the category co-occurrence graph constructed above, according to the item information stored in each node, with the weight feature as the extraction target, a general convolutional network is used to extract the weight features of each node to obtain the weight features of each node in the category co-occurrence graph.

[0070] According to one embodiment of the present invention, the weight features of each node are obtained according to the category co-occurrence graph, including: using a graph neural network to convolve the category co-occurrence graph to obtain the weight features of each node.

[0071] Specifically, considering that the category co-occurrence graph will have a large scale when the historical package volume is large, traversing and parsing the category co-occurrence graph to obtain the item information stored in each node, and inputting the traversal and parsing results into a general convolutional network is not only time-consuming but also inefficient in feature extraction. The present invention preferably uses a graph convolutional network (GCN) to extract the weight features of each node in the category co-occurrence graph. The category co-occurrence graph constructed as above is input into the graph convolutional network, and the category co-occurrence graph is convoluted using the graph convolutional network's dedicated ability to process graph data, and the weight features of each node are extracted based on the item information stored in each node in the category co-occurrence graph.

[0072] Step S204: Identify at least one of abnormal categories and abnormal multi-category combinations present in the package data according to the weight characteristics of the nodes.

[0073] Specifically, based on a preset list of similar categories, for each node, a graph convolutional network is used to search for similar categories corresponding to the category of the node, and then similar nodes corresponding to similar categories are obtained, and the numerical deviation between the weight feature of the current node and the node weight feature of the similar node is compared. When the comparison result exceeds the preset similarity threshold, the current node is determined to be an abnormal node, and accordingly, the category of the current node is an abnormal category. Similarly, for a multi-category combination, based on a preset list of similar categories, a graph convolutional network is used to determine that similar categories similar to each category in the multi-category combination form a similar multi-category combination, and then the difference in weight features between each category in the multi-category combination is compared with the difference in weight features between each similar category in the similar multi-category combination. When the comparison result exceeds the preset similarity threshold, the current multi-category combination is determined to be an abnormal multi-category combination.

[0074] According to one embodiment of the present invention, at least one of the abnormal categories and abnormal multi-category combinations present in the package data is identified based on the weight characteristics of the nodes, including: clustering the nodes based on the weight characteristics of the nodes to obtain normal clusters and abnormal clusters, and identifying the nodes in the abnormal clusters as abnormal categories; for each edge, calculating the similarity between the two nodes corresponding to the edge based on the weight characteristics of the two nodes, identifying the abnormal edge based on the similarity, and then obtaining the abnormal multi-category combination.

[0075] Specifically, the embodiment of the present invention also provides a more accurate anomaly identification method, which clusters the weight features of each node in the category co-occurrence graph to obtain normal clusters and abnormal clusters, and identifies each node in the abnormal cluster as an abnormal category. For the identification of abnormal multi-category combinations, the embodiment of the present invention uses the cosine similarity method to calculate the similarity between two nodes based on the weight features of the two nodes corresponding to the edge. For example, if the weight features of two nodes corresponding to an edge are (1.2, 3.4, 2.5) and (2.1, 3.3, 2.8), the cosine similarity between the two nodes is: .

[0076] Furthermore, based on a preset similar category combination that is similar to the category combination corresponding to the current edge, the analog cosine similarity between the two nodes corresponding to the similar category combination is calculated, the above-calculated cosine similarity and the analog cosine similarity are compared, and according to a preset comparison threshold, the abnormal multi-category combination corresponding to the abnormal edge is identified.

[0077] Figure 4 This is a schematic diagram of the recognition result of the category co-occurrence graph according to an embodiment of the present invention. The above node clustering and the cosine similarity method between nodes are used to identify abnormal categories and abnormal multi-category combinations. The red nodes in the figure are identified abnormal nodes, and the red dotted edges are identified abnormal edges. Based on the mapping relationship between graph nodes and categories, the corresponding abnormal categories can be determined according to the abnormal nodes, and the corresponding abnormal multi-category combinations can be determined according to the nodes corresponding to the abnormal edges.

[0078] Step S205: Determine an abnormal package in the historical packages according to at least one of the abnormal category and the abnormal multi-category combination, use package data corresponding to the abnormal package as a negative sample, and use package data corresponding to the remaining packages in the historical packages as a positive sample.

[0079] Step S206: input the positive sample and the negative sample into a binary classification model for supervised learning to obtain an anomaly detection model.

[0080] The embodiment of the present invention adopts the idea of ​​graph theory, constructs a category co-occurrence graph of package data, and then uses an unsupervised graph neural network to optimize the identification method of abnormal categories and abnormal multi-category combinations, thereby facilitating more efficient, accurate and automatic identification of abnormal categories and / or abnormal category combinations from the package data of historical packages, thereby providing training sample data support for the subsequent construction of positive samples and negative samples for training anomaly detection models, which not only eliminates the need for manual annotation of training samples, but also improves the efficiency of constructing subsequent training samples.

[0081] Figure 5FIG. 1 is a flow chart of a training method for an anomaly detection model according to another reference embodiment of the present invention. As another embodiment of the present invention, Figure 5 As shown, the training method of the anomaly detection model includes:

[0082] Step S501: Collect package data of historical packages, where the package data includes category information and weight information of each item in the historical packages, and the historical packages include single-category packages and multi-category combination packages.

[0083] Step S502: Identify at least one of an abnormal category and an abnormal combination of multiple categories from the package data.

[0084] Step S503: Determine an abnormal package in the historical packages according to at least one of the abnormal category and the abnormal multi-category combination, use package data corresponding to the abnormal package as a negative sample, and use package data corresponding to the remaining packages in the historical packages as a positive sample.

[0085] Specifically, based on the abnormal categories and / or abnormal multi-category combinations identified from the parcel data of the historical parcels, the items are traced from the historical parcels to find the corresponding abnormal parcels, and the parcel data corresponding to the abnormal parcels are marked as weight abnormal parcels. Each abnormal parcel is used as a construction dimension to construct negative samples for training the anomaly detection model. In addition, the parcel data corresponding to the remaining parcels in the historical parcels except the abnormal parcels are marked as weight normal parcels. Each parcel is also used as a construction dimension to construct positive samples for training the anomaly detection model.

[0086] Step S504: label the positive samples and the negative samples, wherein the labels include single-category packages and multi-category combination packages.

[0087] Specifically, considering the huge business volume of logistics picking and the diversification of ordering needs, historical packages usually include both single-category packages and multi-category combination packages. And the anomaly detection model also needs to have the ability to detect single-category packages and multi-category combination packages at the same time. Therefore, in order to train the anomaly detection model to detect single-category packages and multi-category combination packages at the same time, the embodiment of the present invention also needs to mark the positive samples and negative samples, and determine the corresponding labels according to the type of historical packages from which the positive samples come. If the historical package from which the positive sample comes is a single-category package, then the label of the positive sample is a single-category package. If the historical package from which the positive sample comes is a multi-category combination package, then the label of the positive sample is a multi-category combination package. Correspondingly, the negative sample also determines the corresponding label according to the type of historical package to which it corresponds. The labels of all positive and negative samples include single-category packages and multi-category combination packages, that is, the training samples of the anomaly detection model cover single-category packages and multi-category combination packages.

[0088] Step S505: input the positive samples and their corresponding labels, and the negative samples and their corresponding labels into a binary classification model for supervised learning to obtain an anomaly detection model.

[0089] Specifically, positive and negative samples with package type labels (single-category packages and multi-category combination packages) are input into the binary classification model, so that the binary classification model can distinguish different types of positive and negative samples according to the labels. The positive and negative samples with single-category package labels are used as a training sample set to train the binary classification model's anomaly detection capability for single-category packages. The positive and negative samples with multi-category combination package labels are used as another training sample set to train the binary classification model's anomaly detection capability for multi-category package combinations. Finally, an anomaly detection model with the ability to detect weight anomalies for single-category packages and multi-category combination packages is obtained.

[0090] According to one embodiment of the present invention, the positive samples and their corresponding labels, the negative samples and their corresponding labels are input into a binary classification model for supervised learning, including: inputting the positive samples and their corresponding labels, the negative samples and their corresponding labels into a binary classification model for supervised learning, the binary classification model includes multiple task branches, and the multiple task branches include a single category task branch and a multi-category combination task branch; and, during the supervised learning process of the binary classification model, defining a first loss function and a second loss function corresponding to the single category task branch and the multi-category combination task branch, respectively, weighting the first loss function and the second loss function to obtain a comprehensive loss function, taking minimizing the comprehensive loss function as a learning goal, and updating the parameters of the multi-task branch at the same time, thereby obtaining an anomaly detection model.

[0091] Specifically, in order to further improve the training performance of the binary classification model, based on the fact that the training samples of an embodiment of the present invention include two types (single-category packages and multi-category combination packages), an embodiment of the present invention constructs a multi-task branch including a single-category task branch and a multi-category combination task branch in the binary classification model to better meet the needs of training samples.

[0092] Figure 6It is a schematic diagram of the composition of the multi-task branch of the binary classification model of the embodiment of the present invention. The input layer of the binary classification model receives the input package data, and extracts the deep features of the input data through multiple shared hidden layers. The features extracted by the shared hidden layer are shared between two tasks (single category task branch and multi-category combination task branch), thereby realizing multi-task shared learning of features. The multi-task branch of the binary classification model includes two output task branches: the first output task (also called the single category task branch) is mainly aimed at single category packages. The model outputs whether there is a weight abnormal package in the single category package. This branch focuses on processing the features of single category packages and uses the node weight features in the category co-occurrence graph to perform weight anomaly detection; the second output task (also called the multi-category combination task branch) is aimed at multi-category combination packages. The model outputs the probability of weight abnormality in the multi-category combination package. By combining multiple nodes in the category co-occurrence graph and calculating the cosine similarity between the nodes, anomaly detection of multi-category combination is performed.

[0093] Furthermore, in the supervised learning process, in order to quantify the difference between the model prediction and the true annotation to guide the update of the model parameters, this solution defines a loss function in the multi-task learning framework. The cross entropy loss function is used to calculate the first loss function of the single-category package and the second loss function of the multi-category package, and the weighted sum of the two losses forms a comprehensive loss function. The model parameters are updated to minimize the comprehensive loss function to ensure that the model performs balanced on the two tasks. Finally, the trained model is deployed to the production environment for real-time weight anomaly detection of all packages being picked.

[0094] Specifically, the first loss function Lsingle corresponding to a single category is defined as follows: , Where Nsingle represents the number of samples, i represents the package index, and y i is the true label of the i-th sample (normal weight or abnormal weight), usually taking the value of 0 or 1, p i is the probability that the i-th sample predicted by the model belongs to the positive sample.

[0095] The second loss function Lmulti corresponding to the multi-category combination is defined as follows: , Where Nmulti represents the number of samples, i represents the package index, yi is the true label of the i-th sample (normal weight or abnormal weight), usually taking the value of 0 or 1, and pi is the probability predicted by the model that the i-th sample is a positive sample.

[0096] The comprehensive loss function of the model is as follows: , Among them, α and β are weight parameters, which are set through experience and are used to balance the importance of the two tasks.

[0097] In the specific implementation, the positive samples and negative samples are first divided according to the labels into positive samples and negative samples of single-category tasks, and positive samples and negative samples of multi-category combination tasks. The positive samples and negative samples of single-category tasks and the positive samples and negative samples of multi-category combination tasks are extracted through the features of the shared hidden layer and sent to the corresponding single-category task branch and multi-category combination task branch respectively. Then, through the set comprehensive loss function, the learning goal is to minimize the comprehensive loss function, and the parameters of the multi-task branch in the binary classification model are updated at the same time, so as to obtain an anomaly detection model.

[0098] Figure 7 1 is an overall schematic diagram of the training method of the anomaly detection model of the embodiment of the present invention. First, the parcel data of historical parcels are collected, and single-category parcels and multi-category combination parcels are distinguished according to the categories to which the items contained in each parcel in the parcel data belong, and the parcel data corresponding to the different types of parcels are obtained, and the parcel data is cleaned and standardized to obtain the processed parcel data.

[0099] Then, a category co-occurrence graph is constructed based on the processed package data. Each node in the graph represents a third-level category. The edge connecting two nodes indicates that the items corresponding to the categories represented by the two nodes are in the same historical package, that is, there is a co-purchase relationship between the two categories. The category co-occurrence graph is convolved using a graph neural network to obtain the weight features of each node. Then, based on the weight features of each node, unsupervised recognition is used to detect abnormal categories and / or abnormal multi-category combinations in the package data.

[0100] Furthermore, according to the abnormal categories and / or abnormal multi-category combinations, the abnormal packages in the historical packages are determined, the package data corresponding to the abnormal packages are marked as weight abnormal packages, and negative samples are constructed. A specified number of weight-verified package data are selected from the remaining packages in the historical packages and marked as weight normal packages to construct positive samples, and the corresponding single-category package labels or multi-category combination package labels are marked according to the types of historical packages from which the positive and negative samples are derived, forming single-category task training samples (positive samples and negative samples) and multi-category combination task training samples (positive samples and negative samples). The single-category task training samples and multi-category combination task training samples are then input into the binary classification model, and the abnormal packages in the single-category packages output by the single-category task branch and the abnormal packages in the multi-category packages output by the multi-category combination task branch are obtained by extracting the node weight features of the single-category task training samples and the weight features of multiple node combinations of the multi-category combination task training samples. Finally, the first loss function and the second loss function are calculated, with minimizing the comprehensive loss function as the learning goal. At the same time, the parameters of the multi-task branch in the binary classification model are updated to obtain the anomaly detection model, and the validation set composed of package data is used to evaluate the performance of the anomaly detection model. After multiple rounds of learning and training, until the anomaly detection model has good performance, the trained anomaly detection model that can be used for online detection of package weight is obtained.

[0101] The embodiment of the present invention is based on labeling positive samples and negative samples (single category and multi-category combination), combining the single category task branch and the multi-category combination task branch in the binary classification model, and endowing the anomaly detection model with the ability to support weight anomaly detection for both single category packages and multi-category packages, so as to better and more efficiently meet actual business needs.

[0102] Based on the training method of the anomaly detection model provided above, an embodiment of the present invention further provides an abnormal package detection method, which specifically includes: obtaining package data of a package to be detected, wherein the package data includes category information and weight information of each item in each package; inputting the package data of the package to be detected into an anomaly detection model trained by any one of the training methods of the anomaly detection model mentioned above, thereby outputting a detection result of whether there is an abnormal package in the package to be detected.

[0103] Specifically, based on the anomaly detection model obtained by the above training, when receiving the abnormal package detection task, the package data of the package to be detected is obtained. The package data can be first obtained through the shared hidden layer to obtain deep high-dimensional features, and then the package to be detected can be determined based on the package data whether it belongs to a single-category package or a multi-category combination package; it can also be determined first whether the package to be detected belongs to a single-category package or a multi-category combination package, and then the deep high-dimensional features are obtained through the shared hidden layer. The order of these two steps is not strictly required. According to the type of package, the corresponding task branch is passed in, for example, a single-category package is passed in the single-category task branch, and a multi-category combination package is passed in the multi-category combination task branch, and weight anomaly detection is performed, and the detection result output by the corresponding task branch is obtained, and then it is determined whether there is a weight abnormality package in the package to be detected.

[0104] The method for abnormal package detection in the embodiment of the present invention realizes the full detection of packages, improves the detection rate of packages in picking and transportation scenarios, and uses an abnormality detection model to perform weight abnormality detection on packages to ensure the efficiency and accuracy of detection, thereby improving the execution efficiency of the entire picking and transportation process.

[0105] Figure 8 Schematic diagram of the main modules of the training device of the anomaly detection model according to an embodiment of the present invention. Figure 8 As shown, the training device 800 of the anomaly detection model mainly includes a collection module 801, a recognition module 802, a determination module 803 and a training module 804.

[0106] A collection module 801 is used to collect parcel data of historical parcels, wherein the parcel data includes category information and weight information of each item in the historical parcels, and the historical parcels include single-category parcels and multi-category combination parcels;

[0107] An identification module 802, configured to identify at least one of an abnormal category and an abnormal combination of multiple categories from the package data;

[0108] A determination module 803 is used to determine an abnormal package in the historical packages according to at least one of the abnormal category and the abnormal multi-category combination, and use the package data corresponding to the abnormal package as a negative sample and the package data corresponding to the remaining packages in the historical packages as a positive sample;

[0109] The training module 804 is used to input the positive samples and the negative samples into a binary classification model for supervised learning to obtain an anomaly detection model.

[0110] According to one embodiment of the present invention, the identification module 802 is further used to: construct a category co-occurrence graph based on the package data, each node in the category co-occurrence graph represents a category, each node stores weight information of items corresponding to the category represented by the node, and an edge connecting two nodes indicates that the items corresponding to the categories represented by the two nodes are in the same historical package; obtain weight features of each node based on the category co-occurrence graph; and identify at least one of abnormal categories and abnormal multi-category combinations present in the package data based on the weight features of each node.

[0111] According to another embodiment of the present invention, the identification module 802 is further used to: cluster the nodes according to the weight characteristics of the nodes to obtain normal clusters and abnormal clusters, and identify the nodes in the abnormal clusters as abnormal categories; for each edge, calculate the similarity between the two nodes according to the weight characteristics of the two nodes corresponding to the edge, identify the abnormal edge according to the similarity, and then obtain an abnormal multi-category combination.

[0112] According to another embodiment of the present invention, the identification module 802 is further used to: use a graph neural network to convolve the category co-occurrence graph to obtain weight features of each node.

[0113] According to another embodiment of the present invention, the training module 804 is further used to: mark labels for the positive samples and the negative samples, wherein the labels include single-category packages and multi-category combination packages; input the positive samples and their corresponding labels, and the negative samples and their corresponding labels into a binary classification model for supervised learning to obtain an anomaly detection model.

[0114] According to another embodiment of the present invention, the training module 804 is further used to: input the positive samples and their corresponding labels, and the negative samples and their corresponding labels into a binary classification model for supervised learning, the binary classification model includes multiple task branches, and the multiple task branches include a single category task branch and a multi-category combination task branch; and, in the process of supervised learning of the binary classification model, define a first loss function and a second loss function corresponding to the single category task branch and the multi-category combination task branch, respectively, weight the first loss function and the second loss function to obtain a comprehensive loss function, take minimizing the comprehensive loss function as the learning goal, and update the parameters of the multi-task branch at the same time, so as to obtain an anomaly detection model.

[0115] Fig. 9 Schematic diagram of the main modules of the abnormal package detection device according to an embodiment of the present invention. Fig. 9 As shown, the abnormal package detection device 900 mainly includes an acquisition module 901 and a detection module 902 .

[0116] An acquisition module 901 is used to acquire package data of a package to be detected, wherein the package data includes category information and weight information of each item in each package;

[0117] The detection module 902 is used to input the package data of the package to be detected into an anomaly detection model trained by any method of the training method of the anomaly detection model, so as to output a detection result of whether there is an abnormal package in the package to be detected.

[0118] Fig.10 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.

[0119] like Fig.10 As shown, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1006. The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. The network 1004 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0120] Users can use terminal devices 1001, 1002, 1003 to interact with server 1005 through network 1004 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 1001, 1002, 1003, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0121] The terminal devices 1001 , 1002 , and 1003 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0122] Server 1005 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using terminal devices 1001, 1002, and 1003 (for example only). The background management server may collect package data of historical packages, the package data including category information and weight information of each item in the historical packages, and the historical packages include single-category packages and multi-category combination packages; identify at least one of abnormal categories and abnormal multi-category combinations from the package data; determine abnormal packages in the historical packages based on at least one of the abnormal categories and the abnormal multi-category combinations, use the package data corresponding to the abnormal packages as negative samples, and use the package data corresponding to the remaining packages in the historical packages as positive samples; input the positive samples and the negative samples into a binary classification model for supervised learning to obtain an abnormal detection model and other processing, and feed back the processing results (such as an abnormal detection model - for example only) to the terminal device.

[0123] It should be noted that the abnormal package detection provided in the embodiment of the present invention is generally performed by the server 1005, and accordingly, the abnormal package detection device is generally set in the server 1005. The abnormal package detection method provided in the embodiment of the present invention can also be performed by the terminal devices 1001, 1002, and 1003, and accordingly, the abnormal package detection device can be set in the terminal devices 1001, 1002, and 1003.

[0124] It should be understood that Fig.10 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0125] Reference below Fig.11 , Fig.11 It is a schematic diagram of the structure of a computer system of a terminal device suitable for implementing an embodiment of the present invention. Fig.11 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0126] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage portion 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0127] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0128] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the above-mentioned functions defined in the system of the present invention are executed.

[0129] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0131] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device implements the following method: collect package data of historical packages, the package data includes category information and weight information of each item in the historical packages, and the historical packages include single-category packages and multi-category combination packages; identify at least one of abnormal categories and abnormal multi-category combinations from the package data; determine abnormal packages in the historical packages based on at least one of the abnormal categories and the abnormal multi-category combinations, use the package data corresponding to the abnormal packages as negative samples, and use the package data corresponding to the remaining packages in the historical packages as positive samples; input the positive samples and the negative samples into a binary classification model for supervised learning to obtain an abnormality detection model.

[0132] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A training method for an anomaly detection model, characterized in that: include: Collecting parcel data of historical parcels, wherein the parcel data includes category information and weight information of each item in the historical parcels, and the historical parcels include single-category parcels and multi-category combination parcels; Identifying at least one of an abnormal category and an abnormal combination of multiple categories from the package data; According to at least one of the abnormal category and the abnormal multi-category combination, determine the abnormal package in the historical packages, use the package data corresponding to the abnormal package as a negative sample, and use the package data corresponding to the remaining packages in the historical packages as positive samples; The positive samples and the negative samples are input into a binary classification model for supervised learning to obtain an anomaly detection model.

2. The method according to claim 1, characterized in that Identifying at least one of an abnormal category and an abnormal combination of multiple categories from the package data, including: Constructing a category co-occurrence graph according to the package data, wherein each node in the category co-occurrence graph represents a category, each node stores weight information of items corresponding to the category represented by the node, and an edge connecting two nodes represents that the items corresponding to the categories represented by the two nodes are in the same historical package; Obtaining weight features of each node according to the category co-occurrence graph; At least one of abnormal categories and abnormal multi-category combinations present in the package data is identified based on the weight characteristics of the respective nodes.

3. The method according to claim 2, characterized in that Identifying at least one of an abnormal category and an abnormal combination of multiple categories in the package data according to the weight characteristics of each node, including: Clustering the nodes according to the weight features of the nodes to obtain normal clusters and abnormal clusters, and identifying the nodes in the abnormal clusters as abnormal categories; For each edge, the similarity between the two nodes corresponding to the edge is calculated according to the weight features of the two nodes, and the abnormal edge is identified according to the similarity, thereby obtaining an abnormal multi-category combination.

4. The method according to claim 2, characterized in that: The weight features of each node are obtained according to the category co-occurrence graph, including: A graph neural network is used to convolve the category co-occurrence graph to obtain the weight features of each node.

5. The method according to claim 1, characterized in that: The positive samples and negative samples are input into a binary classification model for supervised learning to obtain an anomaly detection model, including: Labeling the positive samples and the negative samples, wherein the labels include single-category packages and multi-category combination packages; The positive samples and their corresponding labels, and the negative samples and their corresponding labels are input into a binary classification model for supervised learning to obtain an anomaly detection model.

6. The method according to claim 5, characterized in that Inputting the positive samples and their corresponding labels, and the negative samples and their corresponding labels into a binary classification model for supervised learning, including: Inputting the positive samples and their corresponding labels, and the negative samples and their corresponding labels into a binary classification model for supervised learning, wherein the binary classification model includes multiple task branches, and the multiple task branches include a single category task branch and a multi-category combination task branch; Moreover, during the supervised learning process of the binary classification model, the first loss function and the second loss function corresponding to the single-category task branch and the multi-category combination task branch are respectively defined, and the first loss function and the second loss function are weighted to obtain a comprehensive loss function. The learning goal is to minimize the comprehensive loss function, and the parameters of the multi-task branch are updated at the same time, thereby obtaining an anomaly detection model.

7. A method for detecting abnormal packages, characterized in that: include: Acquire package data of the package to be detected, wherein the package data includes category information and weight information of each item in each package; The package data of the package to be detected is input into the anomaly detection model trained by the training method of the anomaly detection model described in any one of claims 1 to 6, so as to output the detection result of whether there is an abnormal package in the package to be detected.

8. A training device for an anomaly detection model, characterized in that: include: A collection module, used to collect parcel data of historical parcels, wherein the parcel data includes category information and weight information of each item in the historical parcels, and the historical parcels include single-category parcels and multi-category combination parcels; an identification module, configured to identify at least one of an abnormal category and an abnormal combination of multiple categories from the package data; A determination module, configured to determine an abnormal package in the historical packages according to at least one of the abnormal category and the abnormal multi-category combination, and use package data corresponding to the abnormal package as a negative sample and package data corresponding to the remaining packages in the historical packages as a positive sample; The training module is used to input the positive samples and the negative samples into a binary classification model for supervised learning to obtain an anomaly detection model.

9. An abnormal package detection device, characterized in that: include: An acquisition module, used to acquire package data of the package to be detected, wherein the package data includes category information and weight information of each item in each package; A detection module is used to input the package data of the package to be detected into an anomaly detection model trained by the training method of the anomaly detection model described in any one of claims 1-6, thereby outputting a detection result of whether there is an abnormal package in the package to be detected.

10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

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

12. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.